Output Test Cases Check Code Expand All Expected result: Test Testing having too much paint Your...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Output Test Cases Check Code Expand All Expected result: Test Testing having too much paint Your result: Difference: Expected result: Test Cases Your result: Difference: Expected result: Docs Minimize All Testing have exactly enough paint Pass X How many square feet do you need to paint? How many gallons of paint do you have? You have enough paint Assignment Testing not enough paint How many square feet do you need to paint? How many gallons of paint do you have? Not Enough Paint Gallons of paint required to cover the remaining area is:700.0 Gallons Message Check what you're supposed to print How many square feet do you need to paint? How many gallons of paint do you have? YNot Enough hPaint Gallons of paint required to cover the remainouingh parea is:700.0 Gallonts Grade How many square feet do you need to paint? How many gallons of paint do you have? You have enough paint X Check what you're supposed to print How many square feet do you need to paint? How many gallons of paint do you have? Not Enough Paint Gallons of paint required to cover the remaining area is:2100.0 Gallons X How many square feet do you need to paint? How many gallons of paint do you have? YNot Enough hPaint Gallons of paint required to cover the remainouingh parea is: 2100.0 Gallonts How many square feet do you need to paint? How many gallons of paint do you have? More You should not print "You have enough paint" Difference: Expected result: Your result: Testing not enough paint Difference: Testing not Expected result: Your result: Gallons of paint required to cover the remaining area is:210e.e Gallons Difference: How many square feet do you need to paint? How many gallons of paint do you have? YNot Enough hPaint Gallons of paint required to cover the remainouingh parea is:2100. Gallonts X You should not print "You have enough paint" How many square feet do you need to paint? How many gallons of paint do you have? You need 1.0 more gallons How many square feet do you need to paint? How many gallons of paint do you have? Not Enough Paint Gallons of paint required to cover the remaining area is:2900.0 Gallons How many square feet do you need to paint? How many gallons of paint do you have? YNot Enough Paint Gallons of paint required 1.0to mcover the remaining area is:2900.0 Gallons X You should print "5.0 more gallon" enough paint How many square feet do you need to paint? How many gallons of paint do you have? You need 5.0 more gallons How many square feet do you need to paint? How many gallons of paint do you have? Not Enough Paint Gallons of paint required to cover the remaining area is: 4800.0 Gallons How many square feet do you need to paint? How many gallons of paint do you have? YNot Enough Paint Gallons of paint required 5.0to mcover the remaining area is: 4800.0 Gallons 4 New + PaintCoverage.java 16.1.2 Lesson 3.2 Constructions 1 import java.util.Scanner; 2 3 class PaintCoverage 4- { 5 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 ~ 24 25 26 27 28 29 0 123458 39 40 41 30 33 36 37 41} public static void main(String[] args) { // Create Scanner object Scanner myObj double paintpurchased, sqfttocover; // Create a final double for how many // square feet 1 gallon of paint will cover final double paintcover = 10; // Ask for the square feet needed to cover System.out.println ("How many square feet do you need to paint? "); sqfttocover myObj.nextDouble(); // Ask how many gallons of paint were purchased System.out.println("How many gallons of paint do you have? "); paintpurchased = myObj.nextDouble(); // Print whether the user has enough gallons new Scanner(System.in); // If they don't, print how many more they need // Use Math.ceil(number) to round up the number of // gallons you need //in if( (paintpurchased - paintcover) >= sqfttocover) System.out.println("You have enough paint"); else { } Submit + Continue Save System.out.println("Not Enough Paint"); double pendingsqft = sqfttocover - (paintpurchased * paintcover); double paintrequired = Math.ceil(pendingsqft * paintcover); System.out.println("Gallons of paint required to cover the remaining area is:" + paintrequired +" Gall New + PaintCoverage.java 16.1.2 Lesson 3.2 Constructions 1 import java.util.Scanner; 2 public class PaintCoverage 3 4 { 5 6+ 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 public static void main(String[] args) { } // Create Scanner object // Create a final double for how many // square feet 1 gallon of paint will cover // Ask for the square feet needed to cover // Ask how many gallons of paint were purchased // Print whether the user has enough gallons // If they don't, print how many more they need // Use Math.ceil(number) to round up the number of // gallons you need Submit + Continue Save Write a program that computes if the user has enough paint to cover the area they want painted. One gallon of paint can cover 80 square feet. Ask the user how many square feet they need to paint. Ask how many gallons of paint they already have. Then print if they have enough paint. If they do, print you have enough paint. If they don't, print how many more gallons of paint they will need. Use Math.ceil to round up the number of gallons you will need. For example, if you need 2.5 gallons of paint, you would need to buy 3 gallons at the store. To compute this, use double result = Math.ceil(numGallons); Some example outputs are shown below. Output: User has enough paint How many square feet do you need to paint? 260 How many gallons of paint do you have? 4 You have enough paint Output: User does not have enough paint How many square feet do you need to paint? 460 How many gallons of paint do you have? 2 You need 4.0 more gallons Output Test Cases Check Code Expand All Expected result: Test Testing having too much paint Your result: Difference: Expected result: Test Cases Your result: Difference: Expected result: Docs Minimize All Testing have exactly enough paint Pass X How many square feet do you need to paint? How many gallons of paint do you have? You have enough paint Assignment Testing not enough paint How many square feet do you need to paint? How many gallons of paint do you have? Not Enough Paint Gallons of paint required to cover the remaining area is:700.0 Gallons Message Check what you're supposed to print How many square feet do you need to paint? How many gallons of paint do you have? YNot Enough hPaint Gallons of paint required to cover the remainouingh parea is:700.0 Gallonts Grade How many square feet do you need to paint? How many gallons of paint do you have? You have enough paint X Check what you're supposed to print How many square feet do you need to paint? How many gallons of paint do you have? Not Enough Paint Gallons of paint required to cover the remaining area is:2100.0 Gallons X How many square feet do you need to paint? How many gallons of paint do you have? YNot Enough hPaint Gallons of paint required to cover the remainouingh parea is: 2100.0 Gallonts How many square feet do you need to paint? How many gallons of paint do you have? More You should not print "You have enough paint" Difference: Expected result: Your result: Testing not enough paint Difference: Testing not Expected result: Your result: Gallons of paint required to cover the remaining area is:210e.e Gallons Difference: How many square feet do you need to paint? How many gallons of paint do you have? YNot Enough hPaint Gallons of paint required to cover the remainouingh parea is:2100. Gallonts X You should not print "You have enough paint" How many square feet do you need to paint? How many gallons of paint do you have? You need 1.0 more gallons How many square feet do you need to paint? How many gallons of paint do you have? Not Enough Paint Gallons of paint required to cover the remaining area is:2900.0 Gallons How many square feet do you need to paint? How many gallons of paint do you have? YNot Enough Paint Gallons of paint required 1.0to mcover the remaining area is:2900.0 Gallons X You should print "5.0 more gallon" enough paint How many square feet do you need to paint? How many gallons of paint do you have? You need 5.0 more gallons How many square feet do you need to paint? How many gallons of paint do you have? Not Enough Paint Gallons of paint required to cover the remaining area is: 4800.0 Gallons How many square feet do you need to paint? How many gallons of paint do you have? YNot Enough Paint Gallons of paint required 5.0to mcover the remaining area is: 4800.0 Gallons 4 New + PaintCoverage.java 16.1.2 Lesson 3.2 Constructions 1 import java.util.Scanner; 2 3 class PaintCoverage 4- { 5 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 ~ 24 25 26 27 28 29 0 123458 39 40 41 30 33 36 37 41} public static void main(String[] args) { // Create Scanner object Scanner myObj double paintpurchased, sqfttocover; // Create a final double for how many // square feet 1 gallon of paint will cover final double paintcover = 10; // Ask for the square feet needed to cover System.out.println ("How many square feet do you need to paint? "); sqfttocover myObj.nextDouble(); // Ask how many gallons of paint were purchased System.out.println("How many gallons of paint do you have? "); paintpurchased = myObj.nextDouble(); // Print whether the user has enough gallons new Scanner(System.in); // If they don't, print how many more they need // Use Math.ceil(number) to round up the number of // gallons you need //in if( (paintpurchased - paintcover) >= sqfttocover) System.out.println("You have enough paint"); else { } Submit + Continue Save System.out.println("Not Enough Paint"); double pendingsqft = sqfttocover - (paintpurchased * paintcover); double paintrequired = Math.ceil(pendingsqft * paintcover); System.out.println("Gallons of paint required to cover the remaining area is:" + paintrequired +" Gall New + PaintCoverage.java 16.1.2 Lesson 3.2 Constructions 1 import java.util.Scanner; 2 public class PaintCoverage 3 4 { 5 6+ 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 public static void main(String[] args) { } // Create Scanner object // Create a final double for how many // square feet 1 gallon of paint will cover // Ask for the square feet needed to cover // Ask how many gallons of paint were purchased // Print whether the user has enough gallons // If they don't, print how many more they need // Use Math.ceil(number) to round up the number of // gallons you need Submit + Continue Save Write a program that computes if the user has enough paint to cover the area they want painted. One gallon of paint can cover 80 square feet. Ask the user how many square feet they need to paint. Ask how many gallons of paint they already have. Then print if they have enough paint. If they do, print you have enough paint. If they don't, print how many more gallons of paint they will need. Use Math.ceil to round up the number of gallons you will need. For example, if you need 2.5 gallons of paint, you would need to buy 3 gallons at the store. To compute this, use double result = Math.ceil(numGallons); Some example outputs are shown below. Output: User has enough paint How many square feet do you need to paint? 260 How many gallons of paint do you have? 4 You have enough paint Output: User does not have enough paint How many square feet do you need to paint? 460 How many gallons of paint do you have? 2 You need 4.0 more gallons
Expert Answer:
Related Book For
Accounting Information Systems
ISBN: 9780132871938
11th Edition
Authors: George H. Bodnar, William S. Hopwood
Posted Date:
Students also viewed these programming questions
-
Show the income statement, cash flow statement and balance sheet of the company at 31/12/2020 if: 1. The company start its operations on June 1st, 2020. Over the period, it sells 50 laptop for $400....
-
The statement of activities for the ECE Children's Learning Center for fiscal year 2017, prepared by a newly hired budget employee with no NFP experience, is presented on the following page. Required...
-
Find all triples of positive integers a
-
How to prepare witnesses for trial?
-
Key comparative figures for Apple and Google follow. Required 1. Compute the book value per common share for each company using these data. 2. Compute the basic EPS for each company using these data....
-
Your go karts have a mass of 450kg and travel around a circular curve on a flat, horizontal track at a radius of 42 m. a) Draw a diagram to show the go kart on the track and add an arrow to show the...
-
Lowes Companies, Inc., is a home improvement company offering a range of products for maintenance, repair, remodeling, and decorating. During the recovery phase since the financial crisis of 2008,...
-
Apply concepts related to contract law and create a binding contract based on the conditions suggested by the instructor. Based on the contract write a descriptive essay explaining the elements and...
-
The following is the adjusted trial balance of Sierra Company. Sierra Company Adjusted Trial Balance Account Title Cash December 31 Prepaid insurance Notes receivable (due in 5 years) Buildings...
-
Given two randomly ordered integer arrays A and B each of n integer numbers. Consider the following function: bool Quiz (int A[0..n-1 ], int B[0..n-1 ], int n) { } int k = 0; for (i =0; i
-
Find the quotient & remainder using synthetic division. x323x-13 x = 5 The quotient is The remainder is
-
Given Information Initial Investment = $ 1 , 0 0 0 , 0 0 0 WACC = 1 0 % Revenue = $ 8 5 0 , 0 0 0 COGS = $ 5 4 0 , 0 0 0 Operating Expenses = $ 5 0 , 0 0 0 Depreciation Expense = $ 1 2 5 , 0 0 0 Tax...
-
KLM Company issued $ 3 million of 9 . 7 5 % $ 8 0 par preferred shares in 2 0 0 1 . Calculate the total amount of dividends paid on this issue per year and the annual amount of the dividends per...
-
Question 15 A system in dynamic balance implies that: A. There will absolutely no wear of bearings The system is critically damped B. There is no critical speed in the system The system is also...
-
Where are the olfactory sensory neurons, and why is that site poorly suited for their job?
-
Characterize each of the three major models of logical data structures. a. Tree or hierarchical models b. Network models c. Relational models
-
Identify and describe three categories of information that SAP ERP maintains in vendor master records.
-
Analyze the following data incident to machine posting of checks drawn by bank depositors: Number of checks posted .................................................. 570 Total elapsed minutes...
-
A four-volume work is on a shelf in random order. What is the probabilty that the volumes stand in the proper order from left to right or from right to left?
-
There are \(M\) defective items in a lot consisting of \(N\) items. From this lot we select \(n(n
-
The numbers \(1,2,3,4,5\) are written on five cards. Three cards are drawn in succession and at random from the deck; the resulting digits are written from left to right. What is the probability that...
Study smarter with the SolutionInn App