As the title states,I really need help with my assignment. I will be willing to pay a small fee for help, due to the face that I am really struggling with this assignment. I will paste my code that i have done so far below
The assignment states;
Create a class that represents the grade distribution for a given course. In this class you should write
methods to perform the following tasks:
• Open a file (which will be provided) that contains a set of data
• Read in the data
• Set the number of each grade
• Set the total number of grades
• Set the percentage of each grade as a whole number between 0 and 100 inclusive
• Display a bar graph of the grade distribution on the console
The graph should have the correct number of bars, one per grade. Each bar can be a horizontal row of
asterisks, such that the number of asterisks in a row is proportionate to the percentage of grades in
each category. For example, let on asterisk represent 2%, so 50 asterisks correspond to 100%. Mark
the horizontal axis at 10% increments from 0 to 100% and label each line with a grade identifier.
For example, if the grades are entered as 1A, 4B’s, 6C’s, 2D’s and 1F, then the output might look like:
0 10 20 30 40 50 60 70 80 90 100
| | | | | | | | | | |
***************************************************
**** A
************** B
********************* C
****** D
E
**** F
Reply to this thread if this is something that you will able to help with.
using System;
using System.IO;
public class ReadFromFile
{
public static void Main()
{
string file = @"C:\Users\BenjaminStock\Desktop\grades_single.txt";
string text = File.ReadAllText(file);
System.Console.WriteLine("Contents of single.txt: \n\n{0}", text);
}
}