16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 46 41 42 43 44 45 O references static void Main() { // array declaration int[] testScore = new int [8]; //variable declaration float avg, sum = 0; // get user input Console.WriteLine("Enter the test score of eight student"); for (int i = 0; i < 8; i++) { } ¡ TestScoreList.Program { int j = 0; testScore[j] = Convert.ToInt32(Console.ReadLine()); sum sum + testScore[]; // cakculate average avg= sum / 8; // display the result for (int i = 0; i < 8; i++) { } int i = 0; Console.Write("Test #" +1+""+ testScore[i] + "From average: "+(double) (testScore[i]-avg) + "\n"); }

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

C# Question. Where are the errors coming from in my code? I tried different ways but no luck. Help would be appreciated of input and output!

C TestScoreList
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
33
34
67%
36
37
38
45
O references
static void Main()
{
tab
// array declaration
int[] testScore = new int [8];
//variable declaration
esc
float avg, sum = 0;
// get user input
Error List Output
Ready
caps lock
业不
Console.WriteLine("Enter the test score of eight student");
for (int i = 0; i < 8; i++)
{
63°F
Mostly cloudy
}
int j = 0;
testscore[j] = Convert.ToInt32(Console.ReadLine());
sum = sum += testScore[];
// cakculate average
avg = sum / 8;
// display the result
for (int i = 0; i < 8; i++)
{
Error List
Entire Solution
Code Description
CS0443 Syntax error, value expected
CS0136
2
}
int i = 0;
Console.Write("Test #" + 1 + ":" + testScore[1] + "From average: "+(double) (testScore[1]-avg) + "\n");
}
?
L
↑ ↓
xl 2 Errors
A
A local or parameter named 'i' cannot be declared in this scope because that nam IS
used in an enclosing local scope to define a local or parameter
f2
A 0 Warnings
2
f3
TestScoreList.Program
#
W
3
0 Messages
E
f4
LA
101
4
f5
%
R
Build+IntelliSense
D
S
LO
5
LL
f6
T
Project
TestScoreList.
TestScoreList
G
hip
17
&
7
Y
O
18
B
File
Program.cs
Pregram.cs
*
co
19 144
U
(
N
9
110
10
HJK
Ln: 32
Search Error List
37
Line Suppression
32
Active
DII
1
M
Ch: 36
Active
O
TA
Transcribed Image Text:C TestScoreList 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33 34 67% 36 37 38 45 O references static void Main() { tab // array declaration int[] testScore = new int [8]; //variable declaration esc float avg, sum = 0; // get user input Error List Output Ready caps lock 业不 Console.WriteLine("Enter the test score of eight student"); for (int i = 0; i < 8; i++) { 63°F Mostly cloudy } int j = 0; testscore[j] = Convert.ToInt32(Console.ReadLine()); sum = sum += testScore[]; // cakculate average avg = sum / 8; // display the result for (int i = 0; i < 8; i++) { Error List Entire Solution Code Description CS0443 Syntax error, value expected CS0136 2 } int i = 0; Console.Write("Test #" + 1 + ":" + testScore[1] + "From average: "+(double) (testScore[1]-avg) + "\n"); } ? L ↑ ↓ xl 2 Errors A A local or parameter named 'i' cannot be declared in this scope because that nam IS used in an enclosing local scope to define a local or parameter f2 A 0 Warnings 2 f3 TestScoreList.Program # W 3 0 Messages E f4 LA 101 4 f5 % R Build+IntelliSense D S LO 5 LL f6 T Project TestScoreList. TestScoreList G hip 17 & 7 Y O 18 B File Program.cs Pregram.cs * co 19 144 U ( N 9 110 10 HJK Ln: 32 Search Error List 37 Line Suppression 32 Active DII 1 M Ch: 36 Active O TA
CHAPTER 6 Using Arrays
3.
2.
Write a program named TestScoreList that accepts eight int values representing
student test scores. Display each of the values along with a message that indicates how
far it is from the average.
Write a program named Temperatures Comparison that allows a user to input five
daily Fahrenheit temperatures that must range from -30 to 130; if a temperature
is out of range, require the user to reenter it. If no temperature is lower than
any
previous one, display a message Getting warmer. If every temperature is lower than
the previous one, display a message Getting cooler. If the temperatures are not entered
in either ascending or descending order, display a message It's a mixed bag. Finally,
of the temperatures.
display the temperatures in the order they were entered, and then display the average
971
Write a program named CheckZips that is used by a package delivery service to check
delivery areas. The program contains an array that holds the 10 zip codes of areas to
which the company makes deliveries. Prompt a user to enter a zip code, and display a
message indicating whether the zip code is in the company's delivery area.
Write a program called DeliveryCharges for the package delivery service in Exercise 4.
e program should again use an array that holds the 10 zip codes of areas to which
company makes deliveries. Create a parallel array containing 10 delivery charges
ompany does not deliver to the requested zip code.
differ for each zip code. Prompt a user to enter a zip code, and then display either
essage indicating the price of delivery to that zip code or a message indicating that
hat-A-While phone company provides service to six area codes and charges
-minute rates for phone calls shown in Figure 6-25. Write a program named
an area code and the length of time for a call in minutes, and then
While that stores the area codes and rates in parallel arrays and allows a user
of the call.
Transcribed Image Text:CHAPTER 6 Using Arrays 3. 2. Write a program named TestScoreList that accepts eight int values representing student test scores. Display each of the values along with a message that indicates how far it is from the average. Write a program named Temperatures Comparison that allows a user to input five daily Fahrenheit temperatures that must range from -30 to 130; if a temperature is out of range, require the user to reenter it. If no temperature is lower than any previous one, display a message Getting warmer. If every temperature is lower than the previous one, display a message Getting cooler. If the temperatures are not entered in either ascending or descending order, display a message It's a mixed bag. Finally, of the temperatures. display the temperatures in the order they were entered, and then display the average 971 Write a program named CheckZips that is used by a package delivery service to check delivery areas. The program contains an array that holds the 10 zip codes of areas to which the company makes deliveries. Prompt a user to enter a zip code, and display a message indicating whether the zip code is in the company's delivery area. Write a program called DeliveryCharges for the package delivery service in Exercise 4. e program should again use an array that holds the 10 zip codes of areas to which company makes deliveries. Create a parallel array containing 10 delivery charges ompany does not deliver to the requested zip code. differ for each zip code. Prompt a user to enter a zip code, and then display either essage indicating the price of delivery to that zip code or a message indicating that hat-A-While phone company provides service to six area codes and charges -minute rates for phone calls shown in Figure 6-25. Write a program named an area code and the length of time for a call in minutes, and then While that stores the area codes and rates in parallel arrays and allows a user of the call.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY