Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions 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
expand button
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
Check Mark
Knowledge Booster
Background pattern image
Computer Science
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
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education