Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Program Objective In this assignment you will be practicing for loops, class constant, variable's scope. Problem Create an application to convert the temperature from

image text in transcribed
image text in transcribed
image text in transcribedJava Program
Objective In this assignment you will be practicing for loops, class constant, variable's scope. Problem Create an application to convert the temperature from centigrade to Fahrenheit. Here is the formula for the conversion from centigrade to Fahrenheit: Fahrenheit = 9/5 * Centigrade +32 for example 33 centigrade is equal to (9/5 * 33 + 32) Fahrenheit. (Note the 975 will give you I since both of the operands are of type integer. Therefore, make sure to use 9.0/5 in your calculations to get the accurate result Requirements your program must satisfy all the criteria provided in the rubrics including the indentation, comments, and proper naming. your program must include methods the output of your program must be correct 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 Required class constant variable Declare a class constant to hold the value 9.0/5. Make sure to use a proper name for it. 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 the method called centi'ToFar Required methods Required methods public static void description (): this method displays a description of the app on the screen. Make sure to provide a clear description. Also, the displayed description should be surrounded by stars or any other characters of your choice (see the sample output). You are required to use a for loop to print the stars. Codes like System.out.println(" ******) will not be accepted. public static void CentiToFar(): This method converts centigrade temperate in the range of 0 - 45 to its equivalent Fahrenheit . in this method you need to do the following 1. display the column headers "Centigrade" and "Fahrenheit (look at the sample output 2. create a for loop looping through numbers 0-45. the initial value for the loop control variable is zero and the last value is 45. inside this loop do the following a declare a variable of type double to hold the Fahrenheit temperature b. use the given formula to calculate the temperature in Fahrenheit. the formula is 9/5 *c+32. you need to replace the letter c with the loop control variable that you have declared for the for loop. c. display the content of the loop control variable which is representing the temp in centigrade and the calculated temperature in Fahrenheit. public static void main(String[] args): in this method do the following 1. call the description method 2. call the centiToFar method Type Casting Type casting can be used to get rid of the decimal points in a double number, for example, if x = 12.3456678, System.out.println(int)x) will display 12. Sample output is in the next page Sample output: The stars and the table of the temperatures must be generated using for loops. I have used type casting to get rid of the decimal points for the calculated Fahrenheit temperature. Welcome to the Temp converter app Type Casting Type casting can be used to get rid of the decimal points in a double number, for example, if x = 12.3456678, System.out.println((int)x) will display 12. Sample output is in the next page Sample output: The stars and the table of the temperatures must be generated using for loops. I have used type casting to get rid of the decimal points for the calculated Fahrenheit temperature. Welcome to the Ten converter This app provides the temperatures in both centigrade and Farinheit Centigrade Fahrenheit 33 57 le 11 12 13 14 15 16 12 18 19 20 21 22 = 39 100 102 104 305 41 42 44 45 109 111 113

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

Big Data, Mining, And Analytics Components Of Strategic Decision Making

Authors: Stephan Kudyba

1st Edition

1466568704, 9781466568709

More Books

Students also viewed these Databases questions