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

In your experience, how have changes in healthcare affected nurses’

In your experience, how have changes in healthcare affected nurses’ ability to provide person-centered, holistic care? talk about an experience as a nurse As you think ahead to your future practice as an NP, which of the concepts covered this week resonates most with you? Why? talk about the different

Minimum of 1,000words of the situation that addresses the following:

 Minimum of 1,000words of the situation that addresses the following: The power bases used by the leader. The influence tactics used by the leader. The leadership style of the leader. The outcome (or potential outcome) of the situation. Leadership studies demonstrate that the most effective leaders know how to draw

. Download some new app onto your mobile device that

  . Download some new app onto your mobile device that you’ve heard about (if you do not have a mobile phone call me and we’ll come up with an alternative), and then you will 2. Write a 2-3 page  in MS-Word about SOME OF (but not ALL OF) these

Answer below question based on understanding from the chapter-9 (attached

Answer below question based on understanding from the chapter-9 (attached text book) and based on the scholarly journal peer reviewed article. Answer should be 1.5 page and strictly no plagiarism.  Discuss key elements of effective listening and the importance of listening to a leader when they communicate.  Compare and contrast

Which learning styles might be most effective for individuals in

Which learning styles might be most effective for individuals in entrepreneurial firms? Explain your answer.  Exercise Instructions:  You are required to submit a 2-Page (Title Page and Content Page), APA formatted paper with substantial content. Substantial content requires staying on topic and fully addresses the assignment in a clear, concise,

Luc Landry was arrested on Saturday, June 14, 2020 in

Luc Landry was arrested on Saturday, June 14, 2020 in Montreal for common assault on his neighbor. He is in an advanced state of intoxication. He has no criminal record. Given Luc’s condition, the police officer does not release him and takes him to the police station where he is

For this assignment, please submit a draft of your final

For this assignment, please submit a draft of your final paper. Recall that your final paper should contain the following sections: An introduction (with a clear thesis) Literature Review Background information on your company and industry Analysis (that is, applying one of our three models to your company or industry)

Discuss some of the challenges children with ASD face in terms of

1. Discuss some of the challenges children with ASD face in terms of developing play and friendships. How are play and friendships integral to children’s learning and development? 2. List and explain the 4 patterns in Dunn’s conceptual model for understanding patterns of sensory processing. How might individuals with ASD

3 PG Requirements must outline specifically the nature of the

 3 PG Requirements  must outline specifically the nature of the problem and demonstrate critical thinking, sound logic, valid claims, personal passion, and credible support that is cited correctly.  Write a 3 PG. in which you: In the introduction, include a quote, question or statistic from your text and an overview of

Case Study- Barilla Spa

write: -Abstract o Background – no more than ½ page. Only include pertinent information that has brought the organization to its current situation. o Issues – Identify the pertinent issues that the organization is facing. o Analysis – Using analysis tools from your text or appropriate mathematical calculations; perform the

Instructions for final project: Questions 1-27 in appendix 1 need

   Instructions for final project: Questions 1-27 in appendix 1 need to answered. The questions can be answered in like a table format. Questions on one side and answers on the other one or questions on top and answers below.  Most of the answers are on the written report that

Farming with AgriPro (Case Study)

AgriPro is a firm based in Colorado, USA, which does research on and produces gene:cally modified wheat seed. Every year AgriPro conducts thousands of experiments on different varie:es of wheat seeds in different loca:ons of the USA. In these experiments, the agricultural and economic characteris:cs, regional adapta:on, and yield poten:al

Submit a meaningful reply of 400 – 450 words to

Submit a meaningful reply of 400 – 450 words to the below post. Synthesize course material and  demonstrate critical thinking, graduate-level writing skills, and reflection.  Cite the textbooks and scholarly articles from professional accounting and business  journals.   Use you textbook (attached) and at least 3 journal articles as

Please submit a public comment to the Dietary Guidelines for

Please submit a public comment to the Dietary Guidelines for Americans, following the instructions at the above link. The comment must: be atleast 400 words in length, include your name support an existing scientific question or propose a new scientific question for the dietary guidelines to consider as instructed on