Create a new project called Trunc.java either by copying and modifying TwoDPs.java or by typing that source code from scratch. 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 but write your own method by modifying the calcTwoDPs method in TwoDPs.java).

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter8: Advanced Method Concepts
Section: Chapter Questions
Problem 8E
icon
Related questions
Question

Create a new project called Trunc.java either by copying and modifying
TwoDPs.java or by typing that source code from scratch. 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 but write your own method by modifying the
calcTwoDPs method in TwoDPs.java).

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Top down approach design
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr