English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

File Contents:
Agnes 56 82 95 100 68 52
Bufford 87 92 97 100 96 85 93 77 98 86
Bobby 100 98 92 86 88

Program Output:
Agnes, average= 76
Bufford, average=91
Bobby, average=93

Each line of the file consists of a sutdent's name followed by an unpredicatable number of test scores, the number of students is also unpredicatable. The desired ouptut is shown where the numbers represent the average test scores, rounded to the nearest whole number.

* Using Scanner to compute avg.s*

Can anyone please HELP PLEASE!!!!!!

2007-03-26 11:27:19 · 1 answers · asked by lilcbcgurl 1 in Computers & Internet Programming & Design

1 answers

looks like all you need is a couple nested while loops, variables to keep track of the total score and number of scores to calculate the average (you don't need to keep an array or all of them) and some calls to Scanner.next(), hasNextInt() and nextInt()

2007-03-26 11:59:28 · answer #1 · answered by undercoloteal 3 · 0 0

fedest.com, questions and answers