Click here to Skip to main content
15,921,694 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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.


C#
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);

                // Display the file contect to the console. Variable text is a string.
                System.Console.WriteLine("Contents of single.txt: \n\n{0}", text);


        }
}
Posted
Updated 7-Dec-14 7:56am
v3
Comments
ZurdoDev 5-Dec-14 15:10pm    
This is a volunteer site and not the appropriate site try and hire someone.

However, if you can clearly state where you are stuck then we'll gladly help but we won't do it for you.
[no name] 5-Dec-14 15:32pm    
Do you have your exam next week and forgot to learn for it?
Philippe Mori 5-Dec-14 19:24pm    
What is your problem? What have you tried so far?
Member 11289586 7-Dec-14 13:58pm    
I really don't have a clue what to do for this assignment; this is what I have done so far.
I dont get what to do next, in order to make it;
• 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

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);

// Display the file contect to the console. Variable text is a string.
System.Console.WriteLine("Contents of single.txt: \n\n{0}", text);


}
}
Richard MacCutchan 6-Dec-14 4:53am    
How would that help you; you would gain a qualification that you did not earn? And who could trust anyone that submitted someone else's work and claimed it as their own?

1 solution

here:
http://www.freelancer.com
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900