0% found this document useful (0 votes)
13 views

Computer Science IA

Background: A neighborhood stand called Jeremy's Nut Stall specialized in selling nuts of all kinds, including peanuts, almonds, and cashews, to mention a few. Customers have the option of purchasing the assortment of nuts either by weight (per pound) or at a set fee. It is a family-owned company that was started by Jeremy Davidson, the owner, two years ago. He makes it his mission to serve his customers fresh produce every day when he is at his stand. When running the stall became a little too

Uploaded by

rayonpusey440
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Computer Science IA

Background: A neighborhood stand called Jeremy's Nut Stall specialized in selling nuts of all kinds, including peanuts, almonds, and cashews, to mention a few. Customers have the option of purchasing the assortment of nuts either by weight (per pound) or at a set fee. It is a family-owned company that was started by Jeremy Davidson, the owner, two years ago. He makes it his mission to serve his customers fresh produce every day when he is at his stand. When running the stall became a little too

Uploaded by

rayonpusey440
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 38

CARIBBEAN ADVANCED PROFICIENCY EXAMINATION

COMPUTER SCIENCE INTERNAL ASSESSMENT

Name of Candidates and Numbers:

Rayon Pusey
Danieto Murray
Alicia Dixion
Jaiden Fryes
Kayanna Robinson
Subject: Computer Science

Centre Name: deCarteret College

Centre Number: 100025

Territory: Jamaica
Table of Contents
Problem Definition.................................................................................................................3

Narrative................................................................................................................................4-7

Functional and Non-Functional Requirements......................................................................8-9

User Manual...........................................................................................................................10-11

System Architecture...............................................................................................................14

Pseudocode............................................................................................................................13-31

Test Plan.................................................................................................................................32 - 34

Test Results............................................................................................................................38 - 38

Page | 2
Problem Definition
Background:

A neighborhood stand called Jeremy's Nut Stall specialized in selling nuts of all kinds,
including peanuts, almonds, and cashews, to mention a few. Customers have the option of
purchasing the assortment of nuts either by weight (per pound) or at a set fee. It is a family-
owned company that was started by Jeremy Davidson, the owner, two years ago. He makes it his
mission to serve his customers fresh produce every day when he is at his stand. When running
the stall became a little too much for him to handle alone, he hired two employees a year ago.
Jeremy's Nut Stall is situated directly behind the Juici Beef on 3 Manchester Road.

The business owners are currently using a manual database, due to their lack of
technological knowledge. Their system consists of different tools, such as pen and paper to help
record customer purchases, product prices and the business's finances. They have been using this
system for quite a while but as their business grows, so do the products in their inventory and the
number of customers that visit the business to buy their products. Due to this, the owners have
decided to upgrade their system to one that's more technological thus making it easier to keep
track of products in their inventory there: price, amount, weight etc. and purchases made by
customers, also allowing for simpler calculation of funds and the ability to give receipts for each
purchase. Thus, their reason for reaching out to us is to create a suitable solution.
The system we plan to implement offers a comprehensive solution, incorporating key
features such as a robust Product Database to maintain accurate records of nuts and their
corresponding prices and stock, streamlined Sales Entry for user-friendly transaction input,
dynamic Cost Calculation based on quantity and pricing method, Receipt Generation for detailed
transaction summaries, efficient Inventory Management to track and update stock levels, and a
User-Friendly Interface prioritizing simplicity. This system aims to optimize the overall nut store
operations, providing store staff with a seamless tool for inventory management and transaction
processing.

Page | 3
Narrative
MODULE NAME: Main

“Hello, Please Select which menu you would like to access” is printed and the user is asked to
select a number which will select a case structure. The program then accepts a number and then
stores it in a variable called menu_option if the user selects 1 (this is made for the admin users of
the program) the program checks if the file inven exists, if it does not exist, “Would you like to
create a file” is printed and the user is asked to select a number which will select a case structure.
The program then accepts a number and then stores it in a variable called menu_option if the
user selects 1 the file inventory.txt is created, "File inventory.txt created”, “How many Nuts
would like to add to the Inventory” is printed to screen, the program then accepts an integer
value from the user, that variable is then used to run a for loop to accept the Nut name, stock,
price, manufacturer and expiry date of the at nut, those inputs are then printed to the file invent.
If the user selects 2 the program returns 0; and if the user selects an option that is not there, “Not
at option” is printed and the program returns. If the file invent does exits, the screen is cleared.
And the user is asked to enter the admin password if the password is equal to “1234” , “Welcome
admin” is printed to screen and a call to the options functions is made, the user is to then select a
number which will select a case structure. The program then accepts a number and then stores it
in a variable called menau_option if the user selects 1 a call to the update_inventory function is
made and a call to the options function is made , if the user selects 2 a call to the change_prrice
function is made and a call to the options function is made, if the user selects 3 a call to the
add_nut function is made and a call to the options function is made, if the user selects 4 a call to
the delete_nut function is made and a call to the options function is made, if the user selects 5 a
call to the delete_nut function is made and a call to the options function is made, if the user
selects 6 a call to the find_order function is made and a call to the options function is made, if the
user selects 7, “goodbye” is printed and the programs returns. If the password is not equal to
“1234”, “incorrect password” is printed and the program returns.

If the user selects 2 (this menu is made for the customers) the screen is cleared and “welcome
customer” is printed to screen, the user is asked how many nuts they would like to buy, that
value is stored in the variable “temp” the program sets the variable “buy_num” to the value of
“temp”, a call to the cus_options is made, the program uses the value of buy_num to run the a for

Page | 4
loop, the user then selects a nut they would like to buy, the user is then select a number which
will select a case structure. The program then accepts a number and then stores it in a variable
called opt if the user selects 1, a call to the by_pounds function is called, if the user selects 2 a
call to the by_price function is called. After which a call to the receipt_function is made.

If the user selects 3 “goodbye” is printed to screen and the program returns.

MODULE NAME: fetch_inventory

The program opens the file “inventory.txt” in reading mode, if the file is null, “ ERROR
OPENING FILE” is printed, the programs then run a while loop to scan each line of the txt file
and saves the values into the variable in the Nuts structure. The file is the closed.

MODULE NAME: check_line

The program opens the file “inventory.txt”, the program checks is the file is null, if it is null,
“file not found” is printed and the program returns. If the file is found the program uses a while
loop to check each line in the file and increments count for each line, the file is then closed, and
count is returned.

MODULE NAME: a_ran

The program returns a random value between 90000 and 10000.

MODULE NAME: options

A call to the fetch_inventory function is made, then a for loop is used to print all the options to
the user.

MODULE NAME: update_inventory

The file “inventory.txt is opened in writing mode, the user is then prompted to enter the nut of
they would like to change stock of, that value is then saved into the variable “i”. the user then is
prompted to enter the amount of nuts they would like to add to nut they selected, the program
saves that value in the “amount” variable,

The program then added that value to the nut they selected, and prints the updated values back to
the file, then closes the file.

Page | 5
MODULE NAME: change_price

A call is made to the fetch_inventory function, The file “inventory.txt is opened in writing mode,
the user is then prompted to enter the nut of they would like to change the price of, that value is
then saved into the variable “i”. the user then is prompted to enter the new price of the nut they
selected, the program saves that value in the “c_price” variable, The program sets the value of
the nut they selected to the accepted value and prints the updated values back to the file, then
closes the file.

MODULE NAME: add_nut

The user is Prompted to enter the name of the nut, its stock, price, manufacturer, and expiry date.
The program Stores the input values in the variables “N_nut_name, N_Manufacturer, N_expiry,
n_stock, n_price”, the program then updates the nut array with the new nut entry, incrementing
the line variable to indicate the new index. The file "inventory.txt" in write mode. And the
updated value are printed back to the file, the file is then closed.

MODULE NAME: delete_nut

The file “inventory.txt is opened in writing mode, the user is then prompted to enter the nut of
they would like to delete, that value is then saved into the variable “i”. The program used a for
loop to shift each index in array 1 up from the selected nut, and then decrements the value of
line, the program then uses a for loop to print the updated values back to the stock, then closes
the file.

MODULE NAME: delete_file

“Are you sure you want to delete the file” is printed and the user is asked to select a number
which will select a case structure. The program then accepts a number and then stores it in a
variable called “opt” if the user selects 1 the program check if “inventory.txt” is removed, if
deleted successfully "File deleted successfully" is printed to screen else, and error message is
printed. If the user selects 2 the program returns. Default case “not an option” is printed.

MODULE NAME: find_order

The user is prompted to enter the receipt number of a pervious order. That integer value is then
saved in the variable “order_num”, the program then opens the file with that order number in

Page | 6
reading mode , if it is found the program uses a while loop to print the contents. If not found “not
an order” is printed. The file is then closed.

MODULE NAME: cus_options

A call to the fetch_inventory function is made, and a for loop is used to printed all the nuts and
their stock in the array.

MODULE NAME: by_pounds

A call to the fetch_inventory function is made, and the user is ask how many pounds they would
like to buy, the program saves that amount into the “amount” variable, if what they want is more
than what is in stock the program prints "We do not have that much in stock" and returns, else
total is calculated by “amount” * the price of the nut they selected, The file “inventory.txt” is
opened in writing mode. The stock of that nut is then updated and for loop is used to print the
updated values back to the file, the file is closed. The program then copies the data for the
nut_name, stock and price into the “a” index of the data array and grand total is calculated.

MODULE NAME: by_price

A call to the fetch_inventory function is made, and the user is ask how much’s worth they would
like to buy, the program saves that amount into the “price” variable, amount is calculated by
price divided by the price of the nut they selected if what they want is more than what is in stock
the program prints "We do not have that much in stock" and returns, else total is calculated by
“amount” * the price of the nut they selected, The file “inventory.txt” is opened in writing mode.
the stock of that nut is then updated and for loop is used to print the updated values back to the
file, the file is closed. The program then copies the data for the nut_name, stock and price into
the “a” index of the data array and grand total is calculated.

MODULE NAME: receipt_function

The program then sets the variable rec_number to the return value of the a_ran function. The
program opens the file “rec_number.txt” in writing mode, the Receipt number and the details of
all the nuts the customer bought are printed to the screen and the the file using a for loop. The
file is then closed.

Page | 7
Functional and Non-Functional Requirements
Functional Requirements:

 Our program allows its users to access different menus like admin and customer, there is
also the option to leave the program.
 The customer menu allows customers to enter the amount of nuts they'd like to purchase
then they are able to choose the type of nuts They'd like to purchase from the inventory.
 After the selecting their nut of choice they are then able to choose how they'd like to
purchase the nut of their choice whether by weight or by quantity, if they choose to
purchase by weight then they are then able to enter how much pounds of the nut they'd
like, however if they chose to purchase by quantity then they are able to enter how much
money's worth of nuts they'd need and if there is not enough nuts available they will be
recommended to choose another nut option present.
 The admin menu gives users the option to create a file which then allows them to access
their inventory so that they can edit it, by adding nuts to their inventory and remove nuts
from their inventory, also it allows users to change nut prices, names, stock and
manufacturer.

Non-Functional Requirements:

 Our program has good usability, it has an intuitive user interface for both administrators
and customers and clear and concise prompts and messages for user interactions.
 As it relates its performance, it's able to perform its duty well executing on its purpose as
it contains efficient file operations for reading and writing inventory data and has a quick
response time for menu navigation and order processing.
 Now for its accuracy, it ensures accurate calculations for order totals and stock updates
and correctly displays inventory and receipt details.
 About our program’s reliability, it is ensured that the system will operate correctly under
normal and exceptional conditions.
 Our program has a security feature in place, as we input basic password protection
system for administrative access.

Page | 8
 Scalability is also good as our program can Manage inventory and receipt files efficiently
regardless of their size.

Page | 9
User Manual
Upon First run of the program, the user must enter the admin menu first, using the password
“1234” then the user should select the option to create the file, the user is then to add all nuts
their nuts of choice alongside their relevant information; “Name, Stock (in pounds), price (in
JMD), Manufacture, and expiry date. After which that information will be saved in a file,
“inventory.txt” which will be used to operate the program for admin and customer use.

Admin Menu – this menu is made to handle the inventory.

After entering the correct password, 6 options are presented to the user:

1. Change stock
 The nuts are printed to screen with a number. The user should simply
select the number of the nut then would like to change the stock of. If the
user wishes to add stock, they should enter a positive integer if the wish to
subtract the enter a negative integer.
2. Change price
 The nuts are printed to screen with a number. The user should simply
select the number of the nut then would like to change the price of and
simply enter the new price, that should be a positive integer.
3. Add nut
 The user should enter the necessary information about the nut they wish to
add.
4. Delete Nut
 The nuts are printed to screen with a number. The user should simply
select the number of the nut then would like to delete.
5. Search order.
 The user should simply enter the receipt number of any purchase
previously made and the order details will be printed to screen.
6. Exit
 Goodbye is printed and the program ends.

Page | 10
Customer Menu- This menu is made to handle purchases made by customers.

The user should enter the number of nuts they would like to buy, after which options are printed
are screen, after the user selects an option, they have the option to buy

1. By Pound
 The user is to simply enters the number of pounds they would like to buy;
they will not be able to buy more than what they have in stock.
2. By Price
 The user is to simply enter the amount’s worth of nuts they would want,
for example, $1000, also they will not be allowed to buy more than what
they have in stock.

After which a receipt will be printed to screen with their order details, and grand total.

Page | 11
System Architecture

Nuts Management

System

Admin Customer
Subsystem subsystem

Page | 12
Pseudocode
Module Name: Main

Module Name: A_Ran

Module Name: Options

Module Name: Update_Inventory

Module Name: Change_Price

Module Name: Add_Nut

Module Name: Delete_Nut

Module Name: Delete_File

Module Name: Find_Order

Module Name: Cus_Options

Module Name: By_Pounds

Module Name: By_Price

Module Name: Receipt_Function

Module Name: fetch_inventory

Structure declaration

Structure declaration

Page | 13
BEGIN MAIN

Declare menu_option, password, num_nuts, buy_num, temp, buy, i, a, opt as integer

Declare amount, c_price, grand_total, stock, price as real

Declare nutname, Manufacter, expirey as string

buy_num = 0

float grand_total = 0

print "Hello, Please Select which menu you would like to access"

print "1. Admin Menu"

print “2. Customer Menu"

print "3. Exit."

read menu_option

switch (menu_option)

case 1:

open nut inventory file in reading mode

if(inven == NULL)

print "Would you like to create a file?"

print "1. Yes"

print "2. No"

read menu_option

switch (menu_option)

case 1:

open nut inventory file in writing mode

Page | 14
print "File inventory.txt created.”

print "How many Nuts would like to add to the Inventory"

read num_nuts

for( i = 0; i < num_nuts; i++)

print "Enter the name of nut #”, i + 1

read nutname

print "Enter the stock of”, nutname

read stock

print “Enter the price of", nutname

read price

print "Enter the Manufacture of”, nutname

read Manufacter

print "Enter the expirey date of “, nutname

read expirey

print to file nutname,”,”, stock,”,”, price,”,”, Manufacter,”,”, expirey

endfor

break

case 2:

Exit.

Break

default:

print "Not an option"

break;

Page | 15
end switch

endif

else

print “Enter the Admin Password\n";

read password

if (password == 1234)

clear screen.

Print"********************WELCOME ADMIN*******************"

print "NutName, Stock, Price, Manufacter, expirey date "

call to the options function

print ""

print "What would you like to do"

print "1. Change stock"

print "2. Change price"

print "3. Add nut"

print "4. Delete nut"

print "5. delete file”

print "6. Search for order"

print "7. Exit"

read menu_option

switch (menu_option)

case 1:

call to the update_inventory function

Page | 16
print "Updated values"

call to the options function

break

case 2:

call to the change_price function

print "Updated values"

call to the options function

break

case 3:

call to the add_nut function

print "Updated values"

call to the options function

break

case 4:

call to the delete_nut function

print “Updated values”

call to the options function

break

case 5:

call to the delete_file function

break

case 6:

call to the find_order function

Page | 17
break

case 7:

print "Goodbye"

exit.

break

default:

print “Not an option”

exit

break

end switch

endif

else if (password != 1234)

print "Incorrect Password”

endif

break

case 2:

print “********************WELCOME CUSTOMER*******************”

print "How many Nuts would like to buy”

read temp

buy_num = temp

print “Nut, Avaible Stock”

call to the cus_options function

for( a = 0; a < buy_num; a++)

Page | 18
print "Please select from the options above"

read buy

print "How would you like to buy”, nut[buy -1].NutName

print "1. By weight"

print "2. By quantity"

read opt

switch (opt)

case 1:

call to the by_pounds function

break

case 2:

call to the by_price function

break

default:

print “Not an option”

exit.

break

end switch

call to the receipt_function function

break

case 3:

print "Goodbye"

exit

Page | 19
break

default:

print "Not an option"

exit

break

end switch

END MAIN

BEGIN A_RAN

return a random number between 90000 and 10000

END A_RAN

BEGIN OPTIONS

declare i as integer

call to the fetch_inventory function

for ( i = 0; i < line; i++)

print i+1,".,", nut[i].NutName,",", nut[i].stock,",", nut[i].price,",",


nut[i].Manufacture,",", nut[i].expirey

endfor

END OPTIONS

Page | 20
BEGIN FETCH_INVENTORY

declare buffer as string

declare index as integer

the file "inventory.txt" is opened is reading mode

if(stockz == NULL) //checks if the file is valid

begin

print "ERROR OPENING FILE"

endfor

index = 0

while( fgets(buffer, sizeof(buffer), stockz) != NULL && index < line)

read nut[index].NutName, nut[index].stock, nut[index].price,


nut[index].Manufacture, nut[index].expirey

index = index + 1

the file is closed

END FETCH_INVENTORY

BEGIN UPDATE_INVENTORY

declare j, i as integer

declare amount as real

the file "inventory.txt" in writing mode

print "Enter the number of the nut you would like to change the stock of"

read i

Page | 21
print "Enter the amount of %s you would like to add or remove", nut[i-
1].NutName

read amount

nut[i -1].stock = nut[i -1].stock + amount

if(stockg == NULL)

begin

print "ERROR OPENING FILE"

endif

for (j = 0; j < line; j++)

begin

print to file nut[j].NutName,",", nut[j].stock,",", nut[j].pricev,",",


nut[j].Manufacture,",", nut[j].expirey

enfor

the file inventory is closed

END UPDATE_INVENTORY

BEGIN CHANGE_PRICE

declare c_price as real

declare i, j as integer

call to the fetch_inventory function

the file "inventory.txt" is writing mode

print "Enter the number of the nut you would like to change"

read i

Page | 22
print "Enter the new price of",nut[i-1].NutName

read c_price

nut[i -1].price = c_price;

for (j = 0; j < line; j++)

begin

print to file nut[j].NutName,",", nut[j].stock,",", nut[j].pricev,",",


nut[j].Manufacture,",", nut[j].expirey

endfor

END CHANGE_PRICE

BEGIN ADD_NUT

declare N_nut_name, N_Manufacter, N_expirey as string

declare n_stock, n_price as real

declare j as integer

print "Enter the name of the nut you would like to add:"

read N_nut_name

print "Enter the stock of the ",N_nut_name

read n_stock

print "Enter the price of the ",N_nut_name

read n_price

print "Enter the Manufacter of ",N_nut_name

read N_Manufacter

print "Enter the expirey date of ", N_nut_name

Page | 23
read N_expirey

strcpy(nut[line].NutName, N_nut_name)

strcpy(nut[line].Manufacture, N_Manufacter)

strcpy(nut[line].expirey, N_expirey)

nut[line].stock = n_stock

nut[line].price = n_price

line = line + 1

the file inventory.txt" is opened in writing mode

for (j = 0; j < line; j++)

begin

print to file nut[j].NutName,",", nut[j].stock,",", nut[j].pricev,",",


nut[j].Manufacture,",", nut[j].expirey

endfor

the file inventory is closed

END ADD_NUT

BEGIN DELETE_NUT

begin

declare j, p, l, indexx as integer

the file "inventory.txt" is opened in reading mode

print "Select the Nut you would like to delete:"

read indexx

for (j = indexx - 1; j < line - 1; j++)

Page | 24
begin

nut[j] = nut[j + 1]

end for

line = line - 1

for (l = 0; l < line; l++)

begin

print to file nut[j].NutName,",", nut[j].stock,",", nut[j].pricev,",",


nut[j].Manufacture,",", nut[j].expirey

end for

the file inventory is closed

END DELETE_NUT

BEGIN DELETE_FILE

declare opt as integer

print "Are you sure you want to delete the file?"

print "1. Yes"

print "2. No"

read opt

switch (opt)

case 1:

if (remove("inventory.txt") == 0)

print "File deleted successfully"

else

Page | 25
print "Error deleting file"

exit.

endif

break

case 2:

print "Goodbye"

exit

break

default:

print "Not an Option"

exit.

break;

end switch

END DELETE_FILE

BEGIN FIND_ORDER

declare order_num as integer

declare corder_buffer, list_buffer as string

print "Enter the recipet number of the order:"

read order_num

snprintf(order_buffer, sizeof(order_buffer), "%d.txt", order_num);

the file with the order number is opened in reading mode

if(order != NULL)

Page | 26
while (fgets(list_buffer, sizeof(list_buffer), order) != NULL)

print list_buffer

endwhile

end if

else

print "Not an order"

exit.

endif

the file inventory.txt is closed

END FIND_ORDER

BEGIN MODULE CUS_OPTIONS

declare i as integer

call to the fetch_inventory

for ( i = 0; i < line; i++)

print i+1,",", nut[i].NutName,",", nut[i].stock

endfor

END CUS_OPTIONS

BEGIN BY_POUNDS

declare amount, total as real

declare j as integer

Page | 27
call to the fetch_inventory function

print "How much pounds of", nut[buy-1].NutName", you would like to buy"

read amount

if(amount > nut[buy-1].stock)

print "We do not have that much in stock"

exit.

endif

else

print "You have bought ",amount," pounds of ", nut[buy-1].NutName

total = amount * nut[buy-1].price

print "The total cost is ",amount * nut[buy-1].price

endif

nut[buy-1].stock = nut[buy-1].stock - amount;

the file "inventory.txt" is open writing mode

for (j = 0; j < line; j++)

print to file nut[j].NutName,",", nut[j].stock,",", nut[j].pricev,",",


nut[j].Manufacture,",", nut[j].expirey

endfor

the file inventory is closed

strcpy(data[a].Nut, nut[buy-1].NutName)

data[a].price = nut[buy-1].price

data[a].amount = amount

grand_total = grand_total + total

Page | 28
END BY_POUNDS

START BY_PRICE

declare amount, price, total as real

declare j as integer

call to the fetch_inventory function

print "How much's worth of ", nut[buy-1].NutName," you would like to buy"

read price

amount = price / nut[buy-1].price;

if(amount > nut[buy-1].stock)

print "We do not have that much in stock"

exit.

else

print "You have bought", amount," of ", nut[buy-1].NutName

total = amount * nut[*buy-1].price;

print "The total cost is ", amount * nut[buy-1].price

nut[buy-1].stock = nut[buy-1].stock - amount

the file "inventory.txt" is opened in writing mode

for (j = 0; j < line; j++)

print to file nut[j].NutName,",", nut[j].stock,",", nut[j].pricev,",",


nut[j].Manufacture,",", nut[j].expirey

endfor

the file is closed

Page | 29
strcpy(data[a].Nut, nut[buy -1].NutName)

data[a].price = nut[buy-1].price

data[a].amount = amount

grand_total = grand_total + total

END BY_PRICE

START RECEIPT_FUNCTION

declare i, rec_number as integer

declare total as real

declare buffer as string

rec_number = call to the a_ran function

snprintf(buffer, sizeof(buffer), "%d.txt", rec_number);

file rec_number.txt is opened is writing mode

print ""

print "Receipt number:", rec_number

print "********************************************"

for (i = 0; i < *buy_num; i++)

total = data[i].amount * data[i].price

print "Nut", data[i].Nut

print "Quantity: x Price per pound = total"

print data[i].amount," pounds x ",data[i].price," = ", total

endfor

Page | 30
print " Grand total"

print " = ", grand_total

print "********************************************"

print to file "Receipt number ", rec_number

print to file "********************************************"

for (i = 0; i < buy_num; i++)

total = data[i].amount * data[i].price

print to file "Nut", data[i].Nut

print to file "Quantity: x Price per pound = total"

print to file data[i].amount," pounds x ",data[i].price," = ", total

endfor

print to file" Grand total"

print to file " = ", grand_total

print to file "********************************************"

the inventory file is closed

END RECEIPT_FUNCTION

Page | 31
Test Plan

Function Test Data Test Expect Result Results


1. 1 Allows the user The user will be Successful
M to enter a choice allowed to enter
to select which a menu
menu they want
1234
to enter

2. options Should print all Nut information Successful


the nut will be printed
information to
screen
3. Change 6 User should be Stock of selected Successful
stock allowed to select nut should be
the nut they changed
10 want to the
change the stock
of and be able
to change that
stock
4. Options Should print all Nut information Successful
the nut will be printed
information to

Page | 32
screen
5. Main 1 Allows the user The user will be Successful
to enter a choice allowed to enter
to select which a menu
menu they want
1234
to enter,

6. Change 5 User should be Price of selected Successful


price allowed the nut should be
select the nut changed
they want to
change the price
of, and change
2500
the price

7. Options Should print all Nut information Successful


the nut will be printed
information to
screen

Page | 33
8. Main 2 Allows the user The user will be Successful
to enter a choice, allowed to enter
and how many a choice, and
nuts they would enter how many
1
like buy nuts they would
like to buy

9. Cus_opti Should print nut Nut information Successful


ons name and price will be printed
to screen for
each nut.
10. Main 9 Allows the user The user will be Successful
to select a nut to allowed to select
buy and how a nut
they want to buy
it
1

10. by_pound 4 Allows the user The user well be Successful


to enter the allowed to enter
amount of pound the amount they
of the nut they want
seleted they
want
11. Should print the The receipt is Successful
receipt_function customer receipt printed to screen
screen

Page | 34
Test Results

Page | 35
Page | 36
Page | 37
Page | 38

You might also like