B
ba_lakov
//this prog is not print nextHighestScore and i don't now way//
please help i;m a bigner thaks in adv
import java.util.Scanner;
public class C4E909
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
int studentScore;
String studentName;
int highestScore = 0;
int nextHighestScore = 0;
String studentNameHighestScore = "";
String studentNameNextHighestScore = "";
int numberOfStudents;
System.out.println("Please enter the number of students to process:");
numberOfStudents = keyboard.nextInt();
for(int i = 0; i < numberOfStudents; ++i)
{
System.out.println("Please enter the student name:");
studentName = keyboard.next();
System.out.println("Please enter the student score:");
studentScore = keyboard.nextInt();
if(studentScore > highestScore)
{
highestScore = studentScore;
studentNameHighestScore = studentName;
}//end if
if((studentScore < highestScore) && (studentScore > nextHighestScore))
{
System.out.println("HERE");
nextHighestScore = studentScore;
studentNameNextHighestScore = studentName;
}//end if
}
System.out.println("Name highest score: " + studentNameHighestScore);
System.out.println("Highest score: " + highestScore);
System.out.println("Name next highest score: " +
studentNameNextHighestScore);
System.out.println("Next highest score: " + nextHighestScore);
}//end main
}//end class
please help i;m a bigner thaks in adv
import java.util.Scanner;
public class C4E909
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
int studentScore;
String studentName;
int highestScore = 0;
int nextHighestScore = 0;
String studentNameHighestScore = "";
String studentNameNextHighestScore = "";
int numberOfStudents;
System.out.println("Please enter the number of students to process:");
numberOfStudents = keyboard.nextInt();
for(int i = 0; i < numberOfStudents; ++i)
{
System.out.println("Please enter the student name:");
studentName = keyboard.next();
System.out.println("Please enter the student score:");
studentScore = keyboard.nextInt();
if(studentScore > highestScore)
{
highestScore = studentScore;
studentNameHighestScore = studentName;
}//end if
if((studentScore < highestScore) && (studentScore > nextHighestScore))
{
System.out.println("HERE");
nextHighestScore = studentScore;
studentNameNextHighestScore = studentName;
}//end if
}
System.out.println("Name highest score: " + studentNameHighestScore);
System.out.println("Highest score: " + highestScore);
System.out.println("Name next highest score: " +
studentNameNextHighestScore);
System.out.println("Next highest score: " + nextHighestScore);
}//end main
}//end class