Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Java Part A Write a program named QuartsToGallons that declares a named constant ( QUARTS _ IN _ GALLON ) to hold the number

In Java Part A
Write a program named QuartsToGallons that declares a named constant (QUARTS_IN_GALLON) to hold the number of quarts in a gallon (4).
Declare a variable to represent the number of quarts needed for a painting job. Name the variable quartsNeeded, and assign 18 to it.
Compute and display the number of gallons and quarts needed for the job. Display explanatory text in the format shown in the following example.
An example of the program is shown below:
A job that needs 18 quarts requires 4 gallons plus 2 quarts.
Task 01: Create the QuartsToGallons class.
Task 02: Declared the constant QUARTS_IN_GALLONS.
Task 03: Declared the variable quartsNeeded.
Part B
Convert the QuartsToGallons program to an interactive application called QuartsToGallonsInteractive by copying the file contents from one to the other. Instead of assigning a value to the number of quarts, accept the value from the user as input.
An example of the program is shown below:
Enter quarts needed >>157
A job that needs 157 quarts requires 39 gallons plus 1 quarts.
Task 04: The QuartsToGallons program converts 18 quarts to gallons.
Task 05: Create the GallonsToQuartsInteractive class.
Task 06: The QuartsToGallonsInteractive program converts user provided quarts to gallons.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Antipatterns Avoiding The Pitfalls Of Database Programming

Authors: Bill Karwin

1st Edition

1680508989, 978-1680508987

More Books

Students also viewed these Databases questions

Question

=+How will this affect the recruiting process?

Answered: 1 week ago