I don't know how to deal with this assignment i have to do, this is what i currently have done
/**
* @(#)sample.java
*
*
* @author
* @version 1.00 2017/10/25
*/
import java.util.Scanner;//start class
public class sample {//start main
public static void main(String[] args) {//start main
Scanner input = new Scanner(System.in);
System.out.println("[Computer Science Classroom1A]");
//declare variables
int lowest=0,highest=101,average=0,total=0;
int grade;
//for loop to take user input
for (int i=1;i<=5;i++){
System.out.println("Please enter Studentgrade:"+i);
grade=input.nextInt();
//do maths get total
total=total+grade;
//if statements to get highest to lowest
if(grade>=highest){
highest=grade;
}//end if
if(grade<=lowest){
lowest=grade;
}//end if
}//end for loop
//do maths get average
average=total/5;
//final printout
System.out.println("The HIGHESTGRADE is:"+highest);
System.out.println("The LOWESTGRADE is:"+lowest);
System.out.println("The TOTALGRADE is:"+total);
System.out.println("The AVR GRADE is"+average);
}//end main
}//end class
these are the tasks that i have to do:
Brief/Task:
You are required to write a program (java class) for entering grades for two class groups.
Use a while loop for one class group and a for loop for the other class group.
The user should be asked before entering each class group, how many students are in the class and the loop will execute that many times to take in the grades.
Count the number of fails and passes in each class group. (Pass mark is 50%)
The output from the program will tell the user the highest and lowest grade achieved from each class group, and the average grade from each class group.
Finally the program will tell the user the name of the class group that got the better average or if both classes got the same average.
Can someone help me quick with these tasks because i honestly don't know how to do this, my professor is a dumbass and whenever i ask him a question he either says i need to know these stuff or just corrects minor mistakes i do, he never explains anything, and only praises the ones that already have experience outside of college with java. Best possible scenario would be if someone just sent me the program made and i could just copy paste it, it doesn't take long at all since i saw people in my class doing it in 15 minutes(the experienced ones). I need to submit the program by midnight so in 7 hours and i also have to do a write up on it and everything in the write up has to do with describing the program, so i can't do the write up either 😭 . Need help asap
/**
* @(#)sample.java
*
*
* @author
* @version 1.00 2017/10/25
*/
import java.util.Scanner;//start class
public class sample {//start main
public static void main(String[] args) {//start main
Scanner input = new Scanner(System.in);
System.out.println("[Computer Science Classroom1A]");
//declare variables
int lowest=0,highest=101,average=0,total=0;
int grade;
//for loop to take user input
for (int i=1;i<=5;i++){
System.out.println("Please enter Studentgrade:"+i);
grade=input.nextInt();
//do maths get total
total=total+grade;
//if statements to get highest to lowest
if(grade>=highest){
highest=grade;
}//end if
if(grade<=lowest){
lowest=grade;
}//end if
}//end for loop
//do maths get average
average=total/5;
//final printout
System.out.println("The HIGHESTGRADE is:"+highest);
System.out.println("The LOWESTGRADE is:"+lowest);
System.out.println("The TOTALGRADE is:"+total);
System.out.println("The AVR GRADE is"+average);
}//end main
}//end class
these are the tasks that i have to do:
Brief/Task:
You are required to write a program (java class) for entering grades for two class groups.
Use a while loop for one class group and a for loop for the other class group.
The user should be asked before entering each class group, how many students are in the class and the loop will execute that many times to take in the grades.
Count the number of fails and passes in each class group. (Pass mark is 50%)
The output from the program will tell the user the highest and lowest grade achieved from each class group, and the average grade from each class group.
Finally the program will tell the user the name of the class group that got the better average or if both classes got the same average.
Can someone help me quick with these tasks because i honestly don't know how to do this, my professor is a dumbass and whenever i ask him a question he either says i need to know these stuff or just corrects minor mistakes i do, he never explains anything, and only praises the ones that already have experience outside of college with java. Best possible scenario would be if someone just sent me the program made and i could just copy paste it, it doesn't take long at all since i saw people in my class doing it in 15 minutes(the experienced ones). I need to submit the program by midnight so in 7 hours and i also have to do a write up on it and everything in the write up has to do with describing the program, so i can't do the write up either 😭 . Need help asap



