aboutsummaryrefslogtreecommitdiff
path: root/CST116F2021-Lab5/CST116F2021-Lab5.cpp
blob: fe1596fadc48cf2b2aa509da30b38f7012d94098 (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
// File:	CST116-Lab_5-Billingsley.cpp
// Summary:	A compilation of all coding exercises in lab 5
// Author:	Logan Billingsley
// Date:	11/2/2021

#include "CST116-lab5.h"

							// 9a -- 10.5 Learn by Doing Exercises
/*
#include <iostream>
using namespace std;

const int SIZE = 10;

int main()
{
	float scores[SIZE];
	int A = 0,
		B = 0,
		C = 0,
		D = 0,
		F = 0;

	for (int i = 0; i < SIZE; i++) // Get scores
	{
		cout << "Please enter score " << i + 1 << ": ";
		cin >> scores[i];
		cout << endl;
	}
	for (int i = 0; i < SIZE; i++) // Display scores and letter grade.
	{
		cout << "Score " << i + 1 << ": " << scores[i] << ' ';
		if (scores[i] >= 92)
		{
			cout << "A\n\n";
			A++;
		}
		else if (scores[i] >= 84)
		{
			cout << "B\n\n";
			B++;
		}
		else if (scores[i] >= 75)
		{
			cout << "C\n\n";
			C++;
		}
		else if (scores[i] >= 65)
		{
			cout << "D\n\n";
			D++;
		}
		else
		{
			cout << "F\n\n";
			F++;
		}
	}
	cout << "There were a total of: \n"
		 << A << " A's\n"
		 << B << " B's\n"
		 << C << " C's\n"
		 << D << " D's\n"
		 << F << " F's\n\n";
	return 0;
}
*/

							// 9b -- 10.6 Learn by Doing Exercises
/*
int main()
{
	float scores[SIZE];
	int A = 0,
		B = 0,
		C = 0,
		D = 0,
		F = 0;

	GetScores(scores);
	DisplayScores(scores, A, B, C, D, F);
	DisplayTotals(A, B, C, D, F);

	return 0;
}
*/

							// 10a -- 10.7 Learn by Doing Exercies 2
/*
int main()
{
	char first[SIZE],
		 last[SIZE],
		 full[SIZE*3];

	GetNames(first, last);
	FullName(first, last, full);
	PrintName(full);

	return 0;
}
*/

							// 10b -- 10.8 Exercies 7
/*
int main()
{
	char string1[SIZE],
		 string2[SIZE];

	GetString1(string1);
	GetString2(string2);
	CompareStrings(string1, string2);
}
*/