Computers and Technology

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().

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 20:00, darlene93
An excel which cell contains =b2 is copied to row below, the same column. what will be the new cell's content
Answers: 2
image
Computers and Technology, 23.06.2019 07:10, anika420
If you want to import a picture into a dtp application, what must you do first? draw an image frame. import text. open the folder containing the file. select get image… from the windows menu.
Answers: 2
image
Computers and Technology, 23.06.2019 09:20, lovely222
How to print: number is equal to: 1 and it is odd number number is equal to: 2 and it is even number number is equal to: 3 and it is odd number number is equal to: 4 and it is even number in the console using java using 1 if statement, 1 while loop, 1 else loop also using % to check odds and evens
Answers: 3
image
Computers and Technology, 23.06.2019 19:00, Heyitsbrandi
Now you’re on your own. include a short summary of this section with plots in your lab report. write a matlab script file to do steps (a) through (d) below. include a listing of the script file with your report. 1 the soundsc(xx, fs) function requires two arguments: the first one (xx) contains the vector of data to be played, the second argument (fs) is the sampling rate for playing the samples. in addition, soundsc(xx, fs) does automatic scaling and then calls sound(xx, fs) to actually play the signal. mcclellan, schafer, and yoder, dsp first, 2e, isbn 0-13-065562-7. prentice hall, upper saddle river, nj 07458. c 2015 pearson education, inc. 4 mcclellan, schafer and yoder, signal processing first. prentice hall, upper saddle river, new jersey, 2003. c 2003 prentice hall. (a) generate a time vector (tt) to cover a range of t that will exhibit approximately two cycles of the 4000 hz sinusoids defined in the next part, part (b). use a definition for tt similar to part 2.2(d). if we use t to denote the period of the sinusoids, define the starting time of the vector tt to be equal to t , and the ending time as ct . then the two cycles will include t d 0. finally, make sure that you have at least 25 samples per period of the sinusoidal wave. in other words, when you use the colon operator to define the time vector, make the increment small enough to generate 25 samples per period. (b) generate two 4000 hz sinusoids with arbitrary amplitude and time-shift. x1.t / d a1 cos.2
Answers: 1
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: