* 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

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter10: Introduction To Inheritance
Section: Chapter Questions
Problem 14RQ
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning