Java short programs coding , programming homework help

User Generated

Wbqn

Programming

Description

Q1) Write a method named area that accepts a circle's radius as a parameter and returns its area. The area of a circle is defined as: or

You may wish to use the constant Math.PI in your solution. Call the method in main to test it and display the area to the screen.

Q2) Write a method named bottlesOnWall that accepts an integer as a parameter and prints "XX Bottles on the wall" with that many verses, each time counting down from XX till it becomes 1. So for instance if the integer is 5, then the output should be:

5 Bottles on the wall
4 Bottles on the wall
3 Bottles on the wall

2 Bottles on the wall

1 Bottles on the wall

Assume that the integer passed to the method is always positive. Call the method in main to test it.

Q3) 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:

Score: Letter Grade:
90-100 A
80-89 B
70-79 C
60-69 D
Below 60 F

User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Hello Joda,The assignment has been completed. I have include 2 word files; the first one has the code for all 3 items, and the second one has an overview of the first documents contents. Pasting it below. Please review.Overview The full code for each exercise was added to the Java Methods.docx file.Each has been prope...


Anonymous
Just what I needed…Fantastic!

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags