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

0
(0)

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!

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

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

Related Questions

The information that is gathered every day in healthcare drives

0 (0) The information that is gathered every day in healthcare drives patient care and the improvement of the quality of care. Each staff member within a healthcare institution has a role in improving patient care. In this short paper, complete the following:  Chief of Medicine Managers: Identifies a

Create a nutritional care plan for your client.(old- malnutrition)

0 (0) Create a nutritional care plan for your client.(old- malnutrition) This will include an evaluation of nutritional risk, a list of interventions, and a list of expected outcomes. List the goals of medical nutrition therapy for your patient and suggest an appropriate diet. Does your patient/client require a dietary

Introduction Jones Carolyn Denise is 35 years an old female with

0 (0) Introduction       Jones Carolyn Denise is 35 years an old female with a height of 162.6cm ( 5’4”) and weight of 108kg ( 237 lb ) with a medical condition of acid reflex and Vitamin D deficiency. Mrs. Jones was admitted on February 7, 2023, with a diagnosis of

5 questions to answer separately! All relate to Implementing the ABCDE

0 (0) 5 questions to answer separately! All relate to Implementing the ABCDE Bundle to decrease hospital length of stay in a long-term acute care hospital. You may reference the three primary articles attached – must read them to use them   question 1 Describe the primary quantitative literature upon which

Scientific Study Analysis Prior to beginning work on this assignment,

0 (0) Scientific Study Analysis Prior to beginning work on this assignment, read the article The Relationship Between Multiple Forms of Discrimination, Neighborhood Characteristics, and Depression Among Illicit Drug Users in New York CityLinks to an external site. and address the following questions in a three to four page (excluding title and

How will you use the processes from ARDP 6-22 to improve the ABCT and

0 (0) What is the critical leadership problem facing the 4th ABCT? How will you use the processes from ARDP 6-22 to improve the ABCT and achieve your vision? Clearly and comprehensively explain, defend, and justify your answer. If something is not your original thought, you need to cite your

Early Childhood and Special Education Lesson Plan

0 (0) All materials needed for the lesson must be used or referred to during the PPT presentation including anchor charts, visual supports and manipulatives needed for the presentation. So please take a picture of materials yo used, and also make anchor charts… What you need to do is a

Research the differences in conducting business in the Dominican

0 (0) Research the differences in conducting business in the Dominican Republic as compared to the United States. Consider culture, customs, predominate religions, type of government, natural resources, infrastructure, modes of shipping, stability of economy, currency used internationally, trade relationships/agreements with the United States, living/working conditions, restrictions placed on foreign

Brand Assessment & Shopping Research Paper

0 (0) At the beginning of the assignment due class session, submit a summary of your research compared to your experience in physically visiting and shopping in a retail business. Discuss the business’s strengths and weaknesses in the branding factors you have learned in this course-to-date (class lectures and reading

Nonverbal Research Paper

0 (0) General Instructions Conduct a participant observation of nonverbal communication during a structured period of time (e.g., sitting at a café, during a sports event, while at work, at the gym, etc.). Take field notes throughout the course of your observation. Spend time looking through your field notes and

Marketing – Search Engine Optimization (Footer Writing)

0 (0) Write a Footer for 5 different web pages. Each footer should be approximately 330 words. The footer should briefly describe the Brand and what type of products the brand is selling, and how those products can benefit the customer. There is no specific paper format. Make sure that

a firm/company/store, identifying its product or service, and

0 (0) The project consists of selecting a firm/company/store, identifying its product or service, and analyzing its current market environment. This includes identifying competitors, analyzing nature of the product or service, and examining ease of entry into or exit from the market. It involves examining the market demand and supply,

WNEU ME 322 Spring 2019 Take‐Home Project

0 (0) Find 2 manufacturers within 25 miles of your home town or the town you would like to live in after graduation.  For each manufacturer, gather and compare the following information (as much as is available publicly, or with a little digging – a polite email and/or phone call and/or

Accounting for the iPhone at Apple Inc

0 (0) Please answer 3 case Questions: 1. Compared to the typical point-of-sale accounting method, what are likely effects on income statement, balance sheet, and statement of cash flow of Apple’s choice to use a subscription method for revenue recognition for its iPhone? Also discuss advantages and disadvantages of subscription

IBM Financial Reporting and Analysis

0 (0) Please answer the 19 questions listed below. The questions below are based on the 2017 financial statements of IBM which I provided as a pdf. (Page number references below refer to document page numbers, not .pdf page numbers.) Please only use the financial statements provided to answer the

Proving the Existence of the Traditional Judeo-Christian God

0 (0) You must write about the following 6 items below and defend your thesis. You must explain them all in detail in section 2 of your paper and then critically discuss each of them in section 3 using separate paragraphs. Use paragraphs — at least one for each idea.

Analysis and Presentation of Data

0 (0) Resources: Ch. 15, 16, & 17 of Business Research Methods (all chapters will be attached). Review question four in the “Discussion Questions” of Chapter 15; review question 4 in the “Discussion Questions” of Chapter 16; and review question 10 in the “Discussion Questions” of Chapter 17 of Business

Social and Professional Issues in Computing

0 (0) Select five from the following seven vocations. Which ones do you believe are a true “profession”? Briefly defend your position for each one with facts and references to definitions of a profession from sources such as authors and philosophers. Consider certification, licensing, codes of ethics, education, and enforcement