* CENGAGE | MINBTAP Programming Exercise 3-10 D Instructions + JobPricing.java 1 import java.util.Scanner; 2 class JobPricing { Herbert's Home Repair estimates each job cost as the cost of public static void main(String[] args) { String description; double materials; 3 materials plus $35 per hour while on the job, plus $12 per hour for 4 travel time to the job site. /> double hoursonJob; double hoursTraveling; double price; 7 The main() method prompts the user for the name of a job (for 8 example, Smith bathroom remodel), the cost of materials, the Scanner input = new Scanner(System.in); System.out.print("Enter job description » "); description = input.nextLine(); System.out.print("Enter cost of materials >> "); materials = input.nextDouble(); System.out.print("Enter hours on the j ob work >> "); hoursOnJob = input.nextDouble(); System.out.print("Enter hours traveling » "); hoursTraveling = input.nextDouble(); price = computePrice(materials, hoursOnJob, hoursTraveling); System.out.println("The price for " + description + 9 number of hours of work required, and the number of hours travel 10 time. 11 12 Pass the numeric data to a method that computes an estimate for 13 %3D 14 the job and returns the computed value to the main() method 15 %3D which displays the job name and estimated price. 16 17 An example of the program is shown below: 18 19 20 " is $" + price); Enter job descriptpon >> Room 210 Kitchen 21 } 22 Enter cost of materials >> 5,000 public static double computePrice(double materials, double hours, double t // Write your code here } 23 Enter hours on the job work >> 120 24 Enter hours traveling >> 0 25 The price for Room 210 Kitchen is $9200.0 26 } Grading Write your Java code in the area on the right. Use the Run button to compile and run the code. Clicking the Run Checks button will run pre-configured tests against your code to calculate a grade. Once you are happy with your results, click the Submit button to
* CENGAGE | MINBTAP Programming Exercise 3-10 D Instructions + JobPricing.java 1 import java.util.Scanner; 2 class JobPricing { Herbert's Home Repair estimates each job cost as the cost of public static void main(String[] args) { String description; double materials; 3 materials plus $35 per hour while on the job, plus $12 per hour for 4 travel time to the job site. /> double hoursonJob; double hoursTraveling; double price; 7 The main() method prompts the user for the name of a job (for 8 example, Smith bathroom remodel), the cost of materials, the Scanner input = new Scanner(System.in); System.out.print("Enter job description » "); description = input.nextLine(); System.out.print("Enter cost of materials >> "); materials = input.nextDouble(); System.out.print("Enter hours on the j ob work >> "); hoursOnJob = input.nextDouble(); System.out.print("Enter hours traveling » "); hoursTraveling = input.nextDouble(); price = computePrice(materials, hoursOnJob, hoursTraveling); System.out.println("The price for " + description + 9 number of hours of work required, and the number of hours travel 10 time. 11 12 Pass the numeric data to a method that computes an estimate for 13 %3D 14 the job and returns the computed value to the main() method 15 %3D which displays the job name and estimated price. 16 17 An example of the program is shown below: 18 19 20 " is $" + price); Enter job descriptpon >> Room 210 Kitchen 21 } 22 Enter cost of materials >> 5,000 public static double computePrice(double materials, double hours, double t // Write your code here } 23 Enter hours on the job work >> 120 24 Enter hours traveling >> 0 25 The price for Room 210 Kitchen is $9200.0 26 } Grading Write your Java code in the area on the right. Use the Run button to compile and run the code. Clicking the Run Checks button will run pre-configured tests against your code to calculate a grade. Once you are happy with your results, click the Submit button to
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education