Using C#:
• Create a "Grades" class with the private variables: double grade1, double grade2, double grade3, double grade4, double grade5.
• In the Main method, ask the user to enter the five grades.
• In the ToString() method of the Grades class, print out the mean average (Example: Average: 86).
• Also, in the ToString() method of the Grades class, print out the 5 grades that were entered from highest to lowest. For example, if the user entered: 100, 80, 90, 75, 95, the ToString() method would print out, “Grade 1: 100, Grade 4: 95, Grade 3: 90, Grade 2: 80, Grade 4: 75.”
Program:
using System;
namespace Marks
{
class Grades
{
private double grade1;
private double grade2;
private double grade3;
private double grade4;
private double grade5;
public void getGrades(double g1, double g2, double g3, double g4,
double g5)
{
grade1=g1;
grade2=g2;
grade3=g3;
grade4=g4;
grade5=g5;
}
public void ToString()
{
double average=(grade1+grade2+grade3+grade4+grade5)/5;
Console.WriteLine("Average: "+average);
double[] a={grade1, grade2, grade3, grade4, grade5};
double[] b={grade1, grade2, grade3, grade4, grade5};
Array.Sort(b);
for(int i=4;i>=0;i--)
{
for(int j=0;j<5;j++)
{
if(a[i]==b[j])
{
Console.WriteLine("Grade "+(j+1)+": "+a[i]);
}
}
}
}
}
class GradesChecker
{
static void Main()
{
Grades g=new Grades();
Console.WriteLine("Enter the five grades");
double grade1=Convert.ToDouble(Console.ReadLine());
double grade2=Convert.ToDouble(Console.ReadLine());
double grade3=Convert.ToDouble(Console.ReadLine());
double grade4=Convert.ToDouble(Console.ReadLine());
double grade5=Convert.ToDouble(Console.ReadLine());
g.getGrades(grade1, grade2, grade3, grade4, grade5);
g.ToString();
}
}
}
Screenshot of the Code:
![for(int i=4;i>=0; i--) { for(int j =0; j<5; j++) { if(a[i]==b[j]) { Console.WriteLine(Grade +(j+1)+: +a[i]); } } } class](http://img.homeworklib.com/questions/2b340940-be74-11eb-b795-0f14b2910357.png?x-oss-process=image/resize,w_560)
Output:

Using C#: • Create a "Grades" class with the private variables: double grade1, double grade2, double...
I ONLY need question 2 part C AND D answered...it is in bold. Please do not use hash sets or tables. In java, please implement the classes below. Each one needs to be created. Each class must be in separate file. The expected output is also in bold. I have also attached the driver for part 4 to help. 1. The Student class should be in the assignment package. a. There should be class variable for first and last names....
Why is this not giving me a letter grade when run? #include <iostream> #include <iomanip> using namespace std; int main() { double grade1, grade2, grade3, grade4, total; cout << "please enter the first grade : "; cin >> grade1; cout << "Please enter the second grade : "; cin >> grade2; cout << "Please enter the third grade : "; cin >> grade3; cout << "Please enter the fourth grade : "; cin >> grade4; total = (grade1 + grade2...
Hello, Can you please error check my javascript? It should do the following: Write a program that uses a class for storing student data. Build the class using the given information. The data should include the student’s ID number; grades on exams 1, 2, and 3; and average grade. Use appropriate assessor and mutator methods for the grades (new grades should be passed as parameters). Use a mutator method for changing the student ID. Use another method to calculate the...
create an application that calculates the grades of students
Wilbur Wright College CIS 142 C++ Programming Language Prof. Gustavo Alatta Lab #4 Points: 100 1.1. Create an application that calculates the grades of a group of students. The program must follow these specifications: - You need to declare 2 arrays: 1 single String array to contain the name of the students and the second a double two-dimensional to hold the grades of the students. - The program must allow the...
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...
The Computer Science Instructor has just completed compiling all the grades for the C++ Programming class. The grades were downloaded into a file titled ‘studentGrades.txt’ (attached). Write a C++ Program that reads this file and calculates the following as described : The final semester numeric and letter grade (using 10 point scale) Calculated as follows: Labs 1-6 (worth 50% of final grade) Lab 7 is extra credit (worth 2 % of final grade OR replaces lowest lab grade – Select...
Java please
9:55 Note @13 simple lists of numbers. If the user selects option 2, your program should prompt for a list of integer grades (0 100, inclusive). When the list is entered print out the following statistics: total grades, the breakdown of grades by letter both count and percentage), the highest and lowest grades in the list, and the class average Example #1 Please enter a list of grades (0-100): 55 65 75 85 95-1 Total number of grades...
Using Java Write a class encapsulating the concept of student grades (50 elements) on a test, assuming student grades are composed of a list of integers between 0 and 100. Write the following methods: A constructor with just one parameter, the number of students; all grades can be randomly generated Accessor, mutator, toString, and equals methods A method returning the highest grade A method returning the average grade A method returning the lowest grade Write a client class to test...
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...
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