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....
-
What is the apparent weight of a 75-kg astronaut 2500 km from the center of the Moon in a space vehicle? (a) Moving at constant velocity and (b) Accelerating toward the Moon at 1.8 m /s2? State...
-
Look at the seven sources of opportunity. Which one(s) most closely describe what the founders recognized? Explain your choice(s).
-
Pick a product like Cadillac or Sara Lee Deli products or service like Mr. Clean Performance Car Wash or a car and home insurance company that is offered in a limited number of countries. Assess the...
-
(Computation of Actual Return) Gingrich Importers provides the following pension plan information. Fair value of pension plan assets, January 1, 2010 $2,400,000 Fair value of pension plan assets,...
-
An ATV has an average acceleration of 1.9 m/s 2 . If the vehicle accelerates for 5.8 s and has an initial velocity of 15 m/s [E], what is the final velocity of the ATV?
-
Ridge Development Group is formed on June 1st by John Parks and Sue Jones to operate as a calendar-year, accrual- basis company that develops and markets land to customers. John will contribute land...
-
This section is called Project Context: Company or Industry - this section should be about what are the similar issues of financial stewardship in your industry......and then specifically about your...
-
Here are today's prices of 6-month call options on stock XYZ. The current price of the stock, S(t), is $50. CALL CALL CALL Expiration 6 mths 6 mths 6 mths Strike $50.00 $60.00 $70.00 Option price...
-
You are planning to save $2,798 at the end of each year for the next 19 years. Assuming you earn a 5.1% return, how much will you have at the end of the 19 years?
-
A document that pledges title to property as security for a loan. Select one: a. Reacquisition Price b. Mortgage c. Market Rate d. Premium on Bonds
-
Q6. What's the present value of a perpetutity that pays $1,524 per year if the aprropriate interest rate is 5.3%?Round answer to 2 decimal places?
-
Calculate AB InBev's expected abnormal NOPATs between 2009 and 2018 based on the information. How does the implied trend in abnormal NOPAT compare with the general trends in the economy? Assume that...
-
For 20 years, Anne has owned and operated a riverside restaurant called The Riverside. Anne rents the property from Landlord Bob. Business was booming and Anne is on her way to becoming a...
-
Starr Co. had sales revenue of $540,000 in 2014. Other items recorded during the year were: Cost of goods sold ..................................................... $330,000 Salaries and wages...
-
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...
-
Depository institutions have been losing their advantage over other financial intermediaries in attracting customers funds. Why?
-
In the aftermath of the financial crisis of 20072009, there were calls to reinstate the separation of commercial and investment banking activities that was removed with the repeal of the...
-
The globalization of banking has led to the need for global benchmarks for interest rates. In light of the LIBOR scandal, what characteristic do you think is most central to any new interest rate...
Study smarter with the SolutionInn App