Netbeans Java Programming Help Needed ASAP!

Status
Not open for further replies.

jgonzo

Honorable
Oct 5, 2012
11
0
10,560
0
Need help with the following problem ASAP.

Problem:
Use netbeans to write a java program that prints the following expressions. Output the result of calculations not the literal value, when displaying the answers. (For instance display 7*5, not 12). Decimals should be displayed as shown.
The sum of 7 and 5 is 12
The product of 6 and 3 is 18
The square of 5 is 25.0
52 divided by 3.0 is 17.333
 

jgonzo

Honorable
Oct 5, 2012
11
0
10,560
0
Thank you! I was thinking the same thing about the instructions. To make it worse I can't get a response in what she really wants, super irritating but glad it wasn't just me seeing it that way. Thank you
 

jgonzo

Honorable
Oct 5, 2012
11
0
10,560
0
I was thinking to set it up as System.out.println("7+5");
Then continuing for the next and the next, but then again that is sooo stupid easy that it makes me doubt that is what she wants. Per her instructions it says not the literal value which would display just 12 is not wanted, so don't set it up as a solved expression, agreed?
 

jgonzo

Honorable
Oct 5, 2012
11
0
10,560
0
Found out how to do them in the proper format, now my issue is with the last two. I don't know how, or if, there is a proper way to do squares in that format? Also, how do you do placeholders? I know its System.out.printf as the opener, but I get confused on how you put the %.2f and where because I keep getting errors.
System.out.println("The sum of 7 + 5 is " + (7+5));
System.out.println("The product of 6 * 3 is " + (6*3));
System.out.println("The square of 5 is " + (5*5));
System.out.printf("52 / 3.0 is " + (52/3.0));
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
aymen9309 Apps General Discussion 1
SyndiShanX Apps General Discussion 1
D Apps General Discussion 1
BlueMoon1890 Apps General Discussion 0
Neon The (Anthro) Umbreon Apps General Discussion 1
K Apps General Discussion 2
T Apps General Discussion 10
M Apps General Discussion 2
R Apps General Discussion 3
S Apps General Discussion 2
N Apps General Discussion 1
P Apps General Discussion 4
A Apps General Discussion 8
M Apps General Discussion 6
A Apps General Discussion 3
J Apps General Discussion 4
Heiski Apps General Discussion 1
A Apps General Discussion 4
H Apps General Discussion 1
A Apps General Discussion 1

ASK THE COMMUNITY