Question: Write a program named QuartsToGallons that declares a named constant ( QUARTS _ IN _ GALLON ) to hold the number of quarts in a
Write a program named QuartsToGallons that declares a named constant QUARTSINGALLON to hold the number of quarts in a gallon
Declare a variable to represent the number of quarts needed for a painting job. Name the variable quartsNeeded, and assign 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 quarts requires gallons plus quarts.
Task : Create the QuartsToGallons class.
Task : Declared the constant QUARTSINGALLONS.
Task : 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
A job that needs quarts requires gallons plus quarts.
Task : The QuartsToGallons program converts quarts to gallons.
Task : Create the GallonsToQuartsInteractive class.
Task : The QuartsToGallonsInteractive program converts user provided quarts to gallons.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
