Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA please follow the steps that are given and please add comments to your code. - This assignment covers the module for this week. -

JAVA please follow the steps that are given and please add comments to your code.

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

- This assignment covers the module for this week. - Please go through the module and all the practice problems before doing the assignment - a program shell has been provided. You are required to create names for each required method - feel free to create your own program from the scratch. Make sure that you include methods in your solution - Please fill in the comment section that is provided in the shell 1. Read through the gallon to litter-1 (1) (1).docx 2. Download the file 3. Open the file using the JGrasp or any other IDE 4. Edit the line "public class ChooseYourOwnName " by replacing the ChooseYourOwnName to a name of your choice. Make sure to include your last name. For example my selected name would be "public class Objective In this assignment you will be practicing for loops, class constant, and variable's scope. Problem Create an application to convert the gallon to litter. - One gallon is equal to 3.78 litter - As an example, 3 gallons =33.78 litter Requirements - In this assignment you are required to created names for the java class and all the methods. Make sure to follow the naming rules and conventions. - Your program must satisfy all the criteria provided in the rubrics including the indentation, block comments, comments throughout the code, and proper naming. - Your program must include methods - The output of your program must be correct and must match the provided output - you can modify the provided shell but make sure that you are not changing the assignment and its functionalities. You can implement the code based on your logic. - Must decompose the problem into different methods. - Work submitted with just the main method will receive very little partial credit or no credit at all - The name of the methods must be created by you. Names such as method 1 or method 2 is not accepted Required class constant variable - Declare a class constant to hold the value for 3.78. What should be the name for the class constant? What is the naming convention for a class constant? - The name of a class constant should be all capitalized. If there are more than one words in the selected name, sperate the words using an underscore. for example, TAX_RATE is a valid class constant name. - This class constant must be used in your code instead of 3.78 Required methods (Choose proper names for each method) 1. Method \#1: This method displays a description of the app on the screen. Make sure to provide a clear description. In this method create a box(refer to the output) and place the description of the program in the box. Make sure to use for loop in this method since we need to display one character many times. For example, To display we need a for loop. Solutions without a for loop will lose points. 2. Method \#2: This method converts the gallon to litters and creates a table. See the sample output. In this method do the following: a. display the column headers "Gallon" and "Litter" outside the for loop (look at the sample output b. create a for loop looping through numbers 1-9. Loop control variable represents the number of the gallons. Inside this loop do the following for ( 1 to 100 ) i. Declare a variable of type double (Choose a proper name) ii. Calculate the litter amount and store it in the variable that you just declared (Class constant must be used here) iii. Display the content of the loop control variable (gallon) and display the litter amount that was calculate iv. Increment the loop control variable by 4. (Refer to the output) 3. Main method: in this method do the following a. call the method \#1 b. call the method \#2 / Name : date: Description of what this program does self grade: */ public class ChooseYourName //

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

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions

Question

3. Are our bosses always right? If not, what should we do?

Answered: 1 week ago

Question

2. What, according to Sergey, was strange at this meeting?

Answered: 1 week ago