SlideShare a Scribd company logo
1 of 46
Download to read offline
COMPUTER SCIENCE I.A.
2022
1
Contents Pages
Problem Statement 2
Functional Requirements 3
Non-Functional Requirements 4
Psuedocode 5-23
Technical Documentation 24
Program Code 25-35
File Design 36
Whitebox Testing 37
Results of Whitebox Testing 38-39
Functional Testing 40-43
User Documentation
2
PROBLEM STATEMENT
A new Trinidad and Tobago game show called “What Yuh Know” recently started airing on the
CNC 3 channel and has experienced difficulties keeping track of all contestants and their
information who participated in the period of April to June on paper, manually writing up the
number of questions answered correctly, calculating their equivalent points, converting the
points into cash (USD) with the option to check the equivalent value (in TTD) and stating
whether or not the contestant has moved on to the next session. This is mainly due to human
error when writing down player information / records and miscalculations.
At round one, every (4) questions answered correctly awards 5 points, at round two, every (4)
questions answered correctly awards 10 points and at round three, every (4) questions answered
correctly awards 20 points. At the end of the session, all the points awarded from the three
rounds will be added. Furthermore, every 20 points the contestant has, is equivalent to a cash
amount of USD $5.00 which can then be converted to TTD, using the formula (𝑥 * 6.79660).
Finally, it will be decided if the contestant has qualified to enter the next session. At least 120
points are required to advance to the next session.
In order to help this new game show, a program has been created to function as a database to
easily keep track of its contestants for the months of April, May, June. The program has various
tasks such as adding new contestants to the database, viewing all records (report), sorting the
records, exporting the data to an external file, importing data from external file.
3
FUNCTIONAL REQUIREMENTS
This new digital system requires certain function requirements to correct issues identified in the
old system and increase its overall performance and efficiency.
Adding a Contestant
The new system must be able to add contestants and their respective information to the database.
Such information recorded would include the contestant’s ID, both first and last name and the
month they participated in.
The system will also record the number of questions answered correctly for each round and
calculate the number of points earned at each round as well as the overall number of points at the
end of the three rounds. It calculates the cash earned via converting the points to USD and can
also calculate its value in TTD (optional). Finally, this new system decides whether or not the
contestant has advanced to the next session.
Display All Records
This system must be able to generate and present reports of each contestant’s relevant
information from the database accurately.
Sort All Records
The system should be able to sort the records in the database in descending order.
Exporting Records
The new system should be able to export the reports from the database to an external file.
4
5
NON-FUNCTIONAL REQUIREMENTS
Apart from functions that are absolutely necessary for the new system, some non-essential
functions are also required as they improve the overall quality of the system.
User-Friendly Interface
This system must be user friendly to ensure a smooth transition from the old system. It must be
designed so that any user can easily navigated the menu of the program.
Data-Validation
There must be some form of validation to all data entered into the system. This is to ensure that
there is a minimum number of errors and incorrect data entered into the contestant log.
Proper User-Prompts
The appropriate messages should be displayed to the user at appropriate times to guide the user
on what to input at the correct time.
6
PSUEDOCODE
STRUCT member
int contestantID
char contestantFName[20], contestantLName[20], monthOfParticipation[3]
int noCorrectAns1, noCorrectAns2, noCorrectAns3
int totalPtsEarned1, totalPtsEarned2, totalPtsEarned3, overallPts
int cashEarned
float cashEarnedTT
DECLARE const int recnumber = 30
DECLARE member contestantRec[recnumber]
DECLARE int recNo = 0
Narrative Description:
This procedure allows the user to add a contestant’s record to the Log.
FUNCTION addContestant ()
BEGIN
DECLARE char response
DECLARE int flag = 0
DECLARE int tempNum, tempNum1, tempNum2, tempNum3 = 0
DECLARE char tempVar[20]
DECLARE char acceptable
7
OUTPUT ("| #################/** ADD NEW CONTESTANT **/#################### |")
OUTPUT ("|----------------------------------------------------------------------------------------------|")
acceptable = 'N'
do
begin
OUTPUT ("Please Enter Contestant ID: ")
READ (tempVar)
if (strlen (tempVar) != 4) then
acceptable = 'N'
OUTPUT ("The contestant's ID consists of only (4) digits!”)
else
acceptable = 'Y'
end if
while (acceptable == 'N')
contestantRec[recNo].contestantID = atoi(tempVar)
acceptable = 'N'
do
begin
OUTPUT ("Please Enter First Name: ")
READ (tempVar)
if (strlen (tempVar) > 20) then
acceptable = 'N'
OUTPUT ("First Name is Too Long! MUST be no longer than (20) characters!")
else
acceptable = 'Y’
end if
while (acceptable == 'N')
strcpy (contestantRec[recNo].contestantFName,tempVar)
8
acceptable = 'N'
do
begin
OUTPUT ("Please Enter Last Name: ")
READ (tempVar)
if (strlen (tempVar) > 20) then
acceptable = 'N'
OUTPUT ("Last Name is Too Long! MUST be no longer than (20) characters!")
else
acceptable = 'Y'
end if
while (acceptable == 'N')
strcpy (contestantRec[recNo].contestantLName,tempVar)
acceptable = 'N'
do
begin
OUTPUT ("Please Enter Month of Participation: ")
READ (tempVar)
if (strlen (tempVar) == 3) then
acceptable = 'Y'
else
OUTPUT (“Please enter the first THREE letters of the Corresponding Month!
end if
while (acceptable == 'N')
strcpy (contestantRec[recNo].monthOfParticipation,tempVar)
9
acceptable = 'N'
do
begin
OUTPUT ("Please Enter Number of Correct Round 1 Answers: ")
READ (tempNum1)
if (tempNum1 > 20) then
OUTPUT ("ERROR! There are only (20) Questions at the First Round!")
else
acceptable = 'Y'
end if
while (acceptable == 'N')
contestantRec[recNo].noCorrectAns1 = tempNum1
acceptable = 'N'
do
begin
OUTPUT ("Please Enter Number of Correct Round 2 Answers: ")
READ (tempNum2)
if (tempNum2 > 20) then
OUTPUT ("ERROR! There are only (24) Questions at the First Round!")
else
acceptable = 'Y'
end if
while (acceptable == 'N')
contestantRec[recNo].noCorrectAns2 = tempNum2
10
acceptable = 'N'
do
begin
OUTPUT ("Please Enter Number of Correct Round 3 Answers: ")
READ (tempNum3)
if (tempNum3 > 20) then
OUTPUT ("ERROR! There are only (16) Questions at the First Round!")
else
acceptable = 'Y'
end if
while (acceptable == 'N')
contestantRec[recNo].noCorrectAns3 = tempNum3
contestantRec[recNo].totalPtsEarned1 = (contestantRec[recNo].noCorrectAns1 / 4) * 5
contestantRec[recNo].totalPtsEarned2 = (contestantRec[recNo].noCorrectAns2 / 4) *10
contestantRec[recNo].totalPtsEarned3 = (contestantRec[recNo].noCorrectAns3 / 4) *20
contestantRec[recNo].overallPts = contestantRec[recNo].totalPtsEarned1 +
contestantRec[recNo].totalPtsEarned2 + contestantRec[recNo].totalPtsEarned3
OUTPUT ("OVERALL POINTS EARNED: ",contestantRec[recNo].overallPts)
contestantRec[recNo].cashEarned = (contestantRec[recNo].overallPts / 20) * 5
OUTPUT ("CASH EARNED IN USD: USD $ ",contestantRec[recNo].cashEarned)
11
OUTPUT ("Would you like to convert cash into TTD? Enter 'Y' for yes or 'N' for no: ")
READ (response)
if (response == 'Y') then
contestantRec[recnumber].cashEarnedTT = contestantRec[recNo].cashEarned * 6.79660
OUTPUT ("CASH EARNED IN TTD: TTD",contestantRec[recNo].cashEarnedTT);
else
OUTPUT ("CASH EARNED IN TTD: TTD N/A")
end if
OUTPUT ("**************************************************************")
recNo ++
system ("pause")
system ("cls")
END add player
12
Narrative Description:
This procedure allows the user to display All stored records.
FUNCTION viewALL ()
BEGIN
DECLARE int x = 0
OUTPUT(“|--------------------------------------------------------------------------------------------|”)
OUTPUT ("| ###########/** RECORDS OF All CONTESTANTS!! **/########### |")
OUTPUT ("|--------------------------------------------------------------------------------------------|")
for (x = 0; x < recNo; x++)
begin
OUTPUT("*** --------------- _CONTESTANT'S RECORD_ --------------- ***")
OUTPUT(" _________________________________________________________")
OUTPUT(" |-----**Registeration Information of Contestant!!**-----|")
OUTPUT(" |** Contestant's ID: ",contestantRec[x].contestantID)
OUTPUT(" |** Contestant's First Name: ",contestantRec[x].contestantFName)
OUTPUT(" |** Contestant's Last Name: ",contestantRec[x].contestantLName)
OUTPUT(" |** Contestant's Month of Participation: ",contestantRec[x].monthOfParticipation)
OUTPUT(" |-----**NUMBER OF CORRECT ANSWERS AT EACH ROUND!!**-----|")
OUTPUT(" |** Round 1 Correct Anwers: ",contestantRec[x].noCorrectAns1)
OUTPUT(" |** Round 2 Correct Anwers: ",contestantRec[x].noCorrectAns2)
OUTPUT(" |** Round 3 Correct Anwers: ",contestantRec[x].noCorrectAns3)
13
OUTPUT(" |--------**TOTAL POINTS EARNED AT EACH ROUND!!**--------|")
OUTPUT(" |** Round 1 Points: ",contestantRec[x].totalPtsEarned1)
OUTPUT(" |** Round 2 Points: ",contestantRec[x].totalPtsEarned2)
OUTPUT(" |** Round 3 Points: ",contestantRec[x].totalPtsEarned3)
OUTPUT(" |*******************************************************")
OUTPUT(" |** Overall Points: ",contestantRec[x].overallPts)
OUTPUT(" |** Cash Earned In USD: $",contestantRec[x].cashEarned)
OUTPUT(" |** Cash Earned In TTD: $",contestantRec[x].cashEarnedTT)
OUTPUT(" |*******************************************************|")
OUTPUT(" |------**QUALIFICATION STATUS FOR NEXT SESSION!!**------|")
if (contestantRec[x].overallPts >= 110) then
OUTPUT(" |** Status: QUALIFIED")
else
OUTPUT(" |** Status: UNQUALIFIED!")
OUTPUT(" |** ATLEAST 120 points is required to advance! **")
OUTPUT(" |########~~~~~~~#######________#########~~~~~~~~~#######|nnn")
endif
system("pause")
system("cls")
END display all
14
Narrative Description:
This procedure sorts the recorded dada in descending order via the bubble sort method.
FUNCTION bubbleSort ()
BEGIN
DECLARE int i, j, flag = 1
int temp_contestantID
char temp_contestantFName[20], temp_contestantLName[20], temp_monthOfParticipation[3]
int temp_noCorrectAns1, temp_noCorrectAns2, temp_noCorrectAns3
int temp_totalPtsEarned1, temp_totalPtsEarned2, temp_totalPtsEarned3, temp_overallPts
int temp_cashEarned
float temp_cashEarnedTT
OUTPUT ("==================/** SORTING RECORDS **/=================")
OUTPUT ("------------------------------------------------------------------------------------------------")
for (i = 1PRINT (i <= recNo) && flagPRINT i++)
begin
flag = 0PRINT
for (j = 0PRINT (j < recNo - 1)PRINT j++)
if (contestantRec[j + 1].overallPts > contestantRec[j].overallPts)
strcpy(temp_contestantID,contestantRec[j].contestantID)
strcpy(contestantRec[j].contestantID, contestantRec[j+1].contestantID)
strcpy(contestantRec[j+1].contestantID, temp_contestantID)
15
strcpy (temp_contestantFName,contestantRec[j].contestantFName)
strcpy (contestantRec[j].contestantFName, contestantRec[j+1].contestantFName)
strcpy (contestantRec[j+1].contestantFName, temp_contestantFName)
strcpy (temp_contestantLName,contestantRec[j].contestantLName)
strcpy (contestantRec[j].contestantLName, contestantRec[j+1].contestantLName)
strcpy (contestantRec[j+1].contestantLName, temp_contestantLName)
temp_noCorrectAns1 = contestantRec[j]. noCorrectAns1
contestantRec[j].noCorrectAns1 = contestantRec[j+1]. noCorrectAns1
contestantRec[j+1]. noCorrectAns1 = temp_noCorrectAns1
temp_noCorrectAns2 = contestantRec[j]. noCorrectAns2
contestantRec[j].noCorrectAns2 = contestantRec[j+1]. noCorrectAns2
contestantRec[j+1]. noCorrectAns2 = temp_noCorrectAns2
temp_noCorrectAns3 = contestantRec[j]. noCorrectAns3
contestantRec[j].noCorrectAns3 = contestantRec[j+1]. noCorrectAns3
contestantRec[j+1]. noCorrectAns3 = temp_noCorrectAns3
temp_totalPtsEarned1 = contestantRec[j].totalPtsEarned1
contestantRec[j].totalPtsEarned1 = contestantRec[j+1].totalPtsEarned1
contestantRec[j+1].totalPtsEarned1 = temp_totalPtsEarned1
temp_totalPtsEarned2 = contestantRec[j].totalPtsEarned2
contestantRec[j].totalPtsEarned2 = contestantRec[j+1].totalPtsEarned2
contestantRec[j+1].totalPtsEarned2 = temp_totalPtsEarned2
16
temp_totalPtsEarned3 = contestantRec[j].totalPtsEarned3
contestantRec[j].totalPtsEarned3 = contestantRec[j+1].totalPtsEarned3
contestantRec[j+1].totalPtsEarned3 = temp_totalPtsEarned3
temp_overallPts = contestantRec[j].overallPts
contestantRec[j].overallPts = contestantRec[j+1].overallPts
contestantRec[j+1].overallPts = temp_overallPts
temp_cashEarned = contestantRec[j].cashEarned
contestantRec[j].cashEarned = contestantRec[j+1].cashEarned
contestantRec[j+1].cashEarned = temp_cashEarned
flag = 1
OUTPUT (" ######/* Records Sorted Successfully!!! */##### ")
system ("pause")
return
END bubble Sort
17
Narrative Description;
This procedure exports the currently stored data to a file.
FUNCTION exportData()
BEGIN
system ("cls")
FILE*outputfile
OUTPUT ("=================== EXPORTING RECORDS ====================")
OUTPUT ("---------------------------------------------------------------------------------------------------")
outputfile = fopen ("Exported Data.txt","w+"
18
for (int x = 0 PRINT x < recNo PRINT x++)
OUTPUT (outputfile," ",contestantRec[x].contestantID)
OUTPUT (outputfile," ",contestantRec[x].contestantFName)
OUTPUT (outputfile," ",contestantRec[x].contestantLName)
OUTPUT (outputfile," ",contestantRec[x].monthOfParticipation)
OUTPUT (outputfile," ",contestantRec[x].noCorrectAns1)
OUTPUT (outputfile," ",contestantRec[x].noCorrectAns2)
OUTPUT (outputfile," ",contestantRec[x].noCorrectAns3)
OUTPUT (outputfile," ",contestantRec[x].totalPointsEarned1)
OUTPUT (outputfile," ",contestantRec[x].totalPointsEarned2)
OUTPUT (outputfile," ",contestantRec[x].totalPointsEarned3)
OUTPUT (outputfile," ",contestantRec[x].overallPts)
OUTPUT (outputfile," ",contestantRec[x].cashEarned)
OUTPUT (outputfile," ",contestantRec[x].cashEarnedTT)
OUTPUT (" #####/* Exporting Completed!!! */##### ")
CLOSE (outputfile)
system ("pause")
system ("cls")
END export
19
Narrative Description:
This procedure imports data from a designated file on the system to be stored as the currently stored
data.
FUNCTION importData()
BEGIN
System ("cls")
int x
OUTPUT ("==================== IMPORTING RECORDS ===================")
OUTPUT ("---------------------------------------------------------------------------------------------------")
FILE * inputfile
inputfile = fopen ("Exported Data.txt","r+")
20
while (feo (inputfile))
READ (inputfile," ",contestantRec[x].contestantID) PRINT
READ (inputfile," ",contestantRec[x].contestantFName) PRINT
READ (inputfile," ",contestantRec[x].contestantLName) PRINT
READ (inputfile," ",contestantRec[x].monthOfParticipation) PRINT
READ (inputfile," ",contestantRec[x].noCorrectAns1) PRINT
READ (inputfile," ",contestantRec[x].noCorrectAns2) PRINT
READ (inputfile," ",contestantRec[x].noCorrectAns3) PRINT
READ (outputfile," ",contestantRec[x].totalPointsEarned1) PRINT
READ (outputfile," ",contestantRec[x].totalPointsEarned2) PRINT
READ (outputfile," ",contestantRec[x].totalPointsEarned3) PRINT
READ (inputfile," ",contestantRec[x].overallPts) PRINT
READ (inputfile,"$ ",contestantRec[x].cashEarned) PRINT
READ (inputfile,"$ ",contestantRec[x].cashEarnedTT) PRINT
recNo++
endif
recNo—
OUTPUT (" #####/* Importing Completed!!! /*##### ")
CLOSE (inputfile)
system ("pause")
system ("cls")
END import
21
Narrative Description:
This procedure displays the intro animation at the start of the program.
FUNTION Intro_Screen()
BEGIN
OUTPUT ("| --------------------------------------------------------------------------------------------- |")
OUTPUT ("| *********---------***********----------************----------*********** |")
OUTPUT ("| =========|||****/// ((_.-=-._.-=-._.-=-._.-=-)) ///****|||========== | ")
OUTPUT ("| =========|||****/// ))~~~~~~~~~~~~~~~~(( ///****|||========== | ")
OUTPUT ("| ====|||****/// (( >WELCOME TO MY PROGRAM< ))///****||===== | ")
OUTPUT ("| ============|||****/// )).......................(( ///****|||============ | ")
OUTPUT ("| ===========|||****/// ((`-._.-'`-._.-'`-._.-'`-))) ///****|||=========== | ")
OUTPUT ("| _ _ _ _ | ")
OUTPUT ("| | | | _ _ _ ____ ____ ____ __ __ ____ ____ ____ ____ ____ _ _ _ | | | | ")
OUTPUT ("| |_|_|| | | || | || _ ||_ _| | | || | || | | | | || | || || | | ||_|_| |
")
OUTPUT ("| | | | || || | | | |_ _|| | || | | -|| | | || | || | | | |
")
OUTPUT ("| |_____||__|__||__|__| |_| |_| |____||__|__|
|__|__||_|___||_____||_____| |")
OUTPUT ("| __ __ __ | ")
OUTPUT ("| _____ _ _ _ __ | || || | | ")
OUTPUT ("| | | ___ ___ | |_ ___ ___ | |_ ___ ___ | |_ | | ___ ___ | || || | | ")
OUTPUT ("| | --|| . || || _|| -_||_ -|| _|| .'|| || _| | |__ | . || . ||__||__||__| |
")
OUTPUT ("| |_____||___||_|_||_| |___||___||_| |__,||_|_||_| |_____||___||_
||__||__||__| | ")
OUTPUT ("| |___| | ")
OUTPUT ("| ------------------------------------------------------------------------------------------- | ")
OUTPUT ("| ********----------************-----------************----------**********|")
END Welcome
22
Narrative Description:
This procedure manages the main menu of the program.
int main (void)
BEGIN
char choice
do
Intro_Screen();
OUTPUT ("-----------------------------------------")
OUTPUT (" | MAIN MENU | ")
OUTPUT ("-----------------------------------------")
OUTPUT ("| 1. Add New Contestant | ")
OUTPUT ("| 2. View All Records REPORT | ")
OUTPUT ("| 3. Sort Records | ")
OUTPUT ("| 4. Export ALL Records | ")
OUTPUT ("| 5. Import Data from file | ")
OUTPUT ("| 6. Exit | ")
OUTPUT ("-----------------------------------------")
READ (" ",choice)
switch (choice)
23
case '1'
addContestant()
break
case '2'
viewALL()
break
case '3'
bubbleSort()
break
case '4':
exportData()
break
case '5':
importData()
break
case '6':
exit()
break
default
OUTPUT ("INVALID CHOICE")
break
while (choice != '6')
END main
24
TECHNICAL DOCUMENTATION
Author: Laquando Young System/Program: Game
Show Calculator
Date: 06/04/2022
Diagram ID: 2.1 Name: What Yuh Know
INPUT
1: Registration
Information
2: Correctly
Answered
Questions
3: Yes or No
OUTPUT
1: Contestant’s
ID, First Name,
Last Name,
Month
Participated
2: Number of
Questions
Answered
Correctly, Total
Points Earned
at Each Round,
Overall Points
Earned, Cash in
USD
3: Cash Earned
in TTD, Status
(Advanced or
Not)
PROCESS
1: Stores Registration
Information
2: Stores Correctly
Answered Questions
Calculates Total
Points Earned at each
Round as well as the
Overall Points
Converts Points to
USD
3: Calculates the cash
earned in TTD using
the USD to TTD
conversion method.
Stores the
contestant Status
25
PROGRAM CODE
// This Program was written by Laquando Young.
/* Purpose: This program keeps track of all contestants' records from a game show, calculating
their equivalent points, converting the points to cash in USD with the option to check the
equivalent value in TTD and stating whether or not the contestant moved on to the next session.
*/
// Date: 06/04/2022
#include <windows.h>
#include <stdio.h>
#include <iostream>
#include <string>
using namespace std;
//###############################################################################################
################################
typedef struct {
int contestantID;
char contestantFName[20], contestantLName[20], monthOfParticipation[3];
int noCorrectAns1, noCorrectAns2, noCorrectAns3;
int totalPtsEarned1, totalPtsEarned2, totalPtsEarned3, overallPts;
int cashEarned;
float cashEarnedTT;
} member;
const int recnumber = 30;
member contestantRec[recnumber];
int recNo = 0;
//#########################################################################@@@@@@@@@@@@@@@@@@@###
################################
// start of add player
void addContestant () {
char response;
int flag = 0;
int tempNum, tempNum1, tempNum2, tempNum3 = 0;
char tempVar[20];
char acceptable;
system("cls");
26
printf("| #########################/** ADD NEW CONTESTANT **/######################### |n");
printf("|--------------------------------------------------------------------------------
|n");
// The following lines promts the user to enter the Contestant's ID then prints it out.
acceptable = 'N';
do{
printf("Please Enter the Contestant's ID: ");
scanf ("%s",tempVar);
if (strlen(tempVar) != 4){
acceptable = 'N';
printf("The contestant's ID consists of only (4) digits!n");
}else{
acceptable = 'Y';
}
}while (acceptable == 'N');
contestantRec[recNo].contestantID = atoi(tempVar);
// The following lines promts the user to enter the Contestant'a First Name then prints it
out.
acceptable = 'N';
do{
printf("Please Enter First Name: ");
scanf ("%s",tempVar);
if (strlen(tempVar) > 20){
acceptable = 'N';
printf("First Name is Too Long! MUST be no longer than (20) characters!n");
}else{
acceptable = 'Y';
}
}while (acceptable == 'N');
strcpy (contestantRec[recNo].contestantFName,tempVar);
// The following lines promts the user to enter the Contestant'a Last Name then prints it
out.
acceptable = 'N';
do{
printf("Please Enter Last Name: ");
scanf ("%s",tempVar);
if (strlen(tempVar) > 20){
acceptable = 'N';
printf("Last Name is Too Long! MUST be no longer than (20) characters!n");
}else{
acceptable = 'Y';
}
}while (acceptable == 'N');
strcpy (contestantRec[recNo].contestantLName,tempVar);
27
// The following lines promts the user to enter the Month the Contestant participated in the
game and prints it out.
acceptable = 'N';
do{
printf("Please Enter Month of Participation: ");
scanf ("%s",tempVar);
if (strlen(tempVar) == 3){
acceptable = 'Y';
}else{
printf("Please Enter the first THREE letters of the Corresponding Month!n");
}
}while (acceptable == 'N');
strcpy (contestantRec[recNo].monthOfParticipation,tempVar);
/* The following lines promts the user to enter the Number of correct questions answered by
the contestant in each
round and prints it out. */
acceptable = 'N';
do{
printf("Please Enter Number of Correct Round 1 Answers: ");
scanf ("%d",&tempNum1);
if (tempNum1 > 20){
printf("ERROR! There are only (20) Questions at the First Round!n");
}else{
acceptable = 'Y';
}
}while (acceptable == 'N');
contestantRec[recNo].noCorrectAns1 = tempNum1;
acceptable = 'N';
do{
printf("Please Enter Number of Correct Round 2 Answers: ");
scanf ("%d",&tempNum2);
if (tempNum2 > 24){
printf("ERROR! There are only (24) Questions at the Second Round!n");
}else{
acceptable = 'Y';
}
}while (acceptable == 'N');
contestantRec[recNo].noCorrectAns2 = tempNum2;
acceptable = 'N';
do{
printf("Please Enter Number of Correct Round 3 Answers: ");
scanf ("%d",&tempNum3);
if (tempNum3 > 16){
printf("ERROR! There are only (16) Questions at the Third Round!n");
}else{
acceptable = 'Y';
}
}while (acceptable == 'N');
contestantRec[recNo].noCorrectAns3 = tempNum3;
28
// The following lines calculates the total points a contestant makes in each round and
prints it out.
contestantRec[recNo].totalPtsEarned1 = (contestantRec[recNo].noCorrectAns1 / 4) * 5 ;
contestantRec[recNo].totalPtsEarned2 = (contestantRec[recNo].noCorrectAns2 / 4) * 10;
contestantRec[recNo].totalPtsEarned3 = (contestantRec[recNo].noCorrectAns3 / 4) * 20;
// The following lines calculates the Overall Points made by the contestant in all 3 rounds
and prints it out.
contestantRec[recNo].overallPts = contestantRec[recNo].totalPtsEarned1 +
contestantRec[recNo].totalPtsEarned2 + contestantRec[recNo].totalPtsEarned3;
// The following lines converts the contestant's points into cash.
contestantRec[recNo].cashEarned = (contestantRec[recNo].overallPts / 20) * 5;
// The following lines promts the user to state whether or not they would like to convert
cash in USD to TTD.
printf("Would you like to convert cash into TTD? Enter 'Y' for yes or 'N' for no: ");
scanf("%s",&response);
if (response == 'Y'){
contestantRec[recNo].cashEarnedTT = contestantRec[recnumber].cashEarned * 6.79660;
}else{
contestantRec[recNo].cashEarned;
}
recNo++;
system("pause");
system("cls");
}// _________________________________________________ end of add player
________________________________________________________
//###############################################################################################
################################
// start of view all
void viewALL () {
system("cls");
int x = 0;
printf("|----------------------------------------------------------------------------------
|n");
printf("| #####################/** RECORDS OF All CONTESTANTS!! **/#####################
|n");
printf("|----------------------------------------------------------------------------------
|nn");
for (x = 0; x < recNo; x++) {
29
printf("*** --------------- _CONTESTANT'S RECORD_ --------------- ***n");
printf(" _________________________________________________________ n");
printf(" |-----**Registeration Information of Contestant!!**-----|n");
printf(" |** Contestant's ID: %d
n",contestantRec[x].contestantID);
printf(" |** Contestant's First Name: %s
n",contestantRec[x].contestantFName);
printf(" |** Contestant's Last Name: %s
n",contestantRec[x].contestantLName);
printf(" |** Contestant's Month of Participation: %s
nn",contestantRec[x].monthOfParticipation);
printf(" |-----**NUMBER OF CORRECT ANSWERS AT EACH ROUND!!**-----|n");
printf(" |** Round 1 Correct Anwers: %d
n",contestantRec[x].noCorrectAns1);
printf(" |** Round 2 Correct Anwers: %d
n",contestantRec[x].noCorrectAns2);
printf(" |** Round 3 Correct Anwers: %d
nn",contestantRec[x].noCorrectAns3);
printf(" |--------**TOTAL POINTS EARNED AT EACH ROUND!!**--------|n");
printf(" |** Round 1 Points: %d
n",contestantRec[x].totalPtsEarned1);
printf(" |** Round 2 Points: %d
n",contestantRec[x].totalPtsEarned2);
printf(" |** Round 3 Points: %d
nn",contestantRec[x].totalPtsEarned3);
printf(" |*******************************************************n");
printf(" |** Overall Points: %d n",contestantRec[x].overallPts);
printf(" |** Cash Earned In USD: $%d n",contestantRec[x].cashEarned);
printf(" |** Cash Earned In TTD: $%f n",contestantRec[x].cashEarnedTT);
printf(" |*******************************************************|nn");
printf(" |------**QUALIFICATION STATUS FOR NEXT SESSION!!**------|n");
if (contestantRec[x].overallPts >= 110) {
printf(" |** Status: QUALIFIEDn");
}else{
printf(" |** Status: UNQUALIFIED!n");
printf(" |** ATLEAST 120 points is required to advance! **n");
}
printf(" |########~~~~~~~#######________#########~~~~~~~~~#######|nnn");
}
system("pause");
system("cls");
}//_____________________________________________ End of Display All
__________________________________________________________
30
//###############################################################################################
################################
// start of bubbleSort
void bubbleSort () {
system ("cls");
int i, j, flag = 1;
int temp_contestantID;
char temp_contestantFName[20], temp_contestantLName[20], temp_monthOfParticipation[3];
int temp_noCorrectAns1, temp_noCorrectAns2, temp_noCorrectAns3;
int temp_totalPtsEarned1, temp_totalPtsEarned2, temp_totalPtsEarned3, temp_overallPts;
int temp_cashEarned;
float temp_cashEarnedTT;
printf("================================/** SORTING RECORDS
**/===============================n");
printf("-------------------------------------------------------------------------------------
-n");
for (i = 1; (i <= recnumber) && flag; i++) {
flag = 0;
for (j = 0; (j < recnumber - 1); j++) {
//The following lines sorts the records in DECSENDING order.
if (contestantRec[j + 1].overallPts > contestantRec[j].overallPts) { //swap values
temp_contestantID = contestantRec[j].contestantID;
contestantRec[j].contestantID = contestantRec[j+1].contestantID;
contestantRec[j+1].contestantID = temp_contestantID;
strcpy(temp_contestantFName,contestantRec[j].contestantFName);
strcpy(contestantRec[j].contestantFName, contestantRec[j+1].contestantFName);
strcpy(contestantRec[j+1].contestantFName, temp_contestantFName);
strcpy(temp_contestantLName,contestantRec[j].contestantLName);
strcpy(contestantRec[j].contestantLName, contestantRec[j+1].contestantLName);
strcpy(contestantRec[j+1].contestantLName, temp_contestantLName);
strcpy(temp_monthOfParticipation,contestantRec[j].monthOfParticipation);
strcpy(contestantRec[j].monthOfParticipation,
contestantRec[j+1].monthOfParticipation);
strcpy(contestantRec[j+1].monthOfParticipation, temp_monthOfParticipation);
temp_noCorrectAns1 = contestantRec[j].noCorrectAns1;
contestantRec[j].noCorrectAns1 = contestantRec[j+1].noCorrectAns1;
contestantRec[j+1].noCorrectAns1 = temp_noCorrectAns1;
temp_noCorrectAns2 = contestantRec[j].noCorrectAns2;
contestantRec[j].noCorrectAns2 = contestantRec[j+1].noCorrectAns2;
contestantRec[j+1].noCorrectAns2 = temp_noCorrectAns2;
31
temp_noCorrectAns3 = contestantRec[j].noCorrectAns3;
contestantRec[j].noCorrectAns3 = contestantRec[j+1].noCorrectAns3;
contestantRec[j+1].noCorrectAns3 = temp_noCorrectAns3;
temp_totalPtsEarned1 = contestantRec[j].totalPtsEarned1;
contestantRec[j].totalPtsEarned1 = contestantRec[j+1].totalPtsEarned1;
contestantRec[j+1].totalPtsEarned1 = temp_totalPtsEarned1;
temp_totalPtsEarned2 = contestantRec[j].totalPtsEarned2;
contestantRec[j].totalPtsEarned2 = contestantRec[j+1].totalPtsEarned2;
contestantRec[j+1].totalPtsEarned2 = temp_totalPtsEarned2;
temp_totalPtsEarned3 = contestantRec[j].totalPtsEarned3;
contestantRec[j].totalPtsEarned3 = contestantRec[j+1].totalPtsEarned3;
contestantRec[j+1].totalPtsEarned3 = temp_totalPtsEarned3;
temp_overallPts = contestantRec[j].overallPts;
contestantRec[j].overallPts = contestantRec[j+1].overallPts;
contestantRec[j+1].overallPts = temp_overallPts;
temp_cashEarned = contestantRec[j].cashEarned;
contestantRec[j].cashEarned = contestantRec[j+1].cashEarned;
contestantRec[j+1].cashEarned = temp_cashEarned;
temp_cashEarnedTT = contestantRec[j].cashEarnedTT;
contestantRec[j].cashEarnedTT = contestantRec[j+1].cashEarnedTT;
contestantRec[j+1].cashEarnedTT = temp_cashEarnedTT;
flag = 1;
}
}
}
printf("nn ######/* Records Were Sorted Successfully!!! */##### nn");
system("pause");
return;
}// _________________________________________________ end of bubbleSort
________________________________________________________
32
//###############################################################################################
################################
// start of export
void exportData(){
system("cls");
FILE*outputfile;
printf("==================================== EXPORTING RECORDS
====================================n");
printf("-------------------------------------------------------------------------------------
------n");
outputfile = fopen("ExportedData.txt","w+");
//The following lines exports the contestants' information to an external file.
for (int x = 0; x < recNo; x++){
fprintf(outputfile,"%dn",contestantRec[x].contestantID);
fprintf(outputfile,"%sn",contestantRec[x].contestantFName);
fprintf(outputfile,"%sn",contestantRec[x].contestantLName);
fprintf(outputfile,"%sn",contestantRec[x].monthOfParticipation);
fprintf(outputfile,"%dn",contestantRec[x].noCorrectAns1);
fprintf(outputfile,"%dn",contestantRec[x].noCorrectAns2);
fprintf(outputfile,"%dn",contestantRec[x].noCorrectAns3);
fprintf(outputfile,"%dn",contestantRec[x].totalPtsEarned1);
fprintf(outputfile,"%dn",contestantRec[x].totalPtsEarned2);
fprintf(outputfile,"%dn",contestantRec[x].totalPtsEarned3);
fprintf(outputfile,"%dn",contestantRec[x].overallPts);
fprintf(outputfile,"%dn",contestantRec[x].cashEarned);
fprintf(outputfile,"%fn",contestantRec[x].cashEarnedTT);
}
printf("nn #####/* Exporting Completed!!! */##### nn");
fclose(outputfile);
system("pause") ;
system("cls");
}//______________________________________________ End of Export
_________________________________________________________________
33
//###############################################################################################
################################
// start of import
void importData(){
system("cls");
int x;
printf("=================================== IMPORTING RECORDS
===================================n");
printf("-------------------------------------------------------------------------------------
----n");
FILE*inputfile;
inputfile = fopen("ExportedData.txt","r");
//The following lines imports the contestants' information from an external file to the
program.
while (!feof(inputfile)){
fscanf(inputfile,"%d",&contestantRec[recNo].contestantID);
fscanf(inputfile,"%s",contestantRec[recNo].contestantFName);
fscanf(inputfile,"%s",contestantRec[recNo].contestantLName);
fscanf(inputfile,"%s",contestantRec[recNo].monthOfParticipation);
fscanf(inputfile,"%d",&contestantRec[recNo].noCorrectAns1);
fscanf(inputfile,"%d",&contestantRec[recNo].noCorrectAns2);
fscanf(inputfile,"%d",&contestantRec[recNo].noCorrectAns3);
fscanf(inputfile,"%d",&contestantRec[recNo].totalPtsEarned1);
fscanf(inputfile,"%d",&contestantRec[recNo].totalPtsEarned2);
fscanf(inputfile,"%d",&contestantRec[recNo].totalPtsEarned3);
fscanf(inputfile,"%d",&contestantRec[recNo].overallPts);
fscanf(inputfile,"%d",&contestantRec[recNo].cashEarned);
fscanf(inputfile,"%f",&contestantRec[recNo].cashEarnedTT);
recNo++;
}
recNo--;
printf("nn #####/* Importing Was Completed Successfully!!! /*##### nn");
fclose(inputfile);
system("pause") ;
system("cls") ;
}//________________________________________________ end of import
_______________________________________________________________
34
//###############################################################################################
################################
// start of welcome
void Intro_Screen() {
printf("| -----------------------------------------------------------------------------
-------------- |n");
printf("| **********------------**************-------------***************-------------
************** |n");
printf("| ================|||****/// ((_.-=-._.-=-._.-=-._.-=-))
///****|||================ |n");
printf("| ================|||****/// ))~~~~~~~~~~~~~~~~~~~~~~~((
///****|||================ |n");
printf("| ================|||****/// (( >WELCOME TO MY PROGRAM<
))///****|||================ |n");
printf("| ================|||****/// )).......................((
///****|||================ |n");
printf("| ================|||****/// ((`-._.-'`-._.-'`-._.-'`-)))
///****|||================ |n");
printf("| _ _
_ _ |n");
printf("| | | | _ _ _ _____ _____ _____ __ __ _____ _____ _____ _____
_____ _ _ _ | | | |n");
printf("| |_|_|| | | || | || _ ||_ _| | | || | || | | | | || | ||
|| | | ||_|_| |n");
printf("| | | | || || | | | |_ _|| | || | | -|| | | || |
|| | | | |n");
printf("| |_____||__|__||__|__| |_| |_| |_____||__|__|
|__|__||_|___||_____||_____| |n");
printf("|
__ __ __ |n");
printf("| _____ _ _ _ __ |
|| || | |n");
printf("| | | ___ ___ | |_ ___ ___ | |_ ___ ___ | |_ | | ___ ___ |
|| || | |n");
printf("| | --|| . || || _|| -_||_ -|| _|| .'|| || _| | |__ | . || .
||__||__||__| |n");
printf("| |_____||___||_|_||_| |___||___||_| |__,||_|_||_| |_____||___||_
||__||__||__| |n");
printf("| |___|
|n");
printf("| -----------------------------------------------------------------------------
-------------- |n");
printf("| **********------------**************-------------***************-------------
************** |n");
}// __________________________________________________ end of Welcome
___________________________________________________________
35
//###############################################################################################
################################
// start of mainmenu
int main (void) {
char choice;
do{
Intro_Screen();
printf("nn--------------------------------n");
printf("| MAIN MENU |n");
printf("--------------------------------n");
printf("| 1. Add New Contestant |n");
printf("| 2. View All Records REPORT |n");
printf("| 3. Sort Records |n");
printf("| 4. Export ALL Records |n");
printf("| 5. Import Data from file |n");
printf("| 6. Exit |n");
printf("--------------------------------nn");
scanf("%s",&choice);
switch (choice){
case '1':
addContestant();
break;
case '2':
viewALL();
break;
case '3':
bubbleSort();
break;
case '4':
exportData();
break;
case '5':
importData();
break;
case '6':
//exit();
break;
default:
printf("INVALID CHOICEn");
break;
}
}while (choice != '6');
}// ____________________________________________________ end of mainmenu
________________________________________________________
36
FILE DESIGN
Variable Name Data Types Length Description Sample
Data
contestantID int 4 Holds the ID of the
contestant
0401
contestantFName char 20 Holds the first name
of the contestant
James
contestantLName char 20 Holds the last name of
the contestant
Paul
monthOfParticipation char 3 Holds the month the
contestant participated
Apr
noCorrectAns1 int 4 Holds number of
questions answered
correctly in round 1
19
noCorrectAns2 int 4 Holds number of
questions answered
correctly in round 2
14
noCorrectAns3 int 4 Holds number of
questions answered
correctly in round 3
12
totalPtsEarned1 int 4 Holds the total points
contestant earned at
round 1
20
totalPtsEarned2 int 4 Holds the total points
contestant earned at
round 1
30
totalPtsEarned3 int 4 Holds the total points
contestant earned at
round 1
60
overallPts int 4 Holds the overall
points contestant has
110
cashEarned int 4 Holds the amount of
cash contestant earned
in USD
25
cashEarnedTT float 4 Holds the amount of
cash contestant earned
in TTD
169.91
37
WHITEBOX TESTING
Variable Name Data
Type
Length Test Test Data Results
Expected Actual
contestantID int 4 Normal 0401 Accepted Accepted
Extreme 9999 Accepted Accepted
Abnormal 123 Rejected Rejected
contestantFName character
string
20 Normal James Accepted Accepted
Extreme abcdefghijklmnopqrst Accepted Accepted
Abnormal abcdefghijklmnopqrstu Rejected Rejected
contestantLName character
string
20 Normal Paul Accepted Accepted
Extreme abcdefghijklmnopqrst Accepted Accepted
Abnormal abcdefghijklmnopqrstu Rejected Rejected
monthOfParticipation character
string
3 Normal Apr Accepted Accepted
Extreme abc Accepted Accepted
Abnormal abcd Rejected Rejected
noCorrectAns1 int 4 Normal 19 Accepted Accepted
Extreme 20 Accepted Accepted
Abnormal 21 Rejected Rejected
noCorrectAns2 int 4 Normal 14 Accepted Accepted
Extreme 24 Accepted Accepted
Abnormal 25 Rejected Rejected
noCorrectAns3 int 4 Normal 12 Accepted Accepted
Extreme 16 Accepted Accepted
Abnormal 17 Rejected Rejected
totalPtsEarned1 int 4 Normal
Extreme
Abnormal
totalPtsEarned2 int 4 Normal
Extreme
Abnormal
totalPtsEarned3 int 4 Normal
Extreme
Abnormal
overallPts int 4 Normal
Extreme
Abnormal
cashEarned int 4 Normal
Extreme
Abnormal
cashEarnedTT float 4 Normal
Extreme
Abnormal
38
RESULTS OF WHITEBOX TESTING
Normal Data Test – Accepted
Extreme Data Test – Accepted
39
Abnormal Data Test – Rejected
40
FUNCTIONAL TESTING
Add Contestant
Test 1: Adds a contestant to log, with user-defined criteria.
Display All
Test 2: Displays the currently stored records in the program.
41
Bubble Sort
Test 3: Sors the data in descending order via bubble sort.
Before:
After:
42
ExportData
Test 4: Copies the currently stored data from the program to a file on the computer.
Before:
After:
43
USER DOCUMENTATION
How to add a Contestant to the Log:
1. In the Main Menu, type the digit 1 and then enter.
2. Enter the contestant’s Contestant ID
3. Enter the contestant’s First Name
4. Enter the contestant’s Last Name
5. Enter the contestant’s Month of Participation
6. Enter the number of correct Round 1 answers
7. Enter the number of correct Round 2 answers
8. Enter the number of correct Round 3 answers
9. Enter if the cash earned by contestant is to be converted to TTD
10. Press any key to exit to the Main Menu
44
How to display all Contestant Records:
1. In the Main Menu, type the digit 2 and then enter
2. Press any key to exit to the Main Menu
How to sort the records:
1. After the necessary records are entered and stored, in the Main Menu type the digit 3 and
then enter.
2. Press any key to exit to the Main Menu
3. From the Main Menu, type the digit 2 and then enter to view the sorted records.
45
How to export the records:
1. In the Main Menu, type the digit 4 and then enter to export the records to an external file.
2. Check the file which contains the exported records for verification
3. Press any key to exit to the Main Menu
How to import the records:
1. In the Main Menu, type the digit 5 and then enter to import records to the program.

More Related Content

Similar to Laquando Young Comp. Sci.pdf

CIS 115 Inspiring Innovation/tutorialrank.com
 CIS 115 Inspiring Innovation/tutorialrank.com CIS 115 Inspiring Innovation/tutorialrank.com
CIS 115 Inspiring Innovation/tutorialrank.comjonhson110
 
CIS 115 Become Exceptional--cis115.com
CIS 115 Become Exceptional--cis115.comCIS 115 Become Exceptional--cis115.com
CIS 115 Become Exceptional--cis115.comclaric130
 
Cis 115 Extraordinary Success/newtonhelp.com
Cis 115 Extraordinary Success/newtonhelp.com  Cis 115 Extraordinary Success/newtonhelp.com
Cis 115 Extraordinary Success/newtonhelp.com amaranthbeg143
 
Bis 345-final-exam-guide-set-2-new
Bis 345-final-exam-guide-set-2-newBis 345-final-exam-guide-set-2-new
Bis 345-final-exam-guide-set-2-newassignmentcloud85
 
Devry cis 115 final exam 1
Devry cis 115 final exam 1Devry cis 115 final exam 1
Devry cis 115 final exam 1eyavagal
 
Devry cis 115 final exam 1
Devry cis 115 final exam 1Devry cis 115 final exam 1
Devry cis 115 final exam 1eyavagal
 
Devry cis 115 final exam 1
Devry cis 115 final exam 1Devry cis 115 final exam 1
Devry cis 115 final exam 1shamek1236
 
Devry cis 115 final exam 2
Devry cis 115 final exam 2Devry cis 115 final exam 2
Devry cis 115 final exam 2shamek1236
 
Devry cis 115 final exam 2
Devry cis 115 final exam 2Devry cis 115 final exam 2
Devry cis 115 final exam 2shyaminfo12
 
Devry cis 115 final exam 2
Devry cis 115 final exam 2Devry cis 115 final exam 2
Devry cis 115 final exam 2eyavagal
 
Devry cis 115 final exam 2
Devry cis 115 final exam 2Devry cis 115 final exam 2
Devry cis 115 final exam 2eyavagal
 
Sample Program file class 11.pdf
Sample Program file class 11.pdfSample Program file class 11.pdf
Sample Program file class 11.pdfYashMirge2
 
Bis 345-final-exam-guide-set-1-new
Bis 345-final-exam-guide-set-1-newBis 345-final-exam-guide-set-1-new
Bis 345-final-exam-guide-set-1-newassignmentcloud85
 
CIS 115 Achievement Education--cis115.com
CIS 115 Achievement Education--cis115.comCIS 115 Achievement Education--cis115.com
CIS 115 Achievement Education--cis115.comagathachristie170
 
CMS Project Phase II InstructionsIn this phase, you will create t.docx
CMS Project Phase II InstructionsIn this phase, you will create t.docxCMS Project Phase II InstructionsIn this phase, you will create t.docx
CMS Project Phase II InstructionsIn this phase, you will create t.docxmary772
 
Dax queries.pdf
Dax queries.pdfDax queries.pdf
Dax queries.pdfntrnbk
 
CIS 115 Education Counseling--cis115.com
CIS 115 Education Counseling--cis115.comCIS 115 Education Counseling--cis115.com
CIS 115 Education Counseling--cis115.comclaric59
 
CIS 115 Education in iCounseling ---cis115.com
CIS 115 Education in  iCounseling ---cis115.comCIS 115 Education in  iCounseling ---cis115.com
CIS 115 Education in iCounseling ---cis115.comclaric59
 

Similar to Laquando Young Comp. Sci.pdf (20)

CIS 115 Inspiring Innovation/tutorialrank.com
 CIS 115 Inspiring Innovation/tutorialrank.com CIS 115 Inspiring Innovation/tutorialrank.com
CIS 115 Inspiring Innovation/tutorialrank.com
 
CIS 115 Become Exceptional--cis115.com
CIS 115 Become Exceptional--cis115.comCIS 115 Become Exceptional--cis115.com
CIS 115 Become Exceptional--cis115.com
 
Cis 115 Extraordinary Success/newtonhelp.com
Cis 115 Extraordinary Success/newtonhelp.com  Cis 115 Extraordinary Success/newtonhelp.com
Cis 115 Extraordinary Success/newtonhelp.com
 
Bis 345-final-exam-guide-set-2-new
Bis 345-final-exam-guide-set-2-newBis 345-final-exam-guide-set-2-new
Bis 345-final-exam-guide-set-2-new
 
Devry cis 115 final exam 1
Devry cis 115 final exam 1Devry cis 115 final exam 1
Devry cis 115 final exam 1
 
Devry cis 115 final exam 1
Devry cis 115 final exam 1Devry cis 115 final exam 1
Devry cis 115 final exam 1
 
Devry cis 115 final exam 1
Devry cis 115 final exam 1Devry cis 115 final exam 1
Devry cis 115 final exam 1
 
Devry cis 115 final exam 2
Devry cis 115 final exam 2Devry cis 115 final exam 2
Devry cis 115 final exam 2
 
Devry cis 115 final exam 2
Devry cis 115 final exam 2Devry cis 115 final exam 2
Devry cis 115 final exam 2
 
Devry cis 115 final exam 2
Devry cis 115 final exam 2Devry cis 115 final exam 2
Devry cis 115 final exam 2
 
Devry cis 115 final exam 2
Devry cis 115 final exam 2Devry cis 115 final exam 2
Devry cis 115 final exam 2
 
Sample Program file class 11.pdf
Sample Program file class 11.pdfSample Program file class 11.pdf
Sample Program file class 11.pdf
 
Bis 345-final-exam-guide-set-1-new
Bis 345-final-exam-guide-set-1-newBis 345-final-exam-guide-set-1-new
Bis 345-final-exam-guide-set-1-new
 
C lab-programs
C lab-programsC lab-programs
C lab-programs
 
ADLAB.pdf
ADLAB.pdfADLAB.pdf
ADLAB.pdf
 
CIS 115 Achievement Education--cis115.com
CIS 115 Achievement Education--cis115.comCIS 115 Achievement Education--cis115.com
CIS 115 Achievement Education--cis115.com
 
CMS Project Phase II InstructionsIn this phase, you will create t.docx
CMS Project Phase II InstructionsIn this phase, you will create t.docxCMS Project Phase II InstructionsIn this phase, you will create t.docx
CMS Project Phase II InstructionsIn this phase, you will create t.docx
 
Dax queries.pdf
Dax queries.pdfDax queries.pdf
Dax queries.pdf
 
CIS 115 Education Counseling--cis115.com
CIS 115 Education Counseling--cis115.comCIS 115 Education Counseling--cis115.com
CIS 115 Education Counseling--cis115.com
 
CIS 115 Education in iCounseling ---cis115.com
CIS 115 Education in  iCounseling ---cis115.comCIS 115 Education in  iCounseling ---cis115.com
CIS 115 Education in iCounseling ---cis115.com
 

Recently uploaded

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 

Recently uploaded (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

Laquando Young Comp. Sci.pdf

  • 2. 1 Contents Pages Problem Statement 2 Functional Requirements 3 Non-Functional Requirements 4 Psuedocode 5-23 Technical Documentation 24 Program Code 25-35 File Design 36 Whitebox Testing 37 Results of Whitebox Testing 38-39 Functional Testing 40-43 User Documentation
  • 3. 2 PROBLEM STATEMENT A new Trinidad and Tobago game show called “What Yuh Know” recently started airing on the CNC 3 channel and has experienced difficulties keeping track of all contestants and their information who participated in the period of April to June on paper, manually writing up the number of questions answered correctly, calculating their equivalent points, converting the points into cash (USD) with the option to check the equivalent value (in TTD) and stating whether or not the contestant has moved on to the next session. This is mainly due to human error when writing down player information / records and miscalculations. At round one, every (4) questions answered correctly awards 5 points, at round two, every (4) questions answered correctly awards 10 points and at round three, every (4) questions answered correctly awards 20 points. At the end of the session, all the points awarded from the three rounds will be added. Furthermore, every 20 points the contestant has, is equivalent to a cash amount of USD $5.00 which can then be converted to TTD, using the formula (𝑥 * 6.79660). Finally, it will be decided if the contestant has qualified to enter the next session. At least 120 points are required to advance to the next session. In order to help this new game show, a program has been created to function as a database to easily keep track of its contestants for the months of April, May, June. The program has various tasks such as adding new contestants to the database, viewing all records (report), sorting the records, exporting the data to an external file, importing data from external file.
  • 4. 3 FUNCTIONAL REQUIREMENTS This new digital system requires certain function requirements to correct issues identified in the old system and increase its overall performance and efficiency. Adding a Contestant The new system must be able to add contestants and their respective information to the database. Such information recorded would include the contestant’s ID, both first and last name and the month they participated in. The system will also record the number of questions answered correctly for each round and calculate the number of points earned at each round as well as the overall number of points at the end of the three rounds. It calculates the cash earned via converting the points to USD and can also calculate its value in TTD (optional). Finally, this new system decides whether or not the contestant has advanced to the next session. Display All Records This system must be able to generate and present reports of each contestant’s relevant information from the database accurately. Sort All Records The system should be able to sort the records in the database in descending order. Exporting Records The new system should be able to export the reports from the database to an external file.
  • 5. 4
  • 6. 5 NON-FUNCTIONAL REQUIREMENTS Apart from functions that are absolutely necessary for the new system, some non-essential functions are also required as they improve the overall quality of the system. User-Friendly Interface This system must be user friendly to ensure a smooth transition from the old system. It must be designed so that any user can easily navigated the menu of the program. Data-Validation There must be some form of validation to all data entered into the system. This is to ensure that there is a minimum number of errors and incorrect data entered into the contestant log. Proper User-Prompts The appropriate messages should be displayed to the user at appropriate times to guide the user on what to input at the correct time.
  • 7. 6 PSUEDOCODE STRUCT member int contestantID char contestantFName[20], contestantLName[20], monthOfParticipation[3] int noCorrectAns1, noCorrectAns2, noCorrectAns3 int totalPtsEarned1, totalPtsEarned2, totalPtsEarned3, overallPts int cashEarned float cashEarnedTT DECLARE const int recnumber = 30 DECLARE member contestantRec[recnumber] DECLARE int recNo = 0 Narrative Description: This procedure allows the user to add a contestant’s record to the Log. FUNCTION addContestant () BEGIN DECLARE char response DECLARE int flag = 0 DECLARE int tempNum, tempNum1, tempNum2, tempNum3 = 0 DECLARE char tempVar[20] DECLARE char acceptable
  • 8. 7 OUTPUT ("| #################/** ADD NEW CONTESTANT **/#################### |") OUTPUT ("|----------------------------------------------------------------------------------------------|") acceptable = 'N' do begin OUTPUT ("Please Enter Contestant ID: ") READ (tempVar) if (strlen (tempVar) != 4) then acceptable = 'N' OUTPUT ("The contestant's ID consists of only (4) digits!”) else acceptable = 'Y' end if while (acceptable == 'N') contestantRec[recNo].contestantID = atoi(tempVar) acceptable = 'N' do begin OUTPUT ("Please Enter First Name: ") READ (tempVar) if (strlen (tempVar) > 20) then acceptable = 'N' OUTPUT ("First Name is Too Long! MUST be no longer than (20) characters!") else acceptable = 'Y’ end if while (acceptable == 'N') strcpy (contestantRec[recNo].contestantFName,tempVar)
  • 9. 8 acceptable = 'N' do begin OUTPUT ("Please Enter Last Name: ") READ (tempVar) if (strlen (tempVar) > 20) then acceptable = 'N' OUTPUT ("Last Name is Too Long! MUST be no longer than (20) characters!") else acceptable = 'Y' end if while (acceptable == 'N') strcpy (contestantRec[recNo].contestantLName,tempVar) acceptable = 'N' do begin OUTPUT ("Please Enter Month of Participation: ") READ (tempVar) if (strlen (tempVar) == 3) then acceptable = 'Y' else OUTPUT (“Please enter the first THREE letters of the Corresponding Month! end if while (acceptable == 'N') strcpy (contestantRec[recNo].monthOfParticipation,tempVar)
  • 10. 9 acceptable = 'N' do begin OUTPUT ("Please Enter Number of Correct Round 1 Answers: ") READ (tempNum1) if (tempNum1 > 20) then OUTPUT ("ERROR! There are only (20) Questions at the First Round!") else acceptable = 'Y' end if while (acceptable == 'N') contestantRec[recNo].noCorrectAns1 = tempNum1 acceptable = 'N' do begin OUTPUT ("Please Enter Number of Correct Round 2 Answers: ") READ (tempNum2) if (tempNum2 > 20) then OUTPUT ("ERROR! There are only (24) Questions at the First Round!") else acceptable = 'Y' end if while (acceptable == 'N') contestantRec[recNo].noCorrectAns2 = tempNum2
  • 11. 10 acceptable = 'N' do begin OUTPUT ("Please Enter Number of Correct Round 3 Answers: ") READ (tempNum3) if (tempNum3 > 20) then OUTPUT ("ERROR! There are only (16) Questions at the First Round!") else acceptable = 'Y' end if while (acceptable == 'N') contestantRec[recNo].noCorrectAns3 = tempNum3 contestantRec[recNo].totalPtsEarned1 = (contestantRec[recNo].noCorrectAns1 / 4) * 5 contestantRec[recNo].totalPtsEarned2 = (contestantRec[recNo].noCorrectAns2 / 4) *10 contestantRec[recNo].totalPtsEarned3 = (contestantRec[recNo].noCorrectAns3 / 4) *20 contestantRec[recNo].overallPts = contestantRec[recNo].totalPtsEarned1 + contestantRec[recNo].totalPtsEarned2 + contestantRec[recNo].totalPtsEarned3 OUTPUT ("OVERALL POINTS EARNED: ",contestantRec[recNo].overallPts) contestantRec[recNo].cashEarned = (contestantRec[recNo].overallPts / 20) * 5 OUTPUT ("CASH EARNED IN USD: USD $ ",contestantRec[recNo].cashEarned)
  • 12. 11 OUTPUT ("Would you like to convert cash into TTD? Enter 'Y' for yes or 'N' for no: ") READ (response) if (response == 'Y') then contestantRec[recnumber].cashEarnedTT = contestantRec[recNo].cashEarned * 6.79660 OUTPUT ("CASH EARNED IN TTD: TTD",contestantRec[recNo].cashEarnedTT); else OUTPUT ("CASH EARNED IN TTD: TTD N/A") end if OUTPUT ("**************************************************************") recNo ++ system ("pause") system ("cls") END add player
  • 13. 12 Narrative Description: This procedure allows the user to display All stored records. FUNCTION viewALL () BEGIN DECLARE int x = 0 OUTPUT(“|--------------------------------------------------------------------------------------------|”) OUTPUT ("| ###########/** RECORDS OF All CONTESTANTS!! **/########### |") OUTPUT ("|--------------------------------------------------------------------------------------------|") for (x = 0; x < recNo; x++) begin OUTPUT("*** --------------- _CONTESTANT'S RECORD_ --------------- ***") OUTPUT(" _________________________________________________________") OUTPUT(" |-----**Registeration Information of Contestant!!**-----|") OUTPUT(" |** Contestant's ID: ",contestantRec[x].contestantID) OUTPUT(" |** Contestant's First Name: ",contestantRec[x].contestantFName) OUTPUT(" |** Contestant's Last Name: ",contestantRec[x].contestantLName) OUTPUT(" |** Contestant's Month of Participation: ",contestantRec[x].monthOfParticipation) OUTPUT(" |-----**NUMBER OF CORRECT ANSWERS AT EACH ROUND!!**-----|") OUTPUT(" |** Round 1 Correct Anwers: ",contestantRec[x].noCorrectAns1) OUTPUT(" |** Round 2 Correct Anwers: ",contestantRec[x].noCorrectAns2) OUTPUT(" |** Round 3 Correct Anwers: ",contestantRec[x].noCorrectAns3)
  • 14. 13 OUTPUT(" |--------**TOTAL POINTS EARNED AT EACH ROUND!!**--------|") OUTPUT(" |** Round 1 Points: ",contestantRec[x].totalPtsEarned1) OUTPUT(" |** Round 2 Points: ",contestantRec[x].totalPtsEarned2) OUTPUT(" |** Round 3 Points: ",contestantRec[x].totalPtsEarned3) OUTPUT(" |*******************************************************") OUTPUT(" |** Overall Points: ",contestantRec[x].overallPts) OUTPUT(" |** Cash Earned In USD: $",contestantRec[x].cashEarned) OUTPUT(" |** Cash Earned In TTD: $",contestantRec[x].cashEarnedTT) OUTPUT(" |*******************************************************|") OUTPUT(" |------**QUALIFICATION STATUS FOR NEXT SESSION!!**------|") if (contestantRec[x].overallPts >= 110) then OUTPUT(" |** Status: QUALIFIED") else OUTPUT(" |** Status: UNQUALIFIED!") OUTPUT(" |** ATLEAST 120 points is required to advance! **") OUTPUT(" |########~~~~~~~#######________#########~~~~~~~~~#######|nnn") endif system("pause") system("cls") END display all
  • 15. 14 Narrative Description: This procedure sorts the recorded dada in descending order via the bubble sort method. FUNCTION bubbleSort () BEGIN DECLARE int i, j, flag = 1 int temp_contestantID char temp_contestantFName[20], temp_contestantLName[20], temp_monthOfParticipation[3] int temp_noCorrectAns1, temp_noCorrectAns2, temp_noCorrectAns3 int temp_totalPtsEarned1, temp_totalPtsEarned2, temp_totalPtsEarned3, temp_overallPts int temp_cashEarned float temp_cashEarnedTT OUTPUT ("==================/** SORTING RECORDS **/=================") OUTPUT ("------------------------------------------------------------------------------------------------") for (i = 1PRINT (i <= recNo) && flagPRINT i++) begin flag = 0PRINT for (j = 0PRINT (j < recNo - 1)PRINT j++) if (contestantRec[j + 1].overallPts > contestantRec[j].overallPts) strcpy(temp_contestantID,contestantRec[j].contestantID) strcpy(contestantRec[j].contestantID, contestantRec[j+1].contestantID) strcpy(contestantRec[j+1].contestantID, temp_contestantID)
  • 16. 15 strcpy (temp_contestantFName,contestantRec[j].contestantFName) strcpy (contestantRec[j].contestantFName, contestantRec[j+1].contestantFName) strcpy (contestantRec[j+1].contestantFName, temp_contestantFName) strcpy (temp_contestantLName,contestantRec[j].contestantLName) strcpy (contestantRec[j].contestantLName, contestantRec[j+1].contestantLName) strcpy (contestantRec[j+1].contestantLName, temp_contestantLName) temp_noCorrectAns1 = contestantRec[j]. noCorrectAns1 contestantRec[j].noCorrectAns1 = contestantRec[j+1]. noCorrectAns1 contestantRec[j+1]. noCorrectAns1 = temp_noCorrectAns1 temp_noCorrectAns2 = contestantRec[j]. noCorrectAns2 contestantRec[j].noCorrectAns2 = contestantRec[j+1]. noCorrectAns2 contestantRec[j+1]. noCorrectAns2 = temp_noCorrectAns2 temp_noCorrectAns3 = contestantRec[j]. noCorrectAns3 contestantRec[j].noCorrectAns3 = contestantRec[j+1]. noCorrectAns3 contestantRec[j+1]. noCorrectAns3 = temp_noCorrectAns3 temp_totalPtsEarned1 = contestantRec[j].totalPtsEarned1 contestantRec[j].totalPtsEarned1 = contestantRec[j+1].totalPtsEarned1 contestantRec[j+1].totalPtsEarned1 = temp_totalPtsEarned1 temp_totalPtsEarned2 = contestantRec[j].totalPtsEarned2 contestantRec[j].totalPtsEarned2 = contestantRec[j+1].totalPtsEarned2 contestantRec[j+1].totalPtsEarned2 = temp_totalPtsEarned2
  • 17. 16 temp_totalPtsEarned3 = contestantRec[j].totalPtsEarned3 contestantRec[j].totalPtsEarned3 = contestantRec[j+1].totalPtsEarned3 contestantRec[j+1].totalPtsEarned3 = temp_totalPtsEarned3 temp_overallPts = contestantRec[j].overallPts contestantRec[j].overallPts = contestantRec[j+1].overallPts contestantRec[j+1].overallPts = temp_overallPts temp_cashEarned = contestantRec[j].cashEarned contestantRec[j].cashEarned = contestantRec[j+1].cashEarned contestantRec[j+1].cashEarned = temp_cashEarned flag = 1 OUTPUT (" ######/* Records Sorted Successfully!!! */##### ") system ("pause") return END bubble Sort
  • 18. 17 Narrative Description; This procedure exports the currently stored data to a file. FUNCTION exportData() BEGIN system ("cls") FILE*outputfile OUTPUT ("=================== EXPORTING RECORDS ====================") OUTPUT ("---------------------------------------------------------------------------------------------------") outputfile = fopen ("Exported Data.txt","w+"
  • 19. 18 for (int x = 0 PRINT x < recNo PRINT x++) OUTPUT (outputfile," ",contestantRec[x].contestantID) OUTPUT (outputfile," ",contestantRec[x].contestantFName) OUTPUT (outputfile," ",contestantRec[x].contestantLName) OUTPUT (outputfile," ",contestantRec[x].monthOfParticipation) OUTPUT (outputfile," ",contestantRec[x].noCorrectAns1) OUTPUT (outputfile," ",contestantRec[x].noCorrectAns2) OUTPUT (outputfile," ",contestantRec[x].noCorrectAns3) OUTPUT (outputfile," ",contestantRec[x].totalPointsEarned1) OUTPUT (outputfile," ",contestantRec[x].totalPointsEarned2) OUTPUT (outputfile," ",contestantRec[x].totalPointsEarned3) OUTPUT (outputfile," ",contestantRec[x].overallPts) OUTPUT (outputfile," ",contestantRec[x].cashEarned) OUTPUT (outputfile," ",contestantRec[x].cashEarnedTT) OUTPUT (" #####/* Exporting Completed!!! */##### ") CLOSE (outputfile) system ("pause") system ("cls") END export
  • 20. 19 Narrative Description: This procedure imports data from a designated file on the system to be stored as the currently stored data. FUNCTION importData() BEGIN System ("cls") int x OUTPUT ("==================== IMPORTING RECORDS ===================") OUTPUT ("---------------------------------------------------------------------------------------------------") FILE * inputfile inputfile = fopen ("Exported Data.txt","r+")
  • 21. 20 while (feo (inputfile)) READ (inputfile," ",contestantRec[x].contestantID) PRINT READ (inputfile," ",contestantRec[x].contestantFName) PRINT READ (inputfile," ",contestantRec[x].contestantLName) PRINT READ (inputfile," ",contestantRec[x].monthOfParticipation) PRINT READ (inputfile," ",contestantRec[x].noCorrectAns1) PRINT READ (inputfile," ",contestantRec[x].noCorrectAns2) PRINT READ (inputfile," ",contestantRec[x].noCorrectAns3) PRINT READ (outputfile," ",contestantRec[x].totalPointsEarned1) PRINT READ (outputfile," ",contestantRec[x].totalPointsEarned2) PRINT READ (outputfile," ",contestantRec[x].totalPointsEarned3) PRINT READ (inputfile," ",contestantRec[x].overallPts) PRINT READ (inputfile,"$ ",contestantRec[x].cashEarned) PRINT READ (inputfile,"$ ",contestantRec[x].cashEarnedTT) PRINT recNo++ endif recNo— OUTPUT (" #####/* Importing Completed!!! /*##### ") CLOSE (inputfile) system ("pause") system ("cls") END import
  • 22. 21 Narrative Description: This procedure displays the intro animation at the start of the program. FUNTION Intro_Screen() BEGIN OUTPUT ("| --------------------------------------------------------------------------------------------- |") OUTPUT ("| *********---------***********----------************----------*********** |") OUTPUT ("| =========|||****/// ((_.-=-._.-=-._.-=-._.-=-)) ///****|||========== | ") OUTPUT ("| =========|||****/// ))~~~~~~~~~~~~~~~~(( ///****|||========== | ") OUTPUT ("| ====|||****/// (( >WELCOME TO MY PROGRAM< ))///****||===== | ") OUTPUT ("| ============|||****/// )).......................(( ///****|||============ | ") OUTPUT ("| ===========|||****/// ((`-._.-'`-._.-'`-._.-'`-))) ///****|||=========== | ") OUTPUT ("| _ _ _ _ | ") OUTPUT ("| | | | _ _ _ ____ ____ ____ __ __ ____ ____ ____ ____ ____ _ _ _ | | | | ") OUTPUT ("| |_|_|| | | || | || _ ||_ _| | | || | || | | | | || | || || | | ||_|_| | ") OUTPUT ("| | | | || || | | | |_ _|| | || | | -|| | | || | || | | | | ") OUTPUT ("| |_____||__|__||__|__| |_| |_| |____||__|__| |__|__||_|___||_____||_____| |") OUTPUT ("| __ __ __ | ") OUTPUT ("| _____ _ _ _ __ | || || | | ") OUTPUT ("| | | ___ ___ | |_ ___ ___ | |_ ___ ___ | |_ | | ___ ___ | || || | | ") OUTPUT ("| | --|| . || || _|| -_||_ -|| _|| .'|| || _| | |__ | . || . ||__||__||__| | ") OUTPUT ("| |_____||___||_|_||_| |___||___||_| |__,||_|_||_| |_____||___||_ ||__||__||__| | ") OUTPUT ("| |___| | ") OUTPUT ("| ------------------------------------------------------------------------------------------- | ") OUTPUT ("| ********----------************-----------************----------**********|") END Welcome
  • 23. 22 Narrative Description: This procedure manages the main menu of the program. int main (void) BEGIN char choice do Intro_Screen(); OUTPUT ("-----------------------------------------") OUTPUT (" | MAIN MENU | ") OUTPUT ("-----------------------------------------") OUTPUT ("| 1. Add New Contestant | ") OUTPUT ("| 2. View All Records REPORT | ") OUTPUT ("| 3. Sort Records | ") OUTPUT ("| 4. Export ALL Records | ") OUTPUT ("| 5. Import Data from file | ") OUTPUT ("| 6. Exit | ") OUTPUT ("-----------------------------------------") READ (" ",choice) switch (choice)
  • 24. 23 case '1' addContestant() break case '2' viewALL() break case '3' bubbleSort() break case '4': exportData() break case '5': importData() break case '6': exit() break default OUTPUT ("INVALID CHOICE") break while (choice != '6') END main
  • 25. 24 TECHNICAL DOCUMENTATION Author: Laquando Young System/Program: Game Show Calculator Date: 06/04/2022 Diagram ID: 2.1 Name: What Yuh Know INPUT 1: Registration Information 2: Correctly Answered Questions 3: Yes or No OUTPUT 1: Contestant’s ID, First Name, Last Name, Month Participated 2: Number of Questions Answered Correctly, Total Points Earned at Each Round, Overall Points Earned, Cash in USD 3: Cash Earned in TTD, Status (Advanced or Not) PROCESS 1: Stores Registration Information 2: Stores Correctly Answered Questions Calculates Total Points Earned at each Round as well as the Overall Points Converts Points to USD 3: Calculates the cash earned in TTD using the USD to TTD conversion method. Stores the contestant Status
  • 26. 25 PROGRAM CODE // This Program was written by Laquando Young. /* Purpose: This program keeps track of all contestants' records from a game show, calculating their equivalent points, converting the points to cash in USD with the option to check the equivalent value in TTD and stating whether or not the contestant moved on to the next session. */ // Date: 06/04/2022 #include <windows.h> #include <stdio.h> #include <iostream> #include <string> using namespace std; //############################################################################################### ################################ typedef struct { int contestantID; char contestantFName[20], contestantLName[20], monthOfParticipation[3]; int noCorrectAns1, noCorrectAns2, noCorrectAns3; int totalPtsEarned1, totalPtsEarned2, totalPtsEarned3, overallPts; int cashEarned; float cashEarnedTT; } member; const int recnumber = 30; member contestantRec[recnumber]; int recNo = 0; //#########################################################################@@@@@@@@@@@@@@@@@@@### ################################ // start of add player void addContestant () { char response; int flag = 0; int tempNum, tempNum1, tempNum2, tempNum3 = 0; char tempVar[20]; char acceptable; system("cls");
  • 27. 26 printf("| #########################/** ADD NEW CONTESTANT **/######################### |n"); printf("|-------------------------------------------------------------------------------- |n"); // The following lines promts the user to enter the Contestant's ID then prints it out. acceptable = 'N'; do{ printf("Please Enter the Contestant's ID: "); scanf ("%s",tempVar); if (strlen(tempVar) != 4){ acceptable = 'N'; printf("The contestant's ID consists of only (4) digits!n"); }else{ acceptable = 'Y'; } }while (acceptable == 'N'); contestantRec[recNo].contestantID = atoi(tempVar); // The following lines promts the user to enter the Contestant'a First Name then prints it out. acceptable = 'N'; do{ printf("Please Enter First Name: "); scanf ("%s",tempVar); if (strlen(tempVar) > 20){ acceptable = 'N'; printf("First Name is Too Long! MUST be no longer than (20) characters!n"); }else{ acceptable = 'Y'; } }while (acceptable == 'N'); strcpy (contestantRec[recNo].contestantFName,tempVar); // The following lines promts the user to enter the Contestant'a Last Name then prints it out. acceptable = 'N'; do{ printf("Please Enter Last Name: "); scanf ("%s",tempVar); if (strlen(tempVar) > 20){ acceptable = 'N'; printf("Last Name is Too Long! MUST be no longer than (20) characters!n"); }else{ acceptable = 'Y'; } }while (acceptable == 'N'); strcpy (contestantRec[recNo].contestantLName,tempVar);
  • 28. 27 // The following lines promts the user to enter the Month the Contestant participated in the game and prints it out. acceptable = 'N'; do{ printf("Please Enter Month of Participation: "); scanf ("%s",tempVar); if (strlen(tempVar) == 3){ acceptable = 'Y'; }else{ printf("Please Enter the first THREE letters of the Corresponding Month!n"); } }while (acceptable == 'N'); strcpy (contestantRec[recNo].monthOfParticipation,tempVar); /* The following lines promts the user to enter the Number of correct questions answered by the contestant in each round and prints it out. */ acceptable = 'N'; do{ printf("Please Enter Number of Correct Round 1 Answers: "); scanf ("%d",&tempNum1); if (tempNum1 > 20){ printf("ERROR! There are only (20) Questions at the First Round!n"); }else{ acceptable = 'Y'; } }while (acceptable == 'N'); contestantRec[recNo].noCorrectAns1 = tempNum1; acceptable = 'N'; do{ printf("Please Enter Number of Correct Round 2 Answers: "); scanf ("%d",&tempNum2); if (tempNum2 > 24){ printf("ERROR! There are only (24) Questions at the Second Round!n"); }else{ acceptable = 'Y'; } }while (acceptable == 'N'); contestantRec[recNo].noCorrectAns2 = tempNum2; acceptable = 'N'; do{ printf("Please Enter Number of Correct Round 3 Answers: "); scanf ("%d",&tempNum3); if (tempNum3 > 16){ printf("ERROR! There are only (16) Questions at the Third Round!n"); }else{ acceptable = 'Y'; } }while (acceptable == 'N'); contestantRec[recNo].noCorrectAns3 = tempNum3;
  • 29. 28 // The following lines calculates the total points a contestant makes in each round and prints it out. contestantRec[recNo].totalPtsEarned1 = (contestantRec[recNo].noCorrectAns1 / 4) * 5 ; contestantRec[recNo].totalPtsEarned2 = (contestantRec[recNo].noCorrectAns2 / 4) * 10; contestantRec[recNo].totalPtsEarned3 = (contestantRec[recNo].noCorrectAns3 / 4) * 20; // The following lines calculates the Overall Points made by the contestant in all 3 rounds and prints it out. contestantRec[recNo].overallPts = contestantRec[recNo].totalPtsEarned1 + contestantRec[recNo].totalPtsEarned2 + contestantRec[recNo].totalPtsEarned3; // The following lines converts the contestant's points into cash. contestantRec[recNo].cashEarned = (contestantRec[recNo].overallPts / 20) * 5; // The following lines promts the user to state whether or not they would like to convert cash in USD to TTD. printf("Would you like to convert cash into TTD? Enter 'Y' for yes or 'N' for no: "); scanf("%s",&response); if (response == 'Y'){ contestantRec[recNo].cashEarnedTT = contestantRec[recnumber].cashEarned * 6.79660; }else{ contestantRec[recNo].cashEarned; } recNo++; system("pause"); system("cls"); }// _________________________________________________ end of add player ________________________________________________________ //############################################################################################### ################################ // start of view all void viewALL () { system("cls"); int x = 0; printf("|---------------------------------------------------------------------------------- |n"); printf("| #####################/** RECORDS OF All CONTESTANTS!! **/##################### |n"); printf("|---------------------------------------------------------------------------------- |nn"); for (x = 0; x < recNo; x++) {
  • 30. 29 printf("*** --------------- _CONTESTANT'S RECORD_ --------------- ***n"); printf(" _________________________________________________________ n"); printf(" |-----**Registeration Information of Contestant!!**-----|n"); printf(" |** Contestant's ID: %d n",contestantRec[x].contestantID); printf(" |** Contestant's First Name: %s n",contestantRec[x].contestantFName); printf(" |** Contestant's Last Name: %s n",contestantRec[x].contestantLName); printf(" |** Contestant's Month of Participation: %s nn",contestantRec[x].monthOfParticipation); printf(" |-----**NUMBER OF CORRECT ANSWERS AT EACH ROUND!!**-----|n"); printf(" |** Round 1 Correct Anwers: %d n",contestantRec[x].noCorrectAns1); printf(" |** Round 2 Correct Anwers: %d n",contestantRec[x].noCorrectAns2); printf(" |** Round 3 Correct Anwers: %d nn",contestantRec[x].noCorrectAns3); printf(" |--------**TOTAL POINTS EARNED AT EACH ROUND!!**--------|n"); printf(" |** Round 1 Points: %d n",contestantRec[x].totalPtsEarned1); printf(" |** Round 2 Points: %d n",contestantRec[x].totalPtsEarned2); printf(" |** Round 3 Points: %d nn",contestantRec[x].totalPtsEarned3); printf(" |*******************************************************n"); printf(" |** Overall Points: %d n",contestantRec[x].overallPts); printf(" |** Cash Earned In USD: $%d n",contestantRec[x].cashEarned); printf(" |** Cash Earned In TTD: $%f n",contestantRec[x].cashEarnedTT); printf(" |*******************************************************|nn"); printf(" |------**QUALIFICATION STATUS FOR NEXT SESSION!!**------|n"); if (contestantRec[x].overallPts >= 110) { printf(" |** Status: QUALIFIEDn"); }else{ printf(" |** Status: UNQUALIFIED!n"); printf(" |** ATLEAST 120 points is required to advance! **n"); } printf(" |########~~~~~~~#######________#########~~~~~~~~~#######|nnn"); } system("pause"); system("cls"); }//_____________________________________________ End of Display All __________________________________________________________
  • 31. 30 //############################################################################################### ################################ // start of bubbleSort void bubbleSort () { system ("cls"); int i, j, flag = 1; int temp_contestantID; char temp_contestantFName[20], temp_contestantLName[20], temp_monthOfParticipation[3]; int temp_noCorrectAns1, temp_noCorrectAns2, temp_noCorrectAns3; int temp_totalPtsEarned1, temp_totalPtsEarned2, temp_totalPtsEarned3, temp_overallPts; int temp_cashEarned; float temp_cashEarnedTT; printf("================================/** SORTING RECORDS **/===============================n"); printf("------------------------------------------------------------------------------------- -n"); for (i = 1; (i <= recnumber) && flag; i++) { flag = 0; for (j = 0; (j < recnumber - 1); j++) { //The following lines sorts the records in DECSENDING order. if (contestantRec[j + 1].overallPts > contestantRec[j].overallPts) { //swap values temp_contestantID = contestantRec[j].contestantID; contestantRec[j].contestantID = contestantRec[j+1].contestantID; contestantRec[j+1].contestantID = temp_contestantID; strcpy(temp_contestantFName,contestantRec[j].contestantFName); strcpy(contestantRec[j].contestantFName, contestantRec[j+1].contestantFName); strcpy(contestantRec[j+1].contestantFName, temp_contestantFName); strcpy(temp_contestantLName,contestantRec[j].contestantLName); strcpy(contestantRec[j].contestantLName, contestantRec[j+1].contestantLName); strcpy(contestantRec[j+1].contestantLName, temp_contestantLName); strcpy(temp_monthOfParticipation,contestantRec[j].monthOfParticipation); strcpy(contestantRec[j].monthOfParticipation, contestantRec[j+1].monthOfParticipation); strcpy(contestantRec[j+1].monthOfParticipation, temp_monthOfParticipation); temp_noCorrectAns1 = contestantRec[j].noCorrectAns1; contestantRec[j].noCorrectAns1 = contestantRec[j+1].noCorrectAns1; contestantRec[j+1].noCorrectAns1 = temp_noCorrectAns1; temp_noCorrectAns2 = contestantRec[j].noCorrectAns2; contestantRec[j].noCorrectAns2 = contestantRec[j+1].noCorrectAns2; contestantRec[j+1].noCorrectAns2 = temp_noCorrectAns2;
  • 32. 31 temp_noCorrectAns3 = contestantRec[j].noCorrectAns3; contestantRec[j].noCorrectAns3 = contestantRec[j+1].noCorrectAns3; contestantRec[j+1].noCorrectAns3 = temp_noCorrectAns3; temp_totalPtsEarned1 = contestantRec[j].totalPtsEarned1; contestantRec[j].totalPtsEarned1 = contestantRec[j+1].totalPtsEarned1; contestantRec[j+1].totalPtsEarned1 = temp_totalPtsEarned1; temp_totalPtsEarned2 = contestantRec[j].totalPtsEarned2; contestantRec[j].totalPtsEarned2 = contestantRec[j+1].totalPtsEarned2; contestantRec[j+1].totalPtsEarned2 = temp_totalPtsEarned2; temp_totalPtsEarned3 = contestantRec[j].totalPtsEarned3; contestantRec[j].totalPtsEarned3 = contestantRec[j+1].totalPtsEarned3; contestantRec[j+1].totalPtsEarned3 = temp_totalPtsEarned3; temp_overallPts = contestantRec[j].overallPts; contestantRec[j].overallPts = contestantRec[j+1].overallPts; contestantRec[j+1].overallPts = temp_overallPts; temp_cashEarned = contestantRec[j].cashEarned; contestantRec[j].cashEarned = contestantRec[j+1].cashEarned; contestantRec[j+1].cashEarned = temp_cashEarned; temp_cashEarnedTT = contestantRec[j].cashEarnedTT; contestantRec[j].cashEarnedTT = contestantRec[j+1].cashEarnedTT; contestantRec[j+1].cashEarnedTT = temp_cashEarnedTT; flag = 1; } } } printf("nn ######/* Records Were Sorted Successfully!!! */##### nn"); system("pause"); return; }// _________________________________________________ end of bubbleSort ________________________________________________________
  • 33. 32 //############################################################################################### ################################ // start of export void exportData(){ system("cls"); FILE*outputfile; printf("==================================== EXPORTING RECORDS ====================================n"); printf("------------------------------------------------------------------------------------- ------n"); outputfile = fopen("ExportedData.txt","w+"); //The following lines exports the contestants' information to an external file. for (int x = 0; x < recNo; x++){ fprintf(outputfile,"%dn",contestantRec[x].contestantID); fprintf(outputfile,"%sn",contestantRec[x].contestantFName); fprintf(outputfile,"%sn",contestantRec[x].contestantLName); fprintf(outputfile,"%sn",contestantRec[x].monthOfParticipation); fprintf(outputfile,"%dn",contestantRec[x].noCorrectAns1); fprintf(outputfile,"%dn",contestantRec[x].noCorrectAns2); fprintf(outputfile,"%dn",contestantRec[x].noCorrectAns3); fprintf(outputfile,"%dn",contestantRec[x].totalPtsEarned1); fprintf(outputfile,"%dn",contestantRec[x].totalPtsEarned2); fprintf(outputfile,"%dn",contestantRec[x].totalPtsEarned3); fprintf(outputfile,"%dn",contestantRec[x].overallPts); fprintf(outputfile,"%dn",contestantRec[x].cashEarned); fprintf(outputfile,"%fn",contestantRec[x].cashEarnedTT); } printf("nn #####/* Exporting Completed!!! */##### nn"); fclose(outputfile); system("pause") ; system("cls"); }//______________________________________________ End of Export _________________________________________________________________
  • 34. 33 //############################################################################################### ################################ // start of import void importData(){ system("cls"); int x; printf("=================================== IMPORTING RECORDS ===================================n"); printf("------------------------------------------------------------------------------------- ----n"); FILE*inputfile; inputfile = fopen("ExportedData.txt","r"); //The following lines imports the contestants' information from an external file to the program. while (!feof(inputfile)){ fscanf(inputfile,"%d",&contestantRec[recNo].contestantID); fscanf(inputfile,"%s",contestantRec[recNo].contestantFName); fscanf(inputfile,"%s",contestantRec[recNo].contestantLName); fscanf(inputfile,"%s",contestantRec[recNo].monthOfParticipation); fscanf(inputfile,"%d",&contestantRec[recNo].noCorrectAns1); fscanf(inputfile,"%d",&contestantRec[recNo].noCorrectAns2); fscanf(inputfile,"%d",&contestantRec[recNo].noCorrectAns3); fscanf(inputfile,"%d",&contestantRec[recNo].totalPtsEarned1); fscanf(inputfile,"%d",&contestantRec[recNo].totalPtsEarned2); fscanf(inputfile,"%d",&contestantRec[recNo].totalPtsEarned3); fscanf(inputfile,"%d",&contestantRec[recNo].overallPts); fscanf(inputfile,"%d",&contestantRec[recNo].cashEarned); fscanf(inputfile,"%f",&contestantRec[recNo].cashEarnedTT); recNo++; } recNo--; printf("nn #####/* Importing Was Completed Successfully!!! /*##### nn"); fclose(inputfile); system("pause") ; system("cls") ; }//________________________________________________ end of import _______________________________________________________________
  • 35. 34 //############################################################################################### ################################ // start of welcome void Intro_Screen() { printf("| ----------------------------------------------------------------------------- -------------- |n"); printf("| **********------------**************-------------***************------------- ************** |n"); printf("| ================|||****/// ((_.-=-._.-=-._.-=-._.-=-)) ///****|||================ |n"); printf("| ================|||****/// ))~~~~~~~~~~~~~~~~~~~~~~~(( ///****|||================ |n"); printf("| ================|||****/// (( >WELCOME TO MY PROGRAM< ))///****|||================ |n"); printf("| ================|||****/// )).......................(( ///****|||================ |n"); printf("| ================|||****/// ((`-._.-'`-._.-'`-._.-'`-))) ///****|||================ |n"); printf("| _ _ _ _ |n"); printf("| | | | _ _ _ _____ _____ _____ __ __ _____ _____ _____ _____ _____ _ _ _ | | | |n"); printf("| |_|_|| | | || | || _ ||_ _| | | || | || | | | | || | || || | | ||_|_| |n"); printf("| | | | || || | | | |_ _|| | || | | -|| | | || | || | | | |n"); printf("| |_____||__|__||__|__| |_| |_| |_____||__|__| |__|__||_|___||_____||_____| |n"); printf("| __ __ __ |n"); printf("| _____ _ _ _ __ | || || | |n"); printf("| | | ___ ___ | |_ ___ ___ | |_ ___ ___ | |_ | | ___ ___ | || || | |n"); printf("| | --|| . || || _|| -_||_ -|| _|| .'|| || _| | |__ | . || . ||__||__||__| |n"); printf("| |_____||___||_|_||_| |___||___||_| |__,||_|_||_| |_____||___||_ ||__||__||__| |n"); printf("| |___| |n"); printf("| ----------------------------------------------------------------------------- -------------- |n"); printf("| **********------------**************-------------***************------------- ************** |n"); }// __________________________________________________ end of Welcome ___________________________________________________________
  • 36. 35 //############################################################################################### ################################ // start of mainmenu int main (void) { char choice; do{ Intro_Screen(); printf("nn--------------------------------n"); printf("| MAIN MENU |n"); printf("--------------------------------n"); printf("| 1. Add New Contestant |n"); printf("| 2. View All Records REPORT |n"); printf("| 3. Sort Records |n"); printf("| 4. Export ALL Records |n"); printf("| 5. Import Data from file |n"); printf("| 6. Exit |n"); printf("--------------------------------nn"); scanf("%s",&choice); switch (choice){ case '1': addContestant(); break; case '2': viewALL(); break; case '3': bubbleSort(); break; case '4': exportData(); break; case '5': importData(); break; case '6': //exit(); break; default: printf("INVALID CHOICEn"); break; } }while (choice != '6'); }// ____________________________________________________ end of mainmenu ________________________________________________________
  • 37. 36 FILE DESIGN Variable Name Data Types Length Description Sample Data contestantID int 4 Holds the ID of the contestant 0401 contestantFName char 20 Holds the first name of the contestant James contestantLName char 20 Holds the last name of the contestant Paul monthOfParticipation char 3 Holds the month the contestant participated Apr noCorrectAns1 int 4 Holds number of questions answered correctly in round 1 19 noCorrectAns2 int 4 Holds number of questions answered correctly in round 2 14 noCorrectAns3 int 4 Holds number of questions answered correctly in round 3 12 totalPtsEarned1 int 4 Holds the total points contestant earned at round 1 20 totalPtsEarned2 int 4 Holds the total points contestant earned at round 1 30 totalPtsEarned3 int 4 Holds the total points contestant earned at round 1 60 overallPts int 4 Holds the overall points contestant has 110 cashEarned int 4 Holds the amount of cash contestant earned in USD 25 cashEarnedTT float 4 Holds the amount of cash contestant earned in TTD 169.91
  • 38. 37 WHITEBOX TESTING Variable Name Data Type Length Test Test Data Results Expected Actual contestantID int 4 Normal 0401 Accepted Accepted Extreme 9999 Accepted Accepted Abnormal 123 Rejected Rejected contestantFName character string 20 Normal James Accepted Accepted Extreme abcdefghijklmnopqrst Accepted Accepted Abnormal abcdefghijklmnopqrstu Rejected Rejected contestantLName character string 20 Normal Paul Accepted Accepted Extreme abcdefghijklmnopqrst Accepted Accepted Abnormal abcdefghijklmnopqrstu Rejected Rejected monthOfParticipation character string 3 Normal Apr Accepted Accepted Extreme abc Accepted Accepted Abnormal abcd Rejected Rejected noCorrectAns1 int 4 Normal 19 Accepted Accepted Extreme 20 Accepted Accepted Abnormal 21 Rejected Rejected noCorrectAns2 int 4 Normal 14 Accepted Accepted Extreme 24 Accepted Accepted Abnormal 25 Rejected Rejected noCorrectAns3 int 4 Normal 12 Accepted Accepted Extreme 16 Accepted Accepted Abnormal 17 Rejected Rejected totalPtsEarned1 int 4 Normal Extreme Abnormal totalPtsEarned2 int 4 Normal Extreme Abnormal totalPtsEarned3 int 4 Normal Extreme Abnormal overallPts int 4 Normal Extreme Abnormal cashEarned int 4 Normal Extreme Abnormal cashEarnedTT float 4 Normal Extreme Abnormal
  • 39. 38 RESULTS OF WHITEBOX TESTING Normal Data Test – Accepted Extreme Data Test – Accepted
  • 40. 39 Abnormal Data Test – Rejected
  • 41. 40 FUNCTIONAL TESTING Add Contestant Test 1: Adds a contestant to log, with user-defined criteria. Display All Test 2: Displays the currently stored records in the program.
  • 42. 41 Bubble Sort Test 3: Sors the data in descending order via bubble sort. Before: After:
  • 43. 42 ExportData Test 4: Copies the currently stored data from the program to a file on the computer. Before: After:
  • 44. 43 USER DOCUMENTATION How to add a Contestant to the Log: 1. In the Main Menu, type the digit 1 and then enter. 2. Enter the contestant’s Contestant ID 3. Enter the contestant’s First Name 4. Enter the contestant’s Last Name 5. Enter the contestant’s Month of Participation 6. Enter the number of correct Round 1 answers 7. Enter the number of correct Round 2 answers 8. Enter the number of correct Round 3 answers 9. Enter if the cash earned by contestant is to be converted to TTD 10. Press any key to exit to the Main Menu
  • 45. 44 How to display all Contestant Records: 1. In the Main Menu, type the digit 2 and then enter 2. Press any key to exit to the Main Menu How to sort the records: 1. After the necessary records are entered and stored, in the Main Menu type the digit 3 and then enter. 2. Press any key to exit to the Main Menu 3. From the Main Menu, type the digit 2 and then enter to view the sorted records.
  • 46. 45 How to export the records: 1. In the Main Menu, type the digit 4 and then enter to export the records to an external file. 2. Check the file which contains the exported records for verification 3. Press any key to exit to the Main Menu How to import the records: 1. In the Main Menu, type the digit 5 and then enter to import records to the program.