aboutsummaryrefslogtreecommitdiff
path: root/CST116F2021-Lab5/CST116-lab5-Functions.cpp
blob: 6502081a51df3ce3625c4d6d8680aa57e6573603 (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
// File:	CST116-Lab_5-FUnctions.cpp
// Summary:	A compilation of all function files in lab 5
// Author:	Logan Billingsley
// Date:	11/2/2021

#include "CST116-lab5.h"

							// 9b -- 10.6 Learn by Doing Exercises
/*
void GetScores(float scores[])
{
	for (int i = 0; i < SIZE; i++) // Get scores
	{
		cout << "Please enter score " << i + 1 << ": ";
		cin >> scores[i];
		cout << endl;
	}
	return;
}
void DisplayScores(float scores[], int& A, int& B, int& C, int& D, int& F)
{
	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++;
		}
	}
	return;
}
void DisplayTotals(int A, int B, int C, int D, int 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;
}
*/

								// 10a -- 10.7 Learn by Doing Exercies 2
/*
void GetNames(char first[], char last[])
{
	cout << "Input your first name: ";
	cin >> first;
	cout << endl;
	cout << "Input your last name: ";
	cin >> last;
	cout << endl << endl;
	return;
}
void FullName(char first[], char last[], char full[])
{
	int i = 0;
	for (int j = 0; last[j] != '\0'; j++)
	{
		full[i] = last[j];
		i++;
	}
	full[i] = ',';
	i++;
	full[i] = ' ';
	i++;
	for (int j = 0; first[j] != '\0'; j++)
	{
		full[i] = first[j];
		i++;
	}
	full[i] = '\0';
	return;
}
void PrintName(char full[])
{
	cout << "Full Name: " << full << endl;
	return;
}
*/

							// 10b -- 10.8 Exercies 7
/*
void GetString1(char string1[])
{
	cout << "Please input name 1: ";
	cin.getline(string1, SIZE);
	cin.clear();
	cin.ignore(cin.rdbuf()->in_avail());
}
void GetString2(char string2[])
{
	cout << "Please input name 2: ";
	cin.getline(string2, SIZE);
}
void CompareStrings(char string1[], char string2[])
{
	int result;

	result = strncmp(string1, string2, 6);

	if (result == 0)
		cout << "Same\n\n";
	else
		cout << "Different\n\n";

}
*/