* 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
icon
Related questions
Question
CENGAGE MINDTAP
Programming Exercise 3-10
|Instructions
JobPricing.java
1 import java.util.Scanner;
2 class JobPricing {
Herbert's Home Repair estimates each job cost as the cost of
3
public static void main(String[] args) {
materials plus $35 per hour while on the job, plus $12 per hour for
4
String description;
travel time to the job site.
double materials;
</>
double hoursOn Job;
double hoursTraveling;
7
The main() method prompts the user for the name of a job (for
double price;
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 job 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 +
8
example, Smith bathroom remodel), the cost of materials, the
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
14
the job and returns the computed value to the main() method
15
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 travel
// Write your code here
23
Enter hours on the job work >> 120
24
Enter hours traveling >» 0
}
26 }
25
The price for Room 210 Kitchen is $9200.0
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
Transcribed Image Text:CENGAGE MINDTAP Programming Exercise 3-10 |Instructions JobPricing.java 1 import java.util.Scanner; 2 class JobPricing { Herbert's Home Repair estimates each job cost as the cost of 3 public static void main(String[] args) { materials plus $35 per hour while on the job, plus $12 per hour for 4 String description; travel time to the job site. double materials; </> double hoursOn Job; double hoursTraveling; 7 The main() method prompts the user for the name of a job (for double price; 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 job 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 + 8 example, Smith bathroom remodel), the cost of materials, the 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 14 the job and returns the computed value to the main() method 15 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 travel // Write your code here 23 Enter hours on the job work >> 120 24 Enter hours traveling >» 0 } 26 } 25 The price for Room 210 Kitchen is $9200.0 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
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Program on Numbers
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.
Similar questions
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education