Gavin Samuels Final 2012

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 41

CAPE

Internal Assessment
Phases 01, 02, 03 & 04

Name: Gavin Samuels


Subject: Computer Science
Teacher: Mr. R. Anderson
Center Number:100052
Registration Number:
Year: 2012
School: Jamaica College

Table of Contents
Contents
Description of the Problem

Page
1

Proposed Solution

Selected Solution

Features Detail

Algorithm Pseudo Code


Menulist
InitializeArray
Main
TotalsInput
MachineryInput
GenerateReport
DisplayLoaned Items
WriteToFile

3-8
3
3
4
5
6
7
8
8

Programming
Function Prototypes
Main
Menulist
TotalsInput
MachineryInput
GenerateReport
DisplayLoanedItems
Initialize_Array
Write_To_File

9-16
9
9
10
11
13
13
14
15
15

Test Plan

17-39

Page |1

Description of Problem [Phase 01]


In this modern day and age there is always a need for increased productivity. For that reason,
most Governments impose certain laws on major Economic Institutions causing them to provide
funds to entrepreneurs so as to facilitate growth in all sectors. Most persons will have the idea
and because of these laws will get the basic capital needed to start their business. But, what
about the skills required for financial reporting? By now, most if not all money lending
institutions will require a follow up report to be produced. Most entrepreneurs just starting out
will not have the basic accounting skills required to prepare the required statements.

Proposed Solutions
For my project, my proposed solutions are as follows;
1.

Purchase the appropriate accounting books and hire an Accountant to hand-write all the
financial information extracted from the Source Documents of the business then transfer
this information into the appropriate Final Accounts.

2.

To hire a Computer Programmer to create an accounting software that will meet all of his
needs.

Selected Solution
The second suggested solution was chosen as being the better of the two because the results
displayed will be more accurate, since the possibility of an internal error is null and they will be
delivered faster. When the software solution is implemented, this will be a onetime cost as
opposed to hiring an accountant and paying them monthly. Additionally, this is a more ecofriendly approach.
The following will be done;
To develop a software solution that will accept the raw financial data daily then at the end of the
month compile and display a report showing the appropriate Accounting data in a suitable form.
It will collate and display the Trial Balance, Trading and Profit or Loss Account, the Balance
Sheet then calculate the appropriate financial ratios and percentages.

Page |2

Features Detail [Phase 02]


1.

Totals input
This will accept the daily figures from the books. The figures that will be accepted
for the Trading & Profit/Loss account are the totals for; sales, sales return,
purchases, purchases return, opening stock, closing stock, commissions received,
interest received, depreciation, travel expenses, carriage inwards, carriage
outwards, sundry expenses, office expenses, rent, insurance, advertisement,
stationary and utility charges.
The figures that will be accepted for the Balance sheet are; property, motor
vehicles, equipment, fixtures and fittings, ICT equipment, bank accounts, debtors,
creditors, cash in hand and loans.

2.

Machinery Input
If there are machinery or equipments that have been loaned, the user will be able to
input the information on it into the program for future reference.

3.

Generate Report
This will collate a Trial Balance which will display the totals under Debit and
Credit headings, The type of balance the account has will be determined by the
accountant working with the software engineer.

4.

Display Loaned Items


This function will allow the users the option of displaying the items stored in the
database

Page |3

Algorithm Pseudo code [Phase 03]


Module Name: Menulist
Module Description: Shows the list of menu options and accepts a choice
INPUT: choice
PROCESS:
START
PRINT (1) Enter Daily Totals
PRINT (2) Enter machinery / equipment that has been loaned
PRINT (3) Generate Weekly Report
PRINT (4) Display Loaned items
PRINT (0) Exit
PRINT Please Enter an Option
READ choice
STOP
OUTPUT: choice

Module Name: Initialize Array


Module Description: Generates the updated trial balance and monthly final accounts
INPUT: Office, pos
PROCESS:
START
CREATE STRUCTURE machine (name, s_number, amount, loaner)
CREATE ARRAY mach_array[] OF machine
IF (pntr!=NULL) THEN
WHILE(!FEOF(PNTR)) DO
READ mach_array[] FROM array.dat
Pos=pos+1
ENDWHILE
ELSE
PRINT ERROR!! File could not be opened
ENDIF
STOP
OUTPUT: None

Page |4
Module Name: Main [Navigate Options]
Module Description: Carries out the selected module for the matching option
INPUT: None
PROCESS:
START
CREATE Machine array named Office
initialize_array()
menulist(option)
WHILE (option<6) AND (option>0) DO
IF option=1 THEN
TotalsInput()
ENDIF
IF option=2 THEN
PRINTHow many machines/equipments are to be added:
READ h
FOR lcv0 to h
MachineryInput()
STEP 1
ENDFOR
Write_to_file()
ENDIF
IF option=3 THEN
GenerateReport()
ENFIF
IF option=4 THEN
DisplayLoanedItems()
ENDIF
IF option=5 THEN
WritetoFile()
PRINTThe information has been written to a file
ENDIF
menulist(option)
ENDWHILE
PRINTDone
Wait 1 sec
PRINTBy
Wait 1 sec
PRINTGavin A Samuels
STOP
OUTPUT:none

Page |5
Module Name: Totals Input
Module Description: Accepts the daily totals
INPUT: none
PROCESS:
START
PRINT Good Day Get ready to enter the daily totals
Wait 1 sec
PRINT Please enter the total cash amount
READ cash
PRINT Please enter the total bank balance
READ bank
PRINT Please enter the total Sales value
READ sales
PRINT Please enter the total Sales Return value
READ salesret
PRINT Please enter the total purchases value
READ purch
PRINT Please enter the total Purchases Returns value
READ purchret
PRINT Please enter the Opening Stock value
READ opstock
PRINT Please enter the final Trade Debtors Value
READ t_debtor
PRINT Please enter the final Trade Creditors Value
READ t_creditor
PRINT Are there any other Creditors?
PRINT Enter (1) for yes
READ creditorchoice
IF(creditorchoice=1)THEN
PRINT Please enter the Other Trade Creditors Value
READ other_creditor
ELSE
other_creditor 0
ENDIF
PRINT Are there any other Debtors?
PRINT Enter (1) for yes
READ debtorchoice
IF(debtorchoice=1)THEN
PRINT Please enter the Other Trade Debtor Value
READ other_debtor
ELSE
other_debtor 0
ENDIF
PRINT Please enter the Closing Stock value
READ clstock
PRINT Please enter the Travel Expenses value
READ trav_exp
PRINT Please enter the Carriage Inwards value
READ carin
PRINT Please enter the Carriage Outwards value
READ carout
PRINT Please enter the Capital Invested Amount
READ capital
PRINT Please enter the total Rent paid

Page |6
READ rent
PRINT Please enter the Total Stationary purchased
READ station
PRINT Please enter the Total Salaries & Wages value
READ sal_wage
PRINT Please enter the Electricity Bill
READ elec
PRINT Please enter the Water Bill
READ water
PRINT Please enter the Telephone Bill
READ telephone
PRINT Please enter the Total remaining value of the Motor Van
READ motor_van
PRINT Please enter the Total value of ICT Equipment
READ ict_equip
PRINT Please enter the Total value of Discount Allowed
READ dis_allow
WRITE t_debtor, other_creditor, purch, bank, cash, rent, carin, carout, opstock, station, travel_exp,
sal_wag, elec, water, telephone, dis_allow, motor_van, ict_equip, salesret, purchret, t_creditor,
other_creditor, sales, capital TO accounts.dat
STOP
OUTPUT:None

Module Name: Machinery Input


Module Description: Deletes the old information; older than one year
INPUT: Office, a
PROCESS:
START
CREATE Machine Array named enter
PRINT Enter the machine/equipments name
READ enter name
PRINT Enter the machine/equipments serial number
READ enter s_number
PRINT Enter the Machines Value
READ enter amount
PRINT Enter the Person you loaned the machine/equipment
READ enter loaner
a= a+1
STOP
OUTPUT: None

Page |7
Module Name: Generate Report
Module Description: Generates and Displays an overview of the weekly events as a trial balance
INPUT:
PROCESS:
START
GET t_debtor, other_creditor, purch, bank, cash, rent, carin, carout, opstock, station, travel_exp, sal_wag,
elec, water, telephone, dis_allow, motor_van, ict_equip, salesret, purchret, t_creditor, other_creditor,
sales, capital FROM accounts.dat
totaldebit t_debtor+other_creditor+purch+bank+cash+rent+carin+carout+opstock+
station+travel_exp+sal_wag+elec+water+telephone+dis_allow+motor_van+ict_equip+ salesret+purchret
totalcredit t_creditor+other_creditor+sales+capital
PRINT
Trial Balance for this Period
PRINT________________________________________________
PRINT
Accounts
|
Debit
|
Credit

PRINT-----------------------------------------------------------------------
PRINT Trade Debtors
|
t_debtor
|
PRINT Trade Creditors
|
| t_creditor

PRINT Other Creditors


|
| other_creditor
PRINT Other Debtors
| other_creditor |
PRINT Sales
|
| sales
PRINT Purchases
| purch
|
PRINT Capital
|
| capital
PRINT Bank
| bank
|
PRINT Cash
|
cash
|
PRINT Rent
| rent
|
PRINT Carriage Inwards
|
carin
|
PRINT Carriage Outwards
|
carout
|
PRINT Opening Stock
| opstock
|
PRINT Stationery
|
station
|
PRINT Travelling Expenses |
trav_exp
|
PRINT Salaries & Wages
|
sal_wag
|
PRINT Electricity
|
elec
|
PRINT Water
|
water
|
PRINT Telephone
| telephone
|
PRINT Discount Allowed
| dis_allow
|
PRINT Motor Van
| motor_van
|
PRINT ICT Equipment
| ict_equip
|
PRINT Sales Return
|
salesret
|
PRINT Purchases Return
|
purchret
|
PRINT----------------------------------------------------------------------------------
PRINT
TOTALS
| totaldebtor
| totalcreditor
STOP
OUTPUT: None

Page |8
Module Name: Display Loaned Items
Module Description: This function displays the items the user has loaned
INPUT: Office, pos
PROCESS:
START
CREATE a Machine named gav
FOR lcv0 to pos
PRINTgav.name, gav.s_number, gav.amount, gav.loaner
ENDFOR
STOP
OUTPUT: None
Module Name: Write To File
Module Description: This function displays writes the information in the array to a file
INPUT: Office, p
PROCESS:
START
CREATE a Machine named abc
FOR lcv 1 to p
WRITE Machine to array.dat
ENDFOR
STOP
OUTPUT: None

9|P ag e
/*

Name: Gavin Antonio Samuels


Center Number:100058
Registration Number:
Date Of Birth: October 7th 1994
Subject: Computer Science
Territory: Jamaica
Lecturer: Mr. R. Anderson
School: Jamaica College*/

/*Header Files*/
#include <stdio.h>
#include <conio.h>
#include <dos.h>
//setting up constants
#define namesize 30
#define ssize 10
#define size 30
typedef struct machine{//declaring a structure
char name[namesize]; //name of the equipment
char s_number[ssize];//serial number, somtimes mae up of letters
float amount;//price of the item
char loaner[namesize];//the name of the person or company it has been loaned from
}Machine;//setting an alias for the structure
/*Function Prototypes*/
void menulist(int *);//this will accept the choice from the user
void initialize_array(Machine[], int *);//this will setup the array at the beginning of the program
void totalsinput(void);//this accepts the daily totals from the user
void machineryinput(Machine *,int *);//this accepts the machiney the user has loaned
void write_to_file(Machine[], int);//this writes the loaned items to a file
void displayloaneditems(Machine[], int);//this shows the user what is inside the array/file
void generatereport(void);//this displays to the user the totals of the account in a standerdized way

int main(){//start of main


Machine Office[size];//creating a structure called Office

10 | P a g e
int option, mpos=0,lcv, h;//declaring the integers
initialize_array(Office, &mpos);//calling a function
menulist(&option);//calling a function
while((option<6) && (option>0)){//starts while loop
clrscr();
if (option==1) {//checks the value of option
totalsinput();//calling a function
getche();
}//ends if statement
if (option==2) {//starts if statement
printf("\n\n\tHow many machines/equipments are to be added:");//prompts message to user
scanf("%d",&h);
for(lcv = 0; lcv < h; lcv++){//starts for loop
machineryinput(&Office[mpos],&mpos);//calling a function
}//ends for loop
}//ends if statement
if (option==3) {//starts if statement
generatereport();//calling a function
getche();
}//ends if statement
if (option==4){//starts if statement
displayloaneditems(Office,mpos);//calling a function
getche();
}//ends if statement
if(option==5){//starts if statement
write_to_file(Office, mpos);
printf("The information has been written to a file");
getche();
}
clrscr();
menulist(&option);//calling a function
}//ends while loop
printf("\ nDone ");
sleep(1);
printf("by ");
sleep(1);
printf("Gavin A Samuels");
return 0;//returns the integer 0

11 | P a g e
}//ends main function
void menulist(int *choice){//begins the menulist function
printf("\n\t(1) Enter Daily Totals");
printf("\n\t(2) Enter machinery / equipment that has been loaned");
printf("\n\t(3) Generate Report");
printf("\n\t(4) Display Loaned Items");
printf("\n\t(5) Write information about Machinery/Equipment to a file");
printf("\n\t(0) Exit");//prompts a message to the user
printf("\n\t\tChoose Option:");//asks the user to enter an option
scanf("%d",choice);//accepts an integer and stores it in num
}// ends the menulist function
void totalsinput(){
FILE *ftr; //create file pointer
float t_debtor,other_debtor,purch,bank,cash,rent,carin,carout,opstock;
float station,elec,water,telephone,dis_allow,motor_van;
float ict_equip,salesret,purchret,t_creditor,other_creditor,sales,capital;
float clstock, trav_exp, sal_wage;
int creditorchoice,debtorchoice;
printf("\nGood Day Get ready to enter the daily totals ");//prompts message to user
sleep(2);//pauses for some time
printf("\nPlease enter the total cash amount ");//prompts message to user
scanf("%f",&cash);//accepts a float from the user
printf("\nPlease enter the total bank balance ");//prompts message to user
scanf("%f",&bank);//accepts a float from the user
printf("\nPlease enter the total Sales value ");//prompts message to user
scanf("%f",&sales);//accepts a float from the user
printf("\nPlease enter the total Sales Return value ");//prompts message to user
scanf("%f",&salesret);//accepts a float from the user
printf("\nPlease enter the total purchases value ");//prompts message to user
scanf("%f",&purch);//accepts a float from the user
printf("\n Please enter the total Purchases Returns value ");//prompts message to user
scanf("%f",&purchret);//accepts a float from the user
printf(" \nPlease enter the Opening Stock value ");//prompts message to user
scanf("%f",&opstock);//accepts a float from the user

12 | P a g e
printf(" \nPlease enter the final Trade Debtors Value ");//prompts message to user
scanf("%f",&t_debtor);//accepts a float from the user
printf(" \nPlease enter the final Trade Creditors Value ");//prompts message to user
scanf("%f",&t_creditor);//accepts a float from the user
printf("\n Are there any other Creditors? ");//prompts message to user
printf("\n Enter (1) for yes ");//prompts message to user
scanf("%d",&creditorchoice);//accepts a float from the user
if(creditorchoice==1){//start of true section of the if statement
printf("\nPlease enter the Other Trade Creditors Value ");//prompts message to user
scanf("%f",&other_creditor);//accepts a float from the user
}else{//start of false section of the if statement
other_creditor=0;//setting this float to 0
}//sets the float to zero
printf("\nAre there any other Debtors?");//prompts message to user
printf("\nEnter (1) for yes ");//prompts message to user
scanf("%d",&debtorchoice);//accepts a float from the user
if(debtorchoice==1){//start of true section of the if statement
printf("\nPlease enter the Other Trade Debtor Value ");//prompts message to user
scanf("%f",&other_debtor);//accepts a float from the user
}else{//start of false section of the if statement
other_debtor=0;//sets the float to zero
}//end of if statement
printf(" \nPlease enter the Closing Stock value ");//prompts message to user
scanf("%f", &clstock);//accepts a float from the user
printf(" \nPlease enter the Travel Expenses value ");//prompts message to user
scanf("%f", &trav_exp);//accepts a float from the user
printf(" \nPlease enter the Carriage Inwards value ");//prompts message to user
scanf("%f", &carin);//accepts a float from the user
printf("\n Please enter the Carriage Outwards value ");//prompts message to user
scanf("%f", &carout);//accepts a float from the user
printf("\n Please enter the Capital Invested Amount ");//prompts message to user
scanf("%f", &capital);//accepts a float from the user
printf(" \nPlease enter the total Rent paid ");//prompts message to user
scanf("%f", &rent);//accepts a float from the user
printf(" \nPlease enter the Total Stationary purchased ");//prompts message to user
scanf("%f", &station);//accepts a float from the user
printf(" \nPlease enter the Total Salaries & Wages value ");//prompts message to user
scanf("%f", &sal_wage);//accepts a float from the user

13 | P a g e
printf(" \nPlease enter the Electricity Bill ");//prompts message to user
scanf("%f", &elec);//accepts a float from the user
printf(" \nPlease enter the Water Bill ");//prompts message to user
scanf("%f", &water);//accepts a float from the user
printf("\n Please enter the Telephone Bill ");//prompts message to user
scanf("%f", &telephone);//accepts a float from the user
printf(" \nPlease enter the Total remaining value of the Motor Van ");//prompts message to user
scanf("%f", &motor_van);//accepts a float from the user
printf("\n Please enter the Total value of ICT Equipment ");//prompts message to user
scanf("%f", &ict_equip);//accepts a float from the user
printf(" \nPlease enter the Total value of Discount Allowed ");//prompts message to user
scanf("%f", &dis_allow);//accepts a float from the user
ftr = fopen("accounts.dat", "w");//opens the file for the writing of data
fprintf(ftr,"%f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f
%f\n",t_debtor,other_debtor,purch,bank,cash,rent,carin,carout,opstock,
station,trav_exp,elec,water,telephone,dis_allow,motor_van,ict_equip,salesret,purchret,t_creditor,other_creditor,sales,capital,clstock,sal_wage);
fclose(ftr);//closes the file
}//end of function
void machineryinput(Machine *enter, int *a){//start of function to accept the machines/equipment that has been loaned
printf("\n\n\t\t*New Machinery /Equipment Information*");
printf("\nEnter the machine/equipment's name: ");//prompts message to user
fflush(stdin);//clears the buffer
scanf("%s",&enter->name);//accepts a string in the structure
printf("\nthe machine/equipment's serial number: ");//prompts message to user
fflush(stdin);//clears the buffer
scanf("%s",&enter->s_number);//accepts a string in the structure
printf("\nEnter the Machine's Value: ");//prompts message to user
scanf("%f",&enter->amount);//accepts a float in the structure
printf("\nEnter the name of the Person/company you loaned the machine from: ");//prompts message to user
fflush(stdin);//clears the buffer
scanf("%s",&enter->loaner);
*a = *a + 1;//incriments the value of the pointer by one
}//end of function
void generatereport(){//start of function to display a report of the accounts
FILE *ftr; //create file pointer

14 | P a g e
float t_debtor,other_debtor,purch,bank,cash,rent,carin,carout,opstock;//declaring floats for use1
float station,elec,water,telephone,dis_allow,motor_van;//declaring floats for use
float ict_equip,salesret,purchret,t_creditor,other_creditor,sales,capital;//declaring floats for use
float clstock, trav_exp, sal_wage,totalcreditor,totaldebtor;//declaring floats for use

ftr = fopen("accounts.dat", "r");//opening the file to write data


fscanf(ftr,"%f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f
%f",&t_debtor,&other_debtor,&purch,&bank,&cash,&rent,&carin,&carout,&opstock,&station,&trav_exp,&elec,&water,&telephone,&dis_allow,&motor_van,&i
ct_equip,&salesret,&purchret,&t_creditor,&other_creditor,&sales,&capital,&clstock,&sal_wage);
fclose(ftr);//closing the file
totalcreditor=(t_debtor+other_creditor+purch+bank+cash+rent+carin+carout+opstock+
station+trav_exp+elec+water+telephone+dis_allow+motor_van+ict_equip+ salesret+purchret);
totaldebtor=(t_creditor+other_creditor+sales+capital);//calculating the total debtors value
printf("\n
Trial Balance for this Period " );//prompts message to user
printf("\n---------------------------------------------------------------");//prompts message to user
printf("\n Accounts
| Debit
\t|
Credit");//prompts message to user
printf("\n---------------------------------------------------------------");//prompts message to user
printf("\n Trade Debtors
|
%.2f
\t|",t_debtor);//prompts message to user
printf("\n Trade Creditors
|
\t| %.2f",t_creditor);//prompts message to user
printf("\n Other Creditors\t|
\t| %.2f",other_creditor);//prompts message to user
printf("\n Other Debtors \t|
%.2f
\t|",other_debtor);//prompts message to user
printf("\n Sales
|
\t|
%.2f",sales);//prompts message to user
printf("\n Purchases
|
%.2f
\t|",purch);//prompts message to user
printf("\n Capital
|
\t| %.2f",capital);//prompts message to user
printf("\n Bank
|
%.2f
\t|",bank);//prompts message to user
printf("\n Cash
|
%.2f
\t|",cash);//prompts message to user
printf("\n Rent
|
%.2f
\t|",rent);//prompts message to user
printf("\n Carriage Inwards
|
%.2f
\t|",carin);//prompts message to user
printf("\n Carriage Outwards
|
%.2f
\t|",carout );//prompts message to user
printf("\n Opening Stock
|
%.2f
\t|",opstock);//prompts message to user
printf("\n Stationery
|
%.2f
\t|",station);//prompts message to user
printf("\n Travelling Expenses |
%.2f
\t|",trav_exp);//prompts message to user
printf("\n Salaries & Wages
|
%.2f
\t|",sal_wage);//prompts message to user
printf("\n Electricity
|
%.2f
\t|",elec );//prompts message to user
printf("\n Water
|
%.2f
\t|",water);//prompts message to user
printf("\n Telephone
|
%.2f
\t|",telephone);//prompts message to user

15 | P a g e
printf("\n Discount Allowed
|
%.2f
\t|",dis_allow);//prompts message to user
printf("\n Motor Van
|
%.2f
\t|",motor_van);//prompts message to user
printf("\n ICT Equipment
|
%.2f
\t|",ict_equip);//prompts message to user
printf("\n Sales Return
|
%.2f
\t|",salesret);//prompts message to user
printf("\n Purchases Return \t| %.2f
\t|",purchret);//prompts message to user
printf("\n==============================================================" );//prompts message to user
printf("\n
TOTALS \t|
%.2f
\t|
%.2f",totaldebtor,totalcreditor);//prompts message to user
printf("\n===============================================================");//prompts message to user
}//end of function
void displayloaneditems(Machine gav[], int pos){//start of function to display the loaned items
int lcv;//declaring an integer
for(lcv=0; lcv<pos; lcv++){//start of for loop
printf("\n\n%s | %s | %.2f | %s", gav[lcv].name, gav[lcv].s_number,gav[lcv].amount, gav[lcv].loaner);
}//end of for loop
}//end of function
void initialize_array(Machine startup[], int *pos){//start of function to setup array for use in the program
FILE *pntr;//creates file pointer
pntr = fopen("array.dat","r");//opens the the file to read data from
if(pntr!=NULL){//checks if the file was succesfully opened
while(!feof(pntr)){//checks if the program is at the end of the file
fscanf(pntr,"%s %s %f %s",&startup[*pos].name,&startup[*pos].s_number,&startup[*pos].amount, &startup[*pos].loaner);//reading
the data from the file to the array
*pos = *pos + 1;//incriments the value of the pointer by one
}//end of while loop
fclose(pntr);//closes the file
}else{//start of false section of the if statement
printf("\n\n\t\t\a ERROR!! - File could not not be opened");//prompts a message to user if the file was not opened
}//end of if statement
}//end of function
void write_to_file(Machine abc[], int p){//start of function to write information to a file
FILE *ptr; //create file pointer
int lcv;//declaring an integer
ptr = fopen("array.dat", "w");//opens the the file to write data to
for(lcv=0; lcv<p; lcv++){//start of for loop
fprintf(ptr,"\n%s %s %f %s",abc[lcv].name, abc[lcv].s_number, abc[lcv].amount, abc[lcv].loaner );//printing the data to the file from the array

16 | P a g e
}//end of for loop
fclose(ptr);//closes the file
}//end of function

P a g e | 17

Test Case
Test Number
Expected Result
Actual Result

Test Case
Test Number
Expected Result
Actual Result

Starting the Program before creating the relevant


files
01
A sound is to be made and an error message
prompted
The program executes, a sound is made, an error
message is prompted

Creating the relevant files before startup


02
The program should start and execute th menulist
function
The program starts no error message is prompted
and menulist function is called

P a g e | 18

P a g e | 19
Test Case
Test Number
Expected Result
Actual Result

Test Case
Test Number
Expected Result
Actual Result

Start up of the Program


03
The menulist is to be displayed and an integer
accepted
The user is prompted and the integer is
successfully accepted

Start up of program
04
Error should occur since a character will e entered
where an integer is expected
Runtime error occurs when the character is
entered as the otion

P a g e | 20
Test Case
Test Number
Expected Result
Actual Result

Test Case
Test Number
Expected Result
Actual Result

Selecting Option 1 from menulist


05
The screen should be cleared and totalsinput
function executed
The screen is cleared and the function is executed

Selecting Option 2 from menulist


06
The screen should be cleared and the user should
be prompted to enter an integer
The screen is cleared and the user is prompted to
enter a value

P a g e | 21
Test Case
Test Number
Expected Result
Actual Result

Selecting Option 3 from menulist before entering


the required data
07
The screen should be cleared and generatereport
function should be executed
The screen is cleared and generatereport function
is executed but the values are mostly zeros and
others are strange values

P a g e | 22

Test Case
Test Number
Expected Result

Actual Result

Test Case
Test Number
Expected Result
Actual Result

Selecting Option 3 from menulist after entering


the required data
08
The screen should be cleared the function should
copy the information from the file into the
variables then display them in trial alance
The screen is cleared the function

Selecting Option 4 from menulist before entering


the required data
09
The screen should be cleared and
displayloaneditems function should be executed
The screen was cleared and displayloaneditems
function was executed but the screen was blank
because the file is empty

P a g e | 23
Test Case
Test Number
Expected Result
Actual Result

Selecting Option 4 from menulist after entering


the required data
10
The screen should be cleared and
displayloaneditems function should be executed
The screen was cleared and displayloaneditems
function was executed the screen displayed all the
data previously entered into a file. The strings are
truncated but this will be fixed in the next release

P a g e | 24

Test Case
Test Number
Expected Result
Actual Result

Entering unexpected value into totalsinput


function
11
After entering an unexpected data type the
program should crash
When an unexpected data type is entered, it does
all the printf statements but omits the scanf lines

P a g e | 25

Test Case
Test Number
Expected Result
Actual Result

Entering Expected data types into totalsinput


function
12
The function executes completely without any
errors
The function executes, accepts the information
and writes it to a file

P a g e | 26
Test Case
Test Number
Expected Result
Actual Result

Entering 1 when asked about other debtors


13
Accept Other debtor value
The user is prompted to enter other debtor value

Test Case

Entering a number other than 1 when asked about


other debtors
14
Assign 0 to other debtor value
The program assigns 0 then moves on

Test Number
Expected Result
Actual Result

P a g e | 27

Test Case
Test Number
Expected Result
Actual Result

Test Case
Test Number
Expected Result
Actual Result

Entering something other than an integer when


prompted about other debtors
15
The program should crash
A runtime error occurs

Entering Information into the Machinery Input


function
16
Entering all the expected data types
The function goes through and collects the data
without error

P a g e | 28

Test Case
Test Number
Expected Result
Actual Result

Test Case
Test Number
Expected Result
Actual Result

Entering unexpected data types into the


MachineryInput Function
17
The program should crash
The function runs through and continues without
an error

After inputting data of an incorrect data type


18
Display gibberish in DisplayLoanedItems function
Gibberish is displayed

P a g e | 29
Test Case
Test Number
Expected Result
Actual Result

Test Case
Test Number
Expected Result
Actual Result

Enter an unexpected datatype when asked to


enter cash
19
A runtime error should occur
The program continues but omits all scanf lines

Enter an expected datatype when asked to enter


cash amount
20
Program should continue
Accepts value and moves on

P a g e | 30

Test Case
Test Number
Expected Result
Actual Result

Test Case
Test Number
Expected Result
Actual Result

Enter an unexpected datatype when asked to


enter bank value
21
A runtime error should occur
The program continues but omits all scanf lines

Enter an expected datatype when asked to enter


bank amount
22
Program should continue
Accepts value and moves on

P a g e | 31
Test Case
Test Number
Expected Result
Actual Result

Test Case
Test Number
Expected Result
Actual Result

Enter an unexpected datatype when asked to


enter sales amount
23
A runtime error should occur
The program continues but omits all scanf lines

Enter an expected datatype when asked to enter


sales amount
24
Program should continue
Accepts value and moves on

P a g e | 32
Test Case
Test Number
Expected Result
Actual Result

Test Case
Test Number
Expected Result
Actual Result

Enter an unexpected datatype when asked to


Sales Return cash
25
A runtime error should occur
The program continues but omits all scanf lines

Enter an expected datatype when asked to enter


sales return amount
26
Program should continue
Accepts value and moves on

P a g e | 33

Test Case
Test Number
Expected Result
Actual Result

Test Case
Test Number
Expected Result
Actual Result

Enter an unexpected datatype when asked to


enter purchases amount
27
A runtime error should occur
The program continues but omits all scanf lines

Enter an expected datatype when asked to enter


purchases value
28
Program should continue
Accepts value and moves on

P a g e | 34
Test Case
Test Number
Expected Result
Actual Result

Test Case
Test Number
Expected Result
Actual Result

Enter an unexpected datatype when asked to


enter purchases return
29
A runtime error should occur
The program continues but omits all scanf lines

Enter an expected datatype when asked to enter


purchases return amount
30
Program should continue
Accepts value and moves on

P a g e | 35
Test Case
Test Number
Expected Result
Actual Result

Test Case
Test Number
Expected Result
Actual Result

Enter an unexpected datatype when asked to


enter opening stock value
31
A runtime error should occur
The program continues but omits all scanf lines

Enter an expected datatype when asked to enter


Opening Stock amount
32
Program should continue
Accepts value and moves on

P a g e | 36

Test Case
Test Number
Expected Result
Actual Result

Test Case
Test Number
Expected Result
Actual Result

Enter an unexpected datatype when asked to


enter Final Trade Debtorsvalue
33
A runtime error should occur
The program continues but omits all scanf lines

Enter an expected datatype when asked to enter


Final Trade Debtors amount
34
Program should continue
Accepts value and moves on

P a g e | 37
Test Case
Test Number
Expected Result
Actual Result

Test Case
Test Number
Expected Result
Actual Result

Enter an unexpected datatype when asked to


enter Final Trade Creditors value
35
A runtime error should occur
The program continues but omits all scanf lines

Enter an expected datatype when asked to enter


Final Trade Creditors amount
36
Program should continue
Accepts value and moves on

P a g e | 38
Test Case
Test Number
Expected Result
Actual Result

Test Case
Test Number
Expected Result
Actual Result

Enter an unexpected datatype when asked to


enter Closing Stock value
37
A runtime error should occur
The program continues but omits all scanf lines

Enter an expected datatype when asked to enter


Final Closing Stock amount
38
Program should continue
Accepts value and moves on

P a g e | 39

Test Case
Test Number
Expected Result
Actual Result

Test Case
Test Number
Expected Result
Actual Result

Enter an unexpected datatype when asked to


enter Travel Expenses value
39
A runtime error should occur
The program continues but omits all scanf lines

Enter an expected datatype when asked to enter


Travel Expenses amount
40
Program should continue
Accepts value and moves on

You might also like