Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

mrperfect069
How do I write a method in java?
I need to write at least 3 methods for the formulas in my java homework below, I have no idea how, someone please help
thanks!
import java.util.Scanner;
public class javahw4b{
private static Scanner keyboard;
private static double input;
public static void main(String[] args){
keyboard = new Scanner(System.in);
double A=0,B=0,C=0,D=0,F=0;
double grade, totalScores=0, totalGrade=0, average=0;
double max=0, min=0;
//user/ input
System.out.println("Please enter your grade");
grade= keyboard.nextInt();
//checks for grade greater than 100
if (grade>100)
System.out.println("The number you entered is not valid");
//loop starts
while(grade>0){
//check for grade score
totalGrade++;
totalScores+=grade;
if(grade>=90 && grade <= 100)
A++;
else if(grade>=80 && grade <= 89)
B++;
else if(grade>=70 && grade <= 79)
C++;
else if(grade>=60 && grade <= 69)
D++;
else if(grade>=0 && grade <= 59)
F++;
System.out.println("Please enter another grade or enter -1");
grade = keyboard.nextInt();
if (grade == -1)
break;
else if (grade>100)
System.out.println("The number you entered is not valid");
//max and min set
if (grade>max)
max=grade;
else if (grade<max)
min=grade;
}
average = (totalGrade/totalScores);
double averageA=(A/totalGrade)*100;
double averageB=(B/totalGrade)*100;
double averageC=(C/totalGrade)*100;
double averageD=(D/totalGrade)*100;
double averageF=(F/totalGrade)*100;
System.out.format("The percentage of A is %5.2f%n ",averageA);
System.out.format("The percentage of B is %5.2f%n",averageB);
System.out.format("The percentage of C is %5.2f%n",averageC);
System.out.format("The percentage of D is %5.2f%n",averageD);
System.out.format("The percentage of F is %5.2f%n",averageF);
System.out.println("The average of the grades is "+ average);
System.out.println("The max grade is "+ max);
System.out.println("The max grade is "+ min);
}
}//end of all code
1 AnswerProgramming & Design7 years agoWhat are some items that sell the best at a bake sale?
I have to move and I need to raise money to do so
2 AnswersOther - Advertising & Marketing8 years agoIf we were to swap out organs in our body wouldn't we be able to live forever?
Brains, heart, skin, bones, what do you guys think?
4 AnswersPhilosophy8 years agoDoes anyone know if honey expires?
I heard honey never expires is this true?
6 AnswersBeer, Wine & Spirits8 years agoWhat genre of "intimate movies" do you like?
4 AnswersMovies8 years agoWhat is your list of greatest pro wrestlers of all time? 1 being the best?
1. The Undertaker
2. Bret "The Hitman" Hart
3. Shawn Michaels
4. Hulk Hogan
5. Roddy Piper
6. Stone Cold Steve Austin
7. Macho Man Randy Savage
8. Mr. Perfect
9. Kurt Angle
10. The Rock
5 AnswersPolls & Surveys8 years agoWrestler that is alive vs. Wrestler that is deceased?
Some of my picks are:
1. Big Show vs. Andre the Giant
2. Kurt Angle vs. Chris Benoit
3. The Great Khali vs. The Giant Gonzolez
4. Brock Lesnar vs. Mike Awesome
5. CM Punk vs. Randy Savage
6. Bret Hart vs. Owen Hart
7. The Undertaker vs. Mr. Perfect
8. John Cena vs. The British Bulldog
9. Steve Austin vs. Brian Pillman
10. Rey Mysterio vs. Eddie Guerrero
4 AnswersWrestling8 years agoDoes the morning after pill really work?
1 AnswerWomen's Health10 years agoIf I traveled faster than the speed of light, (186,000 miles/sec)?
I am confused, say I traveled somewhere faster than the speed of light say (5 light years away) I get there in 5 seconds then return to earth (10 seconds total) would I come back 10 years later on earth? Wouldn't I just lose 10 seconds?
6 AnswersPhysics1 decade agoWho would you like to see face the Undertaker at Wrestlemania 28?
Personally, I would like to see him go against John Cena, I think it would be a great match.
9 AnswersWrestling1 decade agoDoes anyone out there hate using condoms?
I hate the feel of it and enjoy doing creampies.
3 AnswersWomen's Health1 decade agoDo you think the Undertaker and Shawn Michaels should fight again at wrestlemania?
I would like to see them in a hell in a cell again, because I don't want to see them try to recreate a classic like last year's wrestlemania.
5 AnswersWrestling1 decade agoCan plastic be magnetized?
5 AnswersEarth Sciences & Geology1 decade agoWhat is a good anniversary present to get my girlfriend for our 6 year anniversary?
I am already taking her out to dinner and getting flowers but I would like to get her a present as well, any suggestions?
12 AnswersValentine's Day1 decade agoDoes anyone know if Smackdown vs. RAW 2009 has the same buttons as 2007, Here comes the pain?
I don't have the game yet I was just wondering if they got rid of the ridiculous control settings from 2008.
4 AnswersWrestling1 decade agoCD Stuck in my car disc changer got it out but now CD won't play please help!
I am trying to investigate this problem to no avail perhaps some of you knowledgeable people can lend me a hand? I have a 2005 Mazda 6s, yesterday I was driving and switching CDs (I have an in dash 6-CD Changer) all of a sudden I hear a clicking noise, sounded like one of the CDs got stuck. SO I did some investigatinig on how to the get the CD out, I held down the load and eject button at the same time and all the CDs came out one by one. However, now that I got the CDs out, I can only load one CD and it will not play. It does not say error on the screen, it says cd in all the time. I looked in the fuse box and there is nothing for the stereo? I was thinking to remove and install the fuse again...but I don't think it will work. Any suggestions? I would greatly appreciate it thank you very much for your input. I need my music!
4 AnswersCar Audio1 decade agoHow do you shake the nerves?
I am starting a new job today and I have to meet EVERYONE in a meeting on my first day I am so nervous any ideas on how to be calm?
4 AnswersMental Health1 decade agoCan you add to or get a refund on postal money orders?
I already bought a money order for $15.00 and was informed that i need it to be $35.00 now. Can I add to it? Or get a refund?
2 AnswersPersonal Finance1 decade ago