Java Coding Problem

Java Coding Problem

2. Write a program given a number in any base (base 2 to base 16) and rounds that number to a
specified place. Rounding up occurs when the digit to the right of the rounding place divided by the
number’s base is 0.5 or more. For example, 0.12468 rounded to 3 places is 0.125 because 6 divided by
8 is greater than 0.5; when rounded to 2 places, it’s 0.13 because 4 divided by 8 is 0.5; and it’s 0.1
when rounded to 1 place because 2 divided by 8 is less than 0.5. Input from the keyboard three (3)
values: a number, the base of that number, and the number of places to be rounded. Assume the
numbers entered will have at least one digit to the right of the place to be rounded and at least one digit
to the left of the decimal point. Also, assume the rounding place will never be 0 (round a whole
number). For each input, output to the screen the number rounded to the given number of places. Do
not output any digits beyond the rounded place. Finally, ask the user if he/she wishes to run the
program again (check case). Refer to the sample output below.

Sample Run:
Enter the value: 0.11101
Enter the base of the number: 2
Number of decimal places to round: 4
The resulting value: 0.1111
Run again (Y/N): y
Enter the value: 35.4321
Enter the base of the number: 7
Number of decimal places to round: 3
The resulting value: 35.432
Run again (Y/N): N

Oder Solution Now

Why Use Our Services

1. Professional & Expert Writers: AResearchers only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by AResearchers are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. AResearchers is known for timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses. First time customer will receive three free pages on their first order. 

6. 24/7 Customer Support: At AResearchers, we have put in place a team of experts who answer to all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.