Sale!

Assignment 3 CSC250 solved

$30.00 $18.00

Original Work ?

Download Details:

  • Name: AssignmentThree-ulwnwi.zip
  • Type: zip
  • Size: 178.45 KB

Category: Tags: , You will Instantly receive a download link upon Payment||Click Original Work Button for Custom work

Description

5/5 - (1 vote)

Write a C program that generates a histogram of student grades for a particular assignment. The program should read each student’s grade as an integer number, however, the grades will be entered as command-line arguments. In calculating the histogram, the minimum value of a grade is 0, but your program should determine the maximum value entered by the user. Use the atoi() library function to convert the entered string argument to an integer number.

By incorporating error handling mechanisms and statistical analysis into your program, you can enhance its robustness and provide valuable insights, ensuring a more comprehensive and reliable solution.

Error Handling:

1. Check if grades are within the valid range (0-100) and display an error if not.
2. Ensure the correct number of command-line arguments is provided.

Statistics Calculation:
1. Calculate and display the mean (average) of the grades.
2. Determine and display the median grade.

Sample Run 1:

./histogram 20 30 4 20 110 30 30
Histogram:
Number of 4’s: 1
Number of 20’s: 2
Number of 30’s: 3
110 is Invalid input
Mean: 19.3
Median: 25

Sample Run 2:

./histogram
Error