728x90 AdSpace

Latest Article



Gradebook Practice Question for C++ & Java Programming





Gradebook Practice Problem Question for C++ & Java Programming
Gradebook
You are provided with the file "marks.txt" where the roll numbers of 150 students are listed,
followed by their marks in an assignment separated by a space. Roll numbers range from 0
to 149. Marks will be between between 0 and 9.
Write a program that reads this file and stores the data in a 1-dimensional integer array of
size 150.
You are also required to maintain a count of how many students got a certain number of
marks. You can do this using a second 1-dimensional integer array of size 10.
Lastly, your program should generate a 'bar graph' of the counts that you have stored. For
example, if your array of counters stores the following values:
Marks Count
0 1
1 3
2 4
3 7
4 14
5 2
6 31
7 17
8 3
9 10
The corresponding bar graph should be as follows:
0 *
1 ***
2 ****
3 *******
4 **************
5 **
6 ******************************
7 *****************
8 ***
9 **********
Store this bar graph in a second file named "graph.txt".

no image






  • Blogger Comments
  • Facebook Comments

0 comments:

Post a Comment