Java programming using intellij. Q1: Celsius Temperature Table The formula

Java programming using intellij.

Q1: Celsius Temperature Table

The formula for converting a temperature from Fahrenheit to Celsius is

C = 5 / 9 ( F 32 )

where F is the Fahrenheit temperature and C is the Celsius temperature. Write a method named celsius that accepts a Fahrenheit temperature as an argument. The method should return the temperature, converted to Celsius. Demonstrate the method by calling it in a loop that displays a table of the Fahrenheit temperatures 0 through 20 and their Celsius equivalents.

Q2: Test Average and Grade

Write a program that asks the user to enter five test scores. The program should display a letter grade for each score and the average test score. Write the following methods in the program:

• calcAverage—This method should accept five test scores as arguments and return the average of the scores.• determineGrade—This method should accept a test score as an argument and return a letter grade for the score, based on the following grading scale:

ScoreLetter Grade

90–100​​ A

80–89 ​​B

70–79 ​​C

60–69 ​​D

Below 60 ​​F

Q3: Conversion Program

Write a program that asks the user to enter a distance in meters. The program will then pre-sent the following menu of selections:

1. Convert to kilometers

2. Convert to inches

3. Convert to feet

4. Quit the program

The program will convert the distance to kilometers, inches, or feet, depending on the user’s selection. Here are the specific requirements:

• Write a void method named showKilometers, which accepts the number of meters as an argument. The method should display the argument converted to kilometers. Convert the meters to kilometers using the following formula:

kilometers = meters * 0.001

• Write a void method named showInches, which accepts the number of meters as an argument. The method should display the argument converted to inches. Convert the meters to inches using the following formula:

inches = meters * 39.37

• Write a void method named showFeet, which accepts the number of meters as an argument. The method should display the argument converted to feet. Convert the meters to feet using the following formula:

feet = meters * 3.281

• Write a void method named menu that displays the menu of selections. This method should not accept any arguments.• The program should continue to display the menu until the user enters 4 to quit the program.• The program should not accept negative numbers for the distance in meters.• If the user selects an invalid choice from the menu, the program should display an error message.

Here is an example session with the program, using console input. The user’s input is shown in bold.

Enter a distance in meters: 500 [Enter]

1. Convert to kilometers

2. Convert to inches

3. Convert to feet

4. Quit the program

Enter your choice: 1 [Enter]

500 meters is 0.5 kilometers.

1. Convert to kilometers

2. Convert to inches

3. Convert to feet

4. Quit the program

Enter your choice: 3 [Enter]

500 meters is 1640.5 feet.

1. Convert to kilometers

2. Convert to inches

3. Convert to feet

4. Quit the program

Enter your choice: 4 [Enter]

Bye!

Q4: Present Value

Suppose you want to deposit a certain amount of money into a savings account, and then leave it alone to draw interest for the next 10 years. At the end of 10 years, you would like to have $10,000 in the account. How much do you need to deposit today to make that happen? You can use the following formula, which is known as the present value formula, to find out:

P = F / ( 1 + r ) n

The terms in the formula are as follows:

P is the present value, or the amount that you need to deposit today.• F is the future value that you want in the account. (In this case, F is $10,000.)• r is the annual interest rate.• n is the number of years that you plan to let the money sit in the account.

Write a method named presentValue that performs this calculation. The method should accept the future value, annual interest rate, and number of years as arguments. It should return the present value, which is the amount that you need to deposit today. Demonstrate the method in a program that lets the user experiment with different values for the formula’s terms.

Deliverables:

1. Source codes – 4 X 20 = 80%2. Screenshots of the program output. – 4 X 5 = 20%

Note: Sparingly comment your java source code, save all the files in your_lastname_lab_2 folder, zip it, and upload for grading.

Thank you!

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

Print out form and watch online training for the OSU

  Print out form and watch online training for the OSU TBI Identification Method: Traumatic Brain Injury (osu.edu) (self-paced, 45-60 minutes) This online training instructs individuals on how to screen a client for lifetime history of TBI using the Ohio State University TBI Identification Method (OSU TBI-ID), a 3-5 minute

DQ: Public Health Planning Programs Historically, public health planning was

  DQ: Public Health Planning Programs Historically, public health planning was established to increase the success of health programs. It gradually became a significant component for the public health discipline. In the process, theories and models, such as the logic model, became essential tools to include while assessing programs. Using

You are to create your own presentation slide set on

You are to create your own presentation slide set on bacteria and viruses. You may use PowerPoint to complete this activity. *Grading will be a deduction of 5 points out of 100 per inaccuracy noticed. Please follow the outline for each slide below for your presentation:  Slide 1: What is

Plastic Waste in the UAE

 For the information you can research online or approximate. and for the sources as many as you need Essay format- a. Write the topic and your group member names in the front page b. followed by the Essay for the sub- titles/ questions given under each topic and c. Finally,

Access the following to complete this Assessment: National Association for

  Access the following to complete this Assessment: This assessment has 3-parts.  Click each of the items below to complete this assessment.  Part I: Research Brief Select a topic of interest. What current problems, policies, or issues affect the health, safety, or education of young children and families? Which of

Develop a business plan for a start-up company that plans

  Develop a business plan for a start-up company that plans to sell a product or service in a local market, in a national market, or on the Internet. Select one of your favorite products as the basis for the company, or invent a product.A. Write an executive summary (suggested

One expert said that public health efforts to limit adolescent

  One expert said that public health efforts to limit adolescent smoking, substance abuse, early sexual behavior, and automobile accidents should focus less on educating the adolescent to be wiser, more informed, and less impulsive and more on limiting opportunities to engage in risky behavior (Steinberg, 2007). Examples of opportunity-limiting

Modern Management Theories- Quantitative Approach-Operation Approach Introduction about The Quantitative

 Modern Management Theories- Quantitative  Approach-Operation Approach  Introduction about The Quantitative school of Management Definition of Quantitative School Management  Quantitative school includes:   Operations Research Introduction  Definition of Operational Research Theory  Types of Operational Research Theory  Phases in Operation Research Study Problems Analysing  by Operations Research  Features of Operation Research: Methodology of Operation Research Operation Research Models Simplification in

First Steps on Becoming a Grassroots Lobbyist/Advocate for Health Care

First Steps on Becoming a Grassroots Lobbyist/Advocate for Health Care PolicyIn a Microsoft Word document of 4-5 pages formatted in APA style, you will imagine you are going to make a visit to your representative in Congress. There are two parts to this assignment.Address the following topics: Develop a one-page

The African American Experience in the American West: Civil War and

 The African American Experience in the American West: Civil War and Reconstruction The 10-page length is minimal and does not include title page, endnotes, or bibliography. No quotes longer than 2 typed sentences are allowed. Papers need to be drawn from a minimum of six independent primary documents and six

Part 1: Stockholders and Management Interests Stockholders and managers want

  Part 1: Stockholders and Management Interests Stockholders and managers want the same thing, don’t they? Theoretically, yes, but in reality, it does not always work that way. Too often, managers’ personal goals compete with shareholder wealth maximization. Sometimes, managers pay themselves excessive salaries or bonuses that are at odds

ADVANCED STUDIO TECHNIQUES LO1• A 700-word evaluation

Plan and conduct a multi-track recording session’ In order to pass this assessment you must complete a recording consisting of at least 16 audio tracks with at least 4 overdubbing stages. This requirement should be met in a single session which will be observed by your tutor. You may add

(1) As a human resources recruiter you have informed several

(1)   As a human resources recruiter you have informed several hiring managers of the importance of employment laws. The hiring managers have asked you some follow up questions and would like you to prepare a white sheet to assist them with the hiring process. The following laws were discussed: Americans

Read Eating Asian America- Chapters (EAA ch. 9) pp. 186-204

Read Eating Asian America- Chapters (EAA ch. 9) pp. 186-204 and (EAA ch. 15) pp 288- 302  THE BOOK IS ATTACHED  Please answer all the questions adjacent to the questions/argument types from how to write a critical analysis. (1–2-page MLA format).  1)  the important concepts and terms of the readings 2)  the most

Select an article (2018 OR newer) from Business Week, Forbes,

Select an article (2018 OR newer) from Business Week, Forbes, or Wall Street Journal that you think describes the external environment for a specific company or industry. Answer these questions and be specific… 1) What are two external factors that are discussed and are they seen as opportunities or threats

Term 3 Unit 1 Discussions Unit 1 Discussion: The Summer

   Term 3 Unit 1 Discussions Unit 1 Discussion: The Summer Lunch (ACC315 Fraud Prevention & Examination) Jim Smith and Bob Jones are new summer interns working for a major insurance company. During their lunch break each day, they eat at a local sandwich shop. One day, Bob’s girlfriend joins