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

  The class date was designed and implemented

In Programming Exercise 2, the class Date was designed and implemented to keep track of a date, but it has very limited operations. Redefine the class date so that, it addition to the operations already defined, it can perform the following operation..

  Arguments a minimum value and a maximum value

Write a function that takes as arguments a minimum value and a maximum value and plots sin(x) from the specified minimum to the specified maximum.

  User session mgr - socket and thread programs

User Session Mgr - Socket and Thread Programs

  Prepare an address book to save the complete information

Prepare an address book to save the complete information of the person - Define the class Address that can store a street address, city, state, and zip code. Use the appropriate methods to print and store the address.

  Calculate and display the total retail value of all products

Your application must calculate and display the total retail value of all products sold after all five pairs of inputs are completed - Write a Java application that prompts the user for pairs of inputs of a product number

  Determine when the application should stop looping display

Write an application that reads a series of pairs of numbers as follows: 1) product number 2) quantity sold - Create an application in java

  Create a class called invoice that a hardware store may use

Create a class called Invoice that a hardware store may use to represent an invoice for an item sold at the store.  The class should have four (4) instance variables: part number : string and part description : string (what is the item)

  Screenshots for actual output after testing

Coversheet Title page (including acknowledgements) Table of contents Design Include the algorithm and class diagram of your code under this section 5. Testing Use the table given below to provide your test data. Include screenshots for actual outp..

  Design a small wbis using elements from the disciplines

Design a small WBIS using elements from the disciplines of web design, database design, software engineering and object modelling;be able to develop a small WBIS using HTML forms, Java Servlets and cookies.

  Calculates the square root of each number

Write a Java program that reads in 10 integers and displays the biggest and second biggest number from them.

  Write a java program

To become familiar with how infix expressions can be converted to postfix expressions.

  Create set methods for color and height, but not for price

Create a class for the business named Candle that contains data fields for color, height, and price. Create get methods for all three fields

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