Java Programming
Java Programming
9th Edition
ISBN: 9780357616635
Author: Joyce Farrell
Publisher: CENGAGE L
bartleby

Concept explainers

bartleby

Videos

Expert Solution & Answer
Book Icon
Chapter 3, Problem 10PE

Explanation of Solution

Program code:

JobPricing.java

//import the packages

import java.util.Scanner;

//define class JobPricing

class JobPricing

{

//define main() method

public static void main(String[] args)

{

//variable to store name of the job

String description;

//variable to store cost of materials

double materials;

//variable to store working hours

double hoursOnJob;

//variable to store traveling hours

double hoursOnTraveling;

//variable to store total cost for the job

double price;

//create an object of Scanner

Scanner input = new Scanner(System.in);

//prompt for job name

System.out.print("Enter job description >> ");

//reading job name

description = input.nextLine();

//prompt for cost of materials

System.out.print("Enter cost of materials >> ");

//reading cost of materials

materials = input.nextDouble();

//prompt for working hours

System.out.print("Enter hours on the job work >> ");

//reading working hours

hoursOnJob = input.nextDouble();

//prompt for traveling hours

System.out.print("Enter hours traveling >> ");

//reading traveling hours

hoursOnTraveling = input.nextDouble();

//calling method computePrice to calculate total cost

price = computePrice(materials, hoursOnJob, hoursOnTraveling);

//printing output

System.out...

Blurred answer
Students have asked these similar questions
show work
show work on paper
show work on paper
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
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Introduction to Classes and Objects - Part 1 (Data Structures & Algorithms #3); Author: CS Dojo;https://www.youtube.com/watch?v=8yjkWGRlUmY;License: Standard YouTube License, CC-BY