Program to display the original value

Assignment Help JAVA Programming
Reference no: EM13941672

Math.floor may be used to round a number to a specific decimal place. The statement

y = Math.floor( x * 10 + 0.5 ) / 10;

rounds x to the tenths position (i.e., the first position to the right of the decimal point).
The statement

y = Math.floor( x * 100 + 0.5 ) / 100;

rounds x to the hundredths position (i.e., the second position to the right of the decimal point). Write an application that defines four methods for rounding a number x in various ways:

a) roundToInteger( number )

b) roundToTenths( number )

c) roundToHundredths( number )

d) roundToThousandths( number )

For each value read, your program should display the original value, the number rounded to the nearest integer, the number rounded to the nearest tenth, the number rounded to the nearest hundredth and the number rounded to the nearest thousandth.

Reference no: EM13941672

Questions Cloud

Lines of reporting and accountability : Who will be represented (this might be a consumer group, the mental health or AOD industry or a particular community group) What the scope, scale and parameters of your role as representative will be and what lines of reporting and accountability w..
Discuss the differences between crimes and torts : Discuss the differences between crimes and torts. Include differences in sanctions, parties, and burdens of proof in your answer.
Who is the audience of the communication plan : What organization will you be creating the plan for? (Real is better, but authentic hypothetical is acceptable too.) What is your topic or event for the communication plan? Who is the audience of the communication plan
Explain how your perspectives developed on the policies used : Explain whether you are aligned more toward Becarria's position on crime or the stand of biosocial theorists. Explain whether your views about an individual's ability to make a free choice to commit crime changed.
Program to display the original value : For each value read, your program should display the original value, the number rounded to the nearest integer, the number rounded to the nearest tenth, the number rounded to the nearest hundredth and the number rounded to the nearest thousandth.
Provide the missing data in the following situations : Provide the missing data in the following situations:
Annual approximate interest costs not taking discount : How do you compute annual approximate interest costs not taking a discount what conclusion can be drawn from the calculations?
Different view on mcdonalds approach to rest breaks : A different view on McDonalds approach to Rest breaks, from the Union representing a changes to the law applying to rest breaks: http://www.parliament.nz/resource/0000116617 number of McDonald's workers: http://tvnz.co.nz/national-news/mcdonald-s-..
New clubs will require an increase in net working capital : McGilla Golf has decided to sell a new line of golf clubs. The length of this project is seven years. The company has spent $1460149 on research and development for the new clubs. The plant and equipment required will cost $28973884. The new clubs wi..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a recursive method called maxsum

write a recrusive method called maxSum that accepts a list of integers. L, and an integer limit n as parameters and use backtracking to find the maximum sum that can be generated by adding elements of L that do not exceed n.

  Create a method to calculate the value of the inventory

Create another method to sort the array items by the name of the product.

  Designing a program with a while loop

The section entitled "In the Spotlight", "Designing a program with a while loop" describes the requirements for a project at Chemical Labs, Inc. Write a letter to the Director of Engineering that describe your concerns, if any, regarding these re..

  Write a program that draws a picture of a house

Write a program that draws a picture of a house. It could be as simple as the accompanying figure, or if you like, make it more elaborate

  Fixing errors in a java program

You coded the following on line ten of the class MyApplet.java:

  Write a java program that draws a square abcd

Write a java program that draws a square ABCD. The points A and B are arbitrarily specified by the user by clicking the mouse button. The orientation of the points should be counter-clockwise.

  An elementary calculation yields the result

An elementary calculation yields the result that theoretically, the probability of turning up 7 when two dice are thrown is 1/6, or .166666. But what if more dice are thrown? If 3 dice are thrown, what is the probability that some 2 of three sum to 7..

  Create your listarray class

Create your ListArray class that is functionally similar to the formal Java ArrayList Utility class. here are the requirements

  Create a javafx application named runningman.java

Create a JavaFX application named RunningMan.java to animate a man running laps. The man should run from left to right until the edge of the window is reached. The man should then begin running in the opposite direction.

  Discuss the legal ramifications of the division of condo

Discuss the legal ramifications of the division of condo, BioTech and other assets. Would it make any difference if Violet sold the property after filing for the dissolution of marriage?

  Calculator for elementary school children

Write a program that is designed as a calculator for elementary school children. It will calculate addition, subtraction, multiplication, and division.

  Picky publishing house publishes stories

Picky Publishing House publishes stories in three categories and has strict require- ments for page counts in each category. Create an abstract class named Story that includes a story title, an author name, a number of pages, and a String message. In..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd