Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Introduction For this lab, you will be using the do-while loop. The structure fo

ID: 3593277 • Letter: I

Question

Introduction For this lab, you will be using the do-while loop. The structure for this type of loop is: /* variable declarations/ do t ) while U* stop conditionh The main difference to note with this type of loop is that it's contents will always execute at least once statements with change to stop condition variabLea/ after the frst iteration of the loop. This is in contrast with a for and while loop whose contents may never be executed based on the stop Task You will write anp!cation caled T This program will Display the usage message Please input test scores with values between 0-100 Enter 999 to finish" Accept test scores within the range 0-100. if the number is out of range, eiophay the meseege-invelid-Test-Soore;, disregard that input and continue collecting values · Scpcolecting test scores when the user inputs the nmber 999 Onice all values have ben entered, display the number of soores entered, the lowest score, the highest score, and the average Sample outpun for input: 57 298 13 85 77 999 Please in Test Statiaticsi put test scores with values betveen 0-100, Enter 999 to finish. Husber ot Tests: Lowest: 13 highest: 98 verage: 66 5 6 9 0

Explanation / Answer

Ans:

import java.util.Scanner;

punlic class TestScoreStastics{

public int score;

public int count;

public int average;

public int highest;

public int lowest;

int size;

int count1[];

public static void main(String []args){

do{

System.out.println("please input test scores with values between 0-100. Enter 999 to finish");

System.out.println("Test statistics:");

System.out.println("Enter number of Stastics:");

Scanner sc=new Scanner(System.in);  

int count=sc.nextInt();

count1=new int[count];

if(count1.size()<=count)){

Scanner sc=new Scanner(System.in);  

int score=sc.nextInt();  

if(score>100){

System.out.println("Please enter score between 0-100");

}  }

}while(score!=999);

for(int i=0;i<count1.size();i++){

average=average+count[i];

System.out.println("Average:"+average);

}

count1[]=count1[].sort;

System.out.println("Highest:"count1[0]);

System.out.println("Highest:"count1[0]);

size=count1[].size();

System.out.println("Lowest:"count1[size]);

}

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote