Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using System; class MainClass { public static double avg(int[] arr) { double sum = 0; for(int i=0; i

using System; class MainClass { public static double avg(int[] arr) { double sum = 0; for(int i=0; i 

Recall Average Test Scores for loop that averages test scores.

  • Declare an array of size 4 (use a constant for loop SIZE)
  • Use a for loop to accept user input for the test scores
    • Add input validation to only accept numbers between 1 and 100 (Reach out on the discussion board if you are stumped!)
    • Store the input in the array
    • The loop must only allow the SIZE of the array input . What happens if you go over? Discuss this with classmates on the discussion board this week
  • Write a foreach loop to average the test scores
  • Display the average with 2 decimal points precison.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Database And Knowledge Base Systems

Authors: S Krishna

1st Edition

9810206208, 978-9810206208

Students also viewed these Databases questions

Question

1. Why do we create anything?

Answered: 1 week ago

Question

3. Define the attributions we use to explain behavior

Answered: 1 week ago