Course Solutions Uncategorized (Solved) : Inst 42 Use Mentioned Code Following Question S Scanner Keyboard New Scanner System Int S Q30891178 . . . .

(Solved) : Inst 42 Use Mentioned Code Following Question S Scanner Keyboard New Scanner System Int S Q30891178 . . . .

 

[Inst. 4.2] Use the below mentioned code for followingquestion(s).

Scanner keyboard = new Scanner(System.in);

int studentID, studentCount = 0, studentGrade,numberOfStudentGrades = 0, totalOfGrades = 0;
int totalOfStudentGrades = 0, totalNumberOfGrades = 0;
double studentAverage, classAverage;
System.out.println(“Enter student ID: “);
studentID = keyboard.nextInt();
while (studentID != 0){
studentCount++;
System.out.println(“Enter student grade: :”);
studentGrade = keyboard.nextInt();
while(studentGrade != -1)
{
numberOfStudentGrades++;
totalOfStudentGrades += studentGrade;
System.out.println(“Enter student grade: :”);
studentGrade = keyboard.nextInt();
}
if (numberOfStudentGrades > 0)
{
studentAverage =(double)totalOfStudentGrades/numberOfStudentGrades;
System.out.println(“Student ” + studentID + “average is ” +studentAverage);
totalNumberOfGrades += numberOfStudentGrades;
totalOfGrades += totalOfStudentGrades;
}
numberOfStudentGrades = 0;
totalOfStudentGrades = 0;
System.out.println(“Enter student ID: “);
studentID = keyboard.nextInt();
}
if (totalNumberOfGrades != 0)
System.out.println(“Average of all grades is ” +(totalOfGrades/totalNumberOfGrades));

Refer to Inst. 4.2. If there are 8 students and they have taken 8,10,

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Solved) : Please Construct Context Free Grammar Question Also Copy Another Source Show Work Upvote C Q29934070 . . . .(Solved) : Please Construct Context Free Grammar Question Also Copy Another Source Show Work Upvote C Q29934070 . . . .

<p><img alt="Construct a grammar that generates the following language: L= (anbn+ma In, m = 0, 1,2, ..)" src="https://media.cheggcdn.com/media%2Fce4%2Fce47ec7d-95ad-4955-a73e-4990cd487283%2Fphpv4oBjr.png" style="height:50px;width:350px;" aria-describedby="d3f"/><br/>Please construct a context free grammar for this question. Also donot