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
I'm scratching my head here. Am I the only person who sees the section in parentheses as a direct contradiction of the instruction preceding it (let alone the fact that 7*5 is not a sum)? It's amazing how the most trivial of academic exercises can be made complicated by people who can't word instructions clearly.
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
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?
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));