Your cousin owns an automotive maintenance shop that performs routine maintenance on cars. He has asked you to write a program that will provide a list of services (and their respective prices) to users and allow them to choose any, or all, services they would like and display the final price, including a 34% labor charge, a 14% markup if the car is an import, a 4% Covid-19 Sanitizing fee, and an 9.5% sales tax. Task To accomplish the above, do the following: • Write the two methods outlined below. • Test your program and screenshot your successful test.

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

Your cousin owns an automotive maintenance shop that performs routine maintenance on cars. He has asked you to write a program that will provide a list of services (and their respective prices) to users and allow them to choose any, or all, services they would like and display the final price, including a 34% labor charge, a 14% markup if the car is an import, a 4% Covid-19 Sanitizing fee, and an 9.5% sales tax.

Task

To accomplish the above, do the following:

• Write the two methods outlined below.

• Test your program and screenshot your successful test.

carMaintenance method

This method should accept the make of the car as a parameter (e.g., BMW, Ford, Ferrari, etc.). It should display the services and their prices as follows: Services: Emissions System Repair, Tune Up, Timing Belt Replacement, Transmission Service, respectively: 669.99, 259.99, 885.99, 169.99 These should be stored in parallel arrays. Ask the user to select a service from the list presented for his . Allow the user to request as many services as he wants. Use an accumulator to total the price for all services requested. This method should return the total price to main. Do not call the calcFinalPrice method inside of this method – the point here is for you to write a method that returns a value.

calcFinalPrice method

This method should accept, as a parameter, the total price that was passed to main from the carMaintenance method and whether or not the car is an import. This method should add 34% to the price for labor. Then, take on 14% if the car is an import. Then a 4% Covid-19 Sanitizing Fee. Then an 9.5% sales tax. Finally, the method should output the final price. Do not return the final price here, simply print from this method. To test your methods in main, Ask the user for the appropriate information needed to pass to your methods (hint: you will only need to ask for 2 things). Invoke (call) each method, passing the appropriate information.

Hints

• Before invoking (calling) your methods consider asking the user for both the make and if the car is an import. Use an if statement to turn the yes or no response into a boolean.

• Example: Adding 25% to the price, then 7% is not the same as adding 32%. For example, if the cost is $100, 25% + 7% is $133.75. At 32%, this price is $132.00.

### Transcript of Car Service Cost Estimation in Java Program

**Program Execution:**

- **Command Executed:** 
  - `jGRASP exec: java Assignment4MethodsSP2022`
  
- **User Input and Interaction:**
  - The program prompts the user: "What is the Make of your Car?"
    - User enters: `BMW`
  - The program asks: "Is your Car an Import Model?"
    - User inputs: `y` (yes)

- **Available Services and Costs:**
  - Services offered include:
    - Emissions System Repair - $669.99
    - Tune Up - $259.99
    - Timing Belt Replacement - $885.99
    - Transmission Service - $169.99

- **Service Selection:**
  - For each service, the user is prompted to select 'Y' (yes) or 'N' (no):
    - **Emissions System Repair:**
      - Input: `y`
    - **Tune Up:**
      - Input: `y`
    - **Timing Belt Replacement:**
      - Input: `y`
    - **Transmission Service:**
      - Input: `n`

- **Cost Calculation:**
  - The total price before tax and labor: `$1815.97`
  - Final price including taxes and labor: `$3159.12`

- **Completion:**
  - The program concludes with: 
    - `-----jGRASP: operation complete.`

This transcript illustrates a Java program designed to calculate the estimated cost for various car services, providing a detailed interaction between the user and the system with step-by-step costs and selections.
Transcribed Image Text:### Transcript of Car Service Cost Estimation in Java Program **Program Execution:** - **Command Executed:** - `jGRASP exec: java Assignment4MethodsSP2022` - **User Input and Interaction:** - The program prompts the user: "What is the Make of your Car?" - User enters: `BMW` - The program asks: "Is your Car an Import Model?" - User inputs: `y` (yes) - **Available Services and Costs:** - Services offered include: - Emissions System Repair - $669.99 - Tune Up - $259.99 - Timing Belt Replacement - $885.99 - Transmission Service - $169.99 - **Service Selection:** - For each service, the user is prompted to select 'Y' (yes) or 'N' (no): - **Emissions System Repair:** - Input: `y` - **Tune Up:** - Input: `y` - **Timing Belt Replacement:** - Input: `y` - **Transmission Service:** - Input: `n` - **Cost Calculation:** - The total price before tax and labor: `$1815.97` - Final price including taxes and labor: `$3159.12` - **Completion:** - The program concludes with: - `-----jGRASP: operation complete.` This transcript illustrates a Java program designed to calculate the estimated cost for various car services, providing a detailed interaction between the user and the system with step-by-step costs and selections.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Reference Types in Function
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