answersLogoWhite

0


Best Answer

import javax.swing.JOptionPane; //marlonroxas

public class loop_exer2

{

public static void main(String agrs[])

{

String input;

int trial=10, sc=0, h=0, l=0, test=0;

System.out.print("Scores: ");

for (int ctr=1;ctr<=10;ctr++)

{

input=JOptionPane.showInputDialog("Enter the Scores ["+trial+"] trials ");

sc=Integer.valueOf(input);

System.out.print(sc+", ");

if(test==0){h=sc;l=sc;test=1;}

if(sc>h){h=sc;}

else if(sc<l){l=sc;}

}JOptionPane.showMessageDialog(null, "Highest Score is: "+h+

"\n\nLowest Score is: "+l);

System.out.println();

System.out.println("Highest Score: "+h);

System.out.println("Lowest Score: "+l);

}

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Java program that will input 10 scores and output the highest and lowest score?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

If you input names of students from the user terminated by ZZZ and create a data file GRADES with records of the form test1 test2 test3 will all the test scores show in the file?

This is a tricky one. The tripple 'ZZZ' indicates a location for source data. Start a file named 'Grade' (spead sheet). There are 3 sets of test scores to be logged. In this file all scores should be logged from highest to lowest.


What is Jagged Array in C?

A Jagged array is an array of arrays. You can initialize a jagged array as &minus; int[][] scores = new int[2][]{new int[]{92,93,94},new int[]{85,66,87,88}}; Where, scores is an array of two arrays of integers - scores[0] is an array of 3 integers and scores[1] is an array of 4 integers.


How do you design a program that asks the user to enter 10 golf score in python that should be stored in an integer array and sorted in ascending order?

/////////START OF PROGRAM/////////// //the main module Module Main() //declare constant variable Constant Integer SIZE=10 Constant String DAY=10 Set DAY[1] = first Set DAY[2] = second Set DAY[3] = third Set DAY[4] = forth Set DAY[5] = fifth Set DAY[6] = sixth Set DAY[7] = seventh Set DAY[8] = eighth Set DAY[9] = ninth Set DAY[10] = tenth //global variables Declare Integer scores[SIZE] Declare String scores[DAY] Declare Integer index //body of the module //sets the constants in the scores array to 1 Set scores[DAY=1] Set scores Do Display "Please enter the ", scores[DAY]," golf score :" Set scores[DAY+1] Input scores[SIZE+1] until scores[SIZE==10] End Do //calls the insertionSort module Call insertionSort(scores, SIZE) //display the scores sorted ascendedly Display "You golf scores sorted ascendedly are: " For index = 0 to SIZE - 1 Display scores[index] End For End Module


In C Programming Language Can someone write a program that will interact with the user by name and allow for the recording of grades for three classes Tech History and Math?

More info;You will write a program that will interact with the user by name and allow for the recording of grades for three classes: Tech, History, and Math. The program will allow the user to determine how many assignments to enter in each class, the name of each assignment, the total value of each assignment, and the users score on each assignment. The program will will write the scores to a file and have the ability to:Tell the user the high and low score in each class along with the assignment nameRepeat entries back to user by assignment name and score to ensure accuracyTell the user their current grade in each classTell the user their current gpa based on the overall percentage of each class


Example of semantic errors?

scores = [51, 47, 53, 97, 27]summation = 0.0for score in scores:summation *= score # Semantic Error.average = summation / len(scores)print average # Isn't average. average == 0

Related questions

What are the lowest and highest ACT test scores?

Highest 36 Lowest 1


Does ascending order in statistics mean lowest to highest scores?

Yes


Why are the highest and lowest judges scores disregarded in tallying the total score in a gymnastics competetion?

The highest and lowest scores in a gymnastics competition are thrown out so that the average scores are what is counted across the board. This both helps and harms the gymnast if they have an extreme score either way.


How come some of the judges scores in the Olympics are blue?

The highest and lowest judge scores are removed, and the remaining are averaged to get the final score. The scores that are removed are dimmed / blue.


What are lowest and highest scores you can attain on the sat reasoning test?

The scores range from 200-800 in each section. 200 is the lowest and 800 is the highest. The three sections are Math, Writing, and Critical Reading. The lowest total score you can make is therefore a 600, with 200 in each part, and the highest is a 2400, with 800 in each part. Good luck!


How do you interpret CPA scores?

SAT scores are interpreted on the highest to the lowest. The higher the score the better you have done. If your score is low, it means that you did very poorly.


What z-score value separates the highest 10 of the scores in a normal distribution from the lowest 90?

It is 1.281551


Is the median is always the point that is arithmetically exactly halfway between the highest and lowest scores of distribution?

false


Why are the highest and lowest scores ignored in diving?

It's not only in diving, it is also in ski flying and many more. The reason I think is that the highest and lowest scores could be biased (in favor or against the competitor) while those which are almost equal are more likely to be real and sincere.


The mean of 5 different scores is 10 what are the largest and smallest possible values for the median if all test scores must be whole numbers?

If scores of zero are permitted, the lowest median is 2 as in (0,1,2,3,44) and the highest median is 10 as in (8,9,10,11,12). If a zero score is not permitted, then the lowest median is 3 as in (1,2,3,4,40).


What city in Illinois has the lowest school test scores?

Chicago schools have the lowest test scores.)~:


Who is the multiple champion of the Masters who tied the record for lowest final 9 holes and highest final 9 hole scores?

Tiger Woods