Question

  -You are going to write a program to help me determine the final grade and...

 

-You are going to write a program to help me determine the final grade and calculate some summary stats. The steps are described below:

1. First, create a dictionary of 10 students with student name as key and score as value.

•For simplicity, name students as student 1, student 2, etc. Scores are random integers from 0-100

2. Calculate the average score in the class

3. Determine the letter grade based on the following scheme

:•A if score >= average_score+10

•B if average+10 > score >= average_score

•C if average > score >= average_score-10

•D otherwise

4. Derive summary stats in terms of the # of As, Bs, Cs, and Ds.

−You program needs to output student scores, grades, average score, and summary stats.

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

**Code is given below**

using System;
using System.Collections.Generic;

public class Test
{
static double average_score=0;
static int A=0,B=0,C=0,D=0;

static char Grade(double score){
if(score>=average_score+10){A++;return 'A';}
else if(score>=average_score && score else if(score>=average_score-10 && score else{D++;return 'D';}
}

public static void Main(string[] args){
String key;
Random random=new Random();
Dictionary record=new Dictionary();
for(int i=1;i<=10;i++){
key="Student "+i;
record.Add(key,random.Next(101));
}

foreach(KeyValuePair value in record){
average_score+=value.Value;
}

average_score/=10;

foreach(KeyValuePair value in record){
Console.WriteLine("Student Name: {0}",value.Key);
Console.WriteLine("Score: {0}",value.Value);
Console.WriteLine("Grade: "+Grade(value.Value)+"\n");
}   
  
Console.WriteLine("Average score in the class: "+average_score);
Console.WriteLine("\nSummary Stats:");
Console.WriteLine("Number of As: "+A+"\nNumber of Bs: "+B+"\nNumber of Cs: "+C+"\nNumber of Ds: "+D);


}
}

**Code ended**

Output:

Add a comment
Know the answer?
Add Answer to:
  -You are going to write a program to help me determine the final grade and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • Java Program: In this project, you will write a program called GradeCalculator that will calculate the...

    Java Program: In this project, you will write a program called GradeCalculator that will calculate the grading statistics of a desired number of students. Your program should start out by prompting the user to enter the number of students in the classroom and the number of exam scores. Your program then prompts for each student’s name and the scores for each exam. The exam scores should be entered as a sequence of numbers separated by blank space. Your program will...

  • C++ Write a program to calculate final grade in this class, for the scores given below...

    C++ Write a program to calculate final grade in this class, for the scores given below . Remember to exclude one lowest quiz score out of the 4 while initializing the array. Display final numeric score and letter grade. Use standard include <iostream> Implementation: Use arrays for quizzes, labs, projects and exams. Follow Sample Output for formatting. May use initialization lists for arrays. Weight distribution is as follows: Labs: 15% Projects: 20% Quizzes: 20% Exams: 25% Final Project: 20% Display...

  • please use the c language Assignment 12 The program to write in this assignment is a...

    please use the c language Assignment 12 The program to write in this assignment is a program that calculates score statistics and manages the grades of the students. First, the student list and are given in a file named "student.dat" as in the following: 이성우 77 홍길동 88 scores 201 1710086 2012700091 This program reads the input file "student.dat" and keeps this data in a linear linked list. Each node must be a struct which contains the following: student id...

  • [JAVA/chapter 7] Assignment: Write a program to process scores for a set of students. Arrays and...

    [JAVA/chapter 7] Assignment: Write a program to process scores for a set of students. Arrays and methods must be used for this program. Process: •Read the number of students in a class. Make sure that the user enters 1 or more students. •Create an array with the number of students entered by the user. •Then, read the name and the test score for each student. •Calculate the best or highest score. •Then, Calculate letter grades based on the following criteria:...

  • in C porgraming . use #include〈stdio.h〉 #include〈stdlib.h〉 Assignment 12 The program to write in this assignment...

    in C porgraming . use #include〈stdio.h〉 #include〈stdlib.h〉 Assignment 12 The program to write in this assignment is a program that calculates score statistics and manages the grades of the students. First, the student list and scores are given in a file named "student.dat" as in the following: 이성우 77 홍길동 88 2011710086 2012700091 This program reads the input file "student.dat" and keeps this data in a linear linked list. Each node must be a struct which contains the following: student_id,...

  • Write a program that asks the user for a student name and asks for grades until...

    Write a program that asks the user for a student name and asks for grades until the user enters a non-number input, it should then ask if the user wants to enter another student, and keep doing the process until the user stops adding students. The student’s must be stored in a dictionary with their names as the keys and grades in a list. The program should then iterate over the dictionary elements producing the min, max, and mean of...

  • 1. Write a program that randomly generates 10 whole numbers between 0 and 100 and stores...

    1. Write a program that randomly generates 10 whole numbers between 0 and 100 and stores them into an array. The program then calculates the average and displays the average and the numbers that are above the average. Use loops where needed. Must be stored in an array. Must be done using C++. 2. Write a program that reads 8 student scores, between 0 and 100, finds the best score, and then assigns grades based on the following scheme. Must...

  • Write a Java program that reads a file until the end of the file is encountered....

    Write a Java program that reads a file until the end of the file is encountered. The file consists of an unknown number of students' last names and their corresponding test scores. The scores should be integer values and be within the range of 0 to 100. The first line of the file is the number of tests taken by each student. You may assume the data on the file is valid. The program should display the student's name, average...

  • Your assignment is to write a grade book for a teacher. The teacher has a text file, which includ...

    Your assignment is to write a grade book for a teacher. The teacher has a text file, which includes student's names, and students test grades. There are four test scores for each student. Here is an example of such a file: Count: 5 Sally 78.0 84.0 79.0 86.0 Rachel 68.0 76.0 87.0 76.0 Melba 87.0 78.0 98.0 88.0 Grace 76.0 67.0 89.0 0.0 Lisa 68.0 76.0 65.0 87.0 The first line of the file will indicate the number of students...

  • Help me write the program in C++ Thanks Program #1: Calculate a student's grade for a...

    Help me write the program in C++ Thanks Program #1: Calculate a student's grade for a class. The class has 4 categories of grades. Each category has different weights. The student's report should include the student's first and last name; course; semester, category listing with weight for each category, grades for each category and the student's final average with a letter grade. Categories with weights: 1. Exams: 30%(3 @ 10% each) 2. Labs: 30% (3 labs @ 10% cach) 3....

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
ADVERTISEMENT