Reference no: EM132170648
Using Java. Using Eclipse, write a program that first asks the user to enter three real numbers using GUI input.
Print the sum if all three numbers are positive, print the product of the two positive numbers if only one is negative - use one nested if.
Then, ask the user to enter two real numbers from the console. If both numbers are negative, print the quotient.
All output should be to a dialog and the console - console output must done using printf and format specifiers. Use meaningful vaiable names, infomative prompts and label output.
Write a method getFloat to ask for the real numbers. Good program structure, indentation, a heading and comments are required.
Something similar to this format.
import java.util.Scanner;
public class Example3 {
public static getInt(){
String strnum = JOptionPane.showinputDialog("Enter a real number");
return Integer.parseInt(strnum);
public static void main(String args[]){
Scanner input = new Scanner (System.in);
System.out.println("Enter real numbers");
ect. ect... if statements.. else if statement.