Create a new project called Trunc.java by copying and modifying TwoDPs.java program (attached) Trunc.java should loop around getting floating point (i.e. type double) numbers and displaying both the number and the running total to the nearest whole number. The program will finish when a number is entered outside of the range -100 to 100. The program should use methods to check whether the number is in this range, and then rounded to the nearest whole number. (NOTE: You are not to use the JAVA Round method, write your own method by modifying the calcTwoDPs method in TwoDPs.java). NOTE: the second image attached is following on the program from the first image - it is one program split into two.
Create a new project called Trunc.java by copying and modifying
TwoDPs.java
loop around getting floating point (i.e. type double) numbers and displaying both the number and the running total to the nearest whole number. The program will finish when a number is entered outside of the range -100 to 100. The program should use methods to check whether the number is in this range, and then rounded to the nearest whole number. (NOTE: You are not to use the JAVA Round method, write your own method by modifying the calcTwoDPs method in TwoDPs.java).
NOTE: the second image attached is following on the program from the first image - it is one program split into two.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images