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
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...
Review
Review
24/7 Homework Help
Stuck on a homework question? Our verified tutors can answer all questions, from basic math to advanced rocket science!
Similar Content
Related Tags
Principles - Life and Work
by Ray Dalio
The Point of it All - A Lifetime of Great Loves and Endeavors
by Charles Krauthammer
Communist Manifesto
by Karl Marx
The Adventures of Huckleberry Finn
by Mark Twain
Untamed
by Glennon Doyle
The King Must Die
by Mary Renault
Catch-22
by Joseph Heller
The Secret Garden
by Frances Hodgson Burnett
The Handmaids Tale
by Margaret Atwood