aboutsummaryrefslogtreecommitdiff
path: root/CST116F2021-Lab5/CST116F2021-Lab5.cpp
blob: 380b00fa32d5cfff5e01df250148de495de7f93d (plain) (blame)
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
// CST116F2021-Lab5.cpp : This file contains the 'main' function. Program execution begins and ends there.
//


#include "Header1.h"

int main()
{
	char string_1[INPUT_LIMIT]{};
	char string_2[INPUT_LIMIT]{};

	GetInput(string_1, string_2);
	CompareInput(string_1, string_2);
	/*DispResult();*/

	return 0;
}






//int main()
//{
//	char firstName[FIRST_NAME]{};
//	char lastName[LAST_NAME]{};
//	char fullName[FULL_NAME]{};
//
//	GetFirst(firstName);
//	GetLast(lastName);
//	DispName(firstName, lastName, fullName);
//
//	return 0;
//}






//#include <iostream>
//
//using namespace std;
//
//void GetScores(float []);
//void CheckGrade(float [], char []);
//float calcAvg(float [], float avg);
//void CountScores(char [], int []);
//
//const int NUM_SCORES = 10;
//const int NUM_STUD = 5;
//const int NUM_GRADE = 5;

//p.253
//int main()
//{
//    float currStudent[NUM_SCORES]{ 0.0 };
//    char Grade[NUM_SCORES];
//    int numGrade[NUM_GRADE]{ 0 };
//    float avg = 0.0;
//
//    GetScores(currStudent);
//    CheckGrade(currStudent, Grade);
//    calcAvg(currStudent, avg);
//    CountScores(Grade, numGrade);
//
//
//    return 0;
//}

//void GetScores(float score_input[])
//{
//    //Loop for storing scores to array
//    for (int i = 0; i < NUM_SCORES; i++)
//    {
//        cout << "Enter score #" << i + 1 << " of " << NUM_SCORES << ": ";
//        cin >> score_input[i];
//    }
//}
//
//void CheckGrade(float score_input[], char grade_output[])
//{
//    //Loop for comparing scores to letter grade then storing to another array
//    for (int i = 0; i < NUM_SCORES; i++)
//    {
//        if (score_input[i] >= 92.0)
//            grade_output[i] = 'A';
//        else if (score_input[i] >= 84.0)
//            grade_output[i] = 'B';
//        else if (score_input[i] >= 75.0)
//            grade_output[i] = 'C';
//        else if (score_input[i] >= 65.0)
//            grade_output[i] = 'D';
//        else
//            grade_output[i] = 'F';
//
//        cout << "\nTest #" << i + 1 << " scored " << score_input[i] << " and received grade " << grade_output[i];
//    }
//}
//
//float calcAvg(float score_input[], float avg)
//{
//    //Calc class average
//    for (int i = 0; i < NUM_SCORES; i++)
//    {
//        avg += score_input[i];
//    }
//
//    avg /= NUM_SCORES;
//
//    cout << "\n\nThe class average for " << NUM_SCORES << " scores is " << avg << endl;
//
//    return avg;
//}
//
//void CountScores(char grade_output[], int nGrade[])
//{
//    //Loop for counting number of each letter grade
//    for (int i = 0; i < NUM_SCORES; i++)
//    {
//        if (grade_output[i] == 'A')
//            nGrade[0] += 1;
//        else if (grade_output[i] == 'B')
//            nGrade[1] += 1;
//        else if (grade_output[i] == 'C')
//            nGrade[2] += 1;
//        else if (grade_output[i] == 'D')
//            nGrade[3] += 1;
//        else
//            nGrade[4] += 1;
//    }
//
//    cout << "\nThe number of Grade A tests is: " << nGrade[0];
//    cout << "\nThe number of Grade B tests is: " << nGrade[1];
//    cout << "\nThe number of Grade C tests is: " << nGrade[2];
//    cout << "\nThe number of Grade D tests is: " << nGrade[3];
//    cout << "\nThe number of Grade F tests is: " << nGrade[4];
//}

//p.247
//const int NUM_SCORES = 10;
//const int NUM_STUD = 5;
//const int NUM_GRADE = 5;
//
//int main()
//{
//    float currStudent[NUM_SCORES]{ 0.0 };
//    char Grade[NUM_SCORES];
//    int numGrade[NUM_GRADE]{ 0 };
//    float avg = 0.0;
//    
//    //Loop for storing scores to array
//    for (int i = 0; i < NUM_SCORES; i++)
//    {
//        cout << "Enter score #" << i + 1 << " of " << NUM_SCORES << ": ";
//        cin >> currStudent[i];
//    }
//
//    //Loop for comparing scores to letter grade then storing to another array
//    for (int i = 0; i < NUM_SCORES; i++)
//    {
//        if (currStudent[i] >= 92.0)
//            Grade[i] = 'A';
//        else if (currStudent[i] >= 84.0)
//            Grade[i] = 'B';
//        else if (currStudent[i] >= 75.0)
//            Grade[i] = 'C';
//        else if (currStudent[i] >= 65.0)
//            Grade[i] = 'D';
//        else
//            Grade[i] = 'F';
//
//        cout << "\nTest #" << i + 1 << " scored " << currStudent[i] << " and received grade " << Grade[i];
//    }
//    
//    //Calc class average
//    for (int i = 0; i < NUM_SCORES; i++)
//    {
//        avg += currStudent[i];
//    }
//
//    avg /= NUM_SCORES;
//
//    cout << "\n\nThe class average for " << NUM_SCORES << " scores is " << avg << endl;
//
//    //Loop for counting number of each letter grade
//    for (int i = 0; i < NUM_SCORES; i++)
//    {
//        if (Grade[i] == 'A')
//            numGrade[0] += 1;
//        else if (Grade[i] == 'B')
//            numGrade[1] += 1;
//        else if (Grade[i] == 'C')
//            numGrade[2] += 1;
//        else if (Grade[i] == 'D')
//            numGrade[3] += 1;
//        else
//            numGrade[4] += 1;
//    }
//
//    cout << "\nThe number of Grade A tests is: " << numGrade[0];
//    cout << "\nThe number of Grade B tests is: " << numGrade[1];
//    cout << "\nThe number of Grade C tests is: " << numGrade[2];
//    cout << "\nThe number of Grade D tests is: " << numGrade[3];
//    cout << "\nThe number of Grade F tests is: " << numGrade[4];
//
//    return 0;
//}