Computers and Technology
Computers and Technology, 14.10.2021 23:20, ari313

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:30257.522.8 203525.421.6Output:Output:Output:Ou tput:Paint needed: 2.142857142857143 gallonsCans needed: 3.0 can(s)Paint needed: 0.48857142857142855 gallonsCans needed: 1.0 can(s)Paint needed: 2.0 gallonsCans needed: 2.0 can(s)Paint needed: 1.5675428571428571 gallonsCans 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().

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 00:30, Angellbatton6763
At an open or uncontrolled intersection, yield if a. your road is paved and the crossroad is not b. the cross road is paved and yours is not c. you have two or more passengers in your vehicle d. you did not yield in the last intersection
Answers: 1
image
Computers and Technology, 23.06.2019 06:00, ashleyd198308
Respond to the following in three to five sentences. select the workplace skill, habit, or attitude described in this chapter that you believe is most important for being a successful employee.
Answers: 1
image
Computers and Technology, 24.06.2019 01:30, Cinders13
How can you make your column headings stand out?
Answers: 1
image
Computers and Technology, 24.06.2019 07:00, janeliles
Why would a business likely use a java applet - to back up their data files for the business - to create a program that a customer can launch in their web browser - to create music on a powerpoint presentation - to organize files on their company directory
Answers: 3
Do you know the correct answer?
For this assignment, you will complete the Paint program by adding code that calculates the number o...

Questions in other subjects: