subject

For this assignment, you will complete the Paint program by adding code that calculates the number of cans of paint needed to paint a wall, given its height and width. The following table shows four different test cases with sample input and output values that your completed program will need to handle. Input:Input:Input:Input:
30
257.5
22.820
3525.4
21.6
Output:Output:Output:Output:
Paint needed: 2.142857142857143 gallons
Cans needed: 3.0 can(s)Paint needed: 0.48857142857142855 gallons
Cans needed: 1.0 can(s)Paint needed: 2.0 gallons
Cans needed: 2.0 can(s)Paint needed: 1.5675428571428571 gallons
Cans needed: 2.0 can(s)
First, you will select a method that appropriately handles all of the included test cases by consulting the official Java documentation for the Math class. Use the following tips to help you navigate the documentation:
Scroll to the Method Summary section of the Math class and review the methods and their descriptions. Look for a method that will help you round a value up to the nearest integer.
If a method looks promising, click on its name to see a more detailed description. Pay special attention to the argument(s) and the data type of the return value.
Based on your review, select one or more methods from the Math class to use in your program.
Open the Virtual Lab by clicking on the link in the Virtual Lab Access module. Then open your IDE and upload the Paint2.zip folder. Review the code for the Paint2.java class, looking for the comment //Complete this code block. Here, you will implement your selected method so that your program meets the required functionality. The program should do the following:
Calculate the number of paint cans needed to paint the wall.
Round up to the nearest integer. Use the test cases to check your work.
Output the number of cans needed for the user.

TIP: When implementing your selected method from the Math class, use the syntax Math. methodname(). For example, if you decided to use the absolute value method, you would write the following code: Math. abs().

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 14:30
The basic work area of the computer is it screen that you when you first fire up your computer
Answers: 1
question
Computers and Technology, 24.06.2019 05:30
How do i get rid of my member ship for
Answers: 2
question
Computers and Technology, 24.06.2019 16:50
7.23 main lab 7 - online shopping cart background this main lab extends the earlier prep lab "online shopping cart part 1". (you should save this as a separate project from the earlier prep lab). you will create an on-line shopping cart like you might use for your on-line purchases. the goal is to become comfortable with setting up classes and using objects. requirements this lab can be done individually or as pair programming. expanded itemtopurchase class (15 points) extend the itemtopurchase class as follows. we will not do unit testing in this lab so we will not be giving you the names of the member functions. create good ones on your own. create a parameterized constructor to assign item name, item description, item price, and item quantity (default values of "none" for name and description, and 0 for price and quantity). additional public member functions set an item description get an item description print the cost of an item - outputs the item name followed by the quantity, price, and subtotal (see example) print the description of an item - outputs the item name and description (see example) additional private data members a string for the description of the item. example output of the function which prints the cost of an item: bottled water 10 @ $1.50 = $15.00 example output of the function which prints the item description:
Answers: 1
question
Computers and Technology, 24.06.2019 22:00
True or false technology is often discovered by accident
Answers: 2
You know the right answer?
For this assignment, you will complete the Paint program by adding code that calculates the number o...
Questions
question
History, 12.12.2021 08:40
question
Mathematics, 12.12.2021 08:40
question
Mathematics, 12.12.2021 08:40
question
History, 12.12.2021 08:50
question
Mathematics, 12.12.2021 08:50
question
Mathematics, 12.12.2021 08:50
Questions on the website: 13722359