having hard time with a few functions

part A
1
2
3
4
void student_data()
{

}




part B
1
2
3
4
5
void findHighestScores(int)
{


}


I need some help trying to write a function for part a and b:
Part A: For part a I need to write a function to read the students data in the array that I have.

Part B: For part b I need to write a function to find the highest test score.

And the whole code that I have is this
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#include <iomanip>
#include <string>
#include <iostream>
#include <fstream>	
#include <array>

using namespace std;

void findHighestScores(int);
struct studentType
{
	string studentFName, studentLName;
	int testScore;
	char grade;
	int studentType[20];
};

int main()
{
	ifstream inFile;
	inFile.open("Ch9Pr1DataIn.txt");

	if (!inFile)
	{
		cout << "Cannot open file.";
		exit(1);
	}

	char showGrade(char grade)
	;{
		switch(int testScore = 0 && 100)
		{
		case 1:
			{
				return 'A';
			}
			break;

		case 2:
			{
				return 'B';
			}
			break;

		case 3:
			{
				return 'C';
			}
			break; 

		case 4:
			{
				return 'D';
			}
			break;

		case 5:
			{
				return 'F';
			}
			break;

		default: break;

		}
	}


	return 0;
}

// Part A
void student_data()
{

}

// Part B
void findHighestScores(int)
{


}


that's just the code that I have right now if any one can help me please I just need something based on where I need to start for part a and b.
Alright let me try to understand what you wrote. I am just going to go ahead and assume you are still a bit inexperienced with c++, I am going to be frank with you, that explanation left me blank, and I have no idea how to help you. Would you mind reading me the problem.
Last edited on
Topic archived. No new replies allowed.