Question

Please do in C# with the code available to copy :) Program 4: Design (pseudocode) and...

Please do in C# with the code available to copy :)

Program 4: Design (pseudocode) and implement (source code) a program (name it MinMaxAvg) to determine the highest grade, lowest grade, and the average of all grades in a 4-by-4 two-dimensional arrays of integer grades (representing 4 students’ grades on 4 tests). The program main method populates the array (name it Grades) with random grades between 0 and 100 and then displays the grades as shown below. The main method then calls method minMaxAvg()that takes a two-dimensional array of type integer as a parameter and prints out the class highest grade, the class lowest grade, and class average grade as shown below. Document your code and properly label the outputs as shown below.

Sample run 1:

Array Grades:

38 44 22 91

81 60 71 80

99 49 98 63

71 33 93 49

Highest grade: 99

Lowest grade: 22

Class average: 65.13

Sample run 2:

Array Grades:

60 88 98 100

87 75 68 93

95 86 98 73

56 73 88 71

Highest grade: 100

Lowest grade: 56

Class average: 81.82

I just need the user to enter the values themselves.

please do in C# :)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MinMaxAvg
{
class Program
{
static void minMaxAvg(int [,] grades)
{
int highest, lowest,sum=0;
double avg;
int r, c;
highest = grades[0, 0];
lowest = grades[0, 0];

for (r = 0; r <= 3; r++)
{
for (c = 0; c <= 3; c++)
{
if (highest < grades[r, c])
{
highest = grades[r, c];
}
if (lowest > grades[r, c])
{
lowest = grades[r, c];
}
sum = sum + grades[r,c];
}
}

avg = (double)sum / grades.Length;

Console.WriteLine(Environment.NewLine );

Console.WriteLine("Highest Grade : "+highest );
Console.WriteLine("Lowest Grade : " + lowest);
Console.WriteLine("Class Average : " +Math.Round( avg,2));
}
static void Main(string[] args)
{
int[,] grades = new int[4, 4];
int r, c;
Console.WriteLine("Enter grades of four students : "+Environment.NewLine );
for (r = 0; r <= 3; r++)
{
Console.WriteLine("Enter grades of student "+(r+1)+" : ");
for (c = 0; c <= 3; c++)
{
grades[r, c] = Convert.ToInt32(Console.ReadLine());
}
}
Console.WriteLine(Environment.NewLine +"Grades of students : "+Environment.NewLine );

for (r = 0; r <= 3; r++)
{
Console.Write("Grades of student " + (r + 1) + " : ");
for (c = 0; c <= 3; c++)
{
Console.Write(grades[r, c]+" ");
}
Console.WriteLine();
}

minMaxAvg(grades);

Console.ReadKey();
}
}
}

Add a comment
Know the answer?
Add Answer to:
Please do in C# with the code available to copy :) Program 4: Design (pseudocode) and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • PSEUDOCODE and PYTHON source code! Program 4: Design (pseudocode) and implement (source code) a program (name...

    PSEUDOCODE and PYTHON source code! Program 4: Design (pseudocode) and implement (source code) a program (name it MinMaxAvg) to determine the highest grade, lowest grade, and the average of all grades in a 4-by-4 two-dimensional arrays of integer grades (representing 4 students’ grades on 4 tests). The program main method populates the array (name it Grades) with random grades between 0 and 100 and then displays the grades as shown below. The main method then calls method minMaxAvg()that takes a...

  • Write a program to calculate students’ average test scores and their grades. You may assume the...

    Write a program to calculate students’ average test scores and their grades. You may assume the following data: Johnson 85 83 77 91 76 Aniston 80 90 95 93 48 Cooper 78 81 11 90 73 Gupta 92 83 30 69 87 Blair 23 45 96 38 59 Clark 60 85 45 39 67 Kennedy 77 31 52 74 83 Bronson 93 94 89 77 97 Sunny 79 85 28 93 82 Smith 85 72 49 75 63 Use three...

  • Write a program to calculate students’ average test scores and their grades. You may assume the...

    Write a program to calculate students’ average test scores and their grades. You may assume the following data: Johnson 85 83 77 91 76 Aniston 80 90 95 93 48 Cooper 78 81 11 90 73 Gupta 92 83 30 69 87 Blair 23 45 96 38 59 Clark 60 85 45 39 67 Kennedy 77 31 52 74 83 Bronson 93 94 89 77 97 Sunny 79 85 28 93 82 Smith 85 72 49 75 63 Use three...

  • PLEASE DO THIS IN C#.Design and implement a program (name it ProcessGrades) that reads from the...

    PLEASE DO THIS IN C#.Design and implement a program (name it ProcessGrades) that reads from the user four integer values between 0 and 100, representing grades. The program then, on separate lines, prints out the entered grades followed by the highest grade, lowest grade, and averages of all four grades. Format the outputs following the sample runs below. Sample run 1: You entered: 95, 80, 100, 70 Highest grade: 100 Lowest grade: 70 Average grade: 86.25

  • PLEASE DO THE PSEUDOCODE FOR THE PROGRAM BELOW Program 3: Design (pseudocode) and implement (source code)...

    PLEASE DO THE PSEUDOCODE FOR THE PROGRAM BELOW Program 3: Design (pseudocode) and implement (source code) a program (name it DistinctValues) to display only district values in an array. The program main method defines a single-dimensional array of size 10 elements and prompts the user to enter 10 integers to initialize the array. The main method then calls method getValues() that takes an integer array and returns another single-dimensional array containing only distinct values in the original (passed) array. Document...

  • Write a program in assembly code (8088/8086) to determine the Average, Highest, Lowest grade in microprocessor...

    Write a program in assembly code (8088/8086) to determine the Average, Highest, Lowest grade in microprocessor course (final grade =100) if the class has 30 students. Write the program in the emulator(8086) and show the input data and the results (Average grade- Highest grade- Lowest Grade). Note: Suppose the grades of the 30 students.

  • C++: Create a grade book program that includes a class of up to 20 students each...

    C++: Create a grade book program that includes a class of up to 20 students each with 5 test grades (4 tests plus a Final). The sample gradebook input file (CSCI1306.txt) is attached. The students’ grades should be kept in an array. Once all students and their test scores are read in, calculate each student’s average (4 tests plus Final counts double) and letter grade for the class. The output of this program is a tabular grade report that is...

  • Write a C program to assign natural numbers 1 to 100 into a one-dimensional integer array....

    Write a C program to assign natural numbers 1 to 100 into a one-dimensional integer array. Display all the values in the array on the screen. For each number in the array, determine if the number contains digit 7 or is divisible by 7. Display all those numbers on the screen. Original array: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27...

  • Write a C++ program. Using the while loop or the do – while loop write a...

    Write a C++ program. Using the while loop or the do – while loop write a program that does the following: Calculate the average of a series of homework grades (0 - 100) entered one at a time. In this case the lowest score will be dropped and the average computed with the remaining grades. For example suppose you enter the following grades: 78, 85, 81, 90, 88, 93 and 97.The average will be computed from the 6 grades 85,...

  • I need it in JAVA Write a program that randomly populates an array of size 100,...

    I need it in JAVA Write a program that randomly populates an array of size 100, sorts it, and then finds the median. The random numbers must be from 0-99 and all integer values. Also since there is an even set of numbers the median is found by taking the mean of the two middle numbers (In other words the 50th and 51st). You have to code your own sorting method. You may not use a built in java sorter....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT