Académique Documents
Professionnel Documents
Culture Documents
Problem Definition………………………………………………………4
Narrative………………………………………………………………..5
Pseudo Code……………………………………………………………..6-11
Test Plan….……………………………………………………………..12-13
Screen shot………………………………………………………………14-15
Source Code………………………………………………………………16-18
1
Problem Definition
The St. Kitts Music Festival is an annual event that is held during the month of June during the
three last days in the month. This is a festival where local, regional and international artist get to
showcase their talent before a grand crowd. This event is known to be a worthy event and its
Currently, their method of selling tickets is by means of distributing tickets to various venders
where customers can go to purchase these tickets. Customers are then left with limited options to
where they can go and purchase these tickets for this astonishing event. They are then urged to
However the problem here is that an easier solution is needed to sell the tickets and to keep track
of ticket sales and to store this data for future use. With the old method it is difficult to keep
track of tickets that are distributed to venders to sell and how much is actually made from those
tickets. Design a program to replace the old method. This program should be able to keep a track
of the ticket sales and also sell tickets. This method should also help to improve the efficiency of
ticket sales and good customer service. It should also show the availability of the tickets.
2
Narrative
Begin
Welcome user to the program by displaying “Welcome to the St. Kitts and Nevis Official
Website For Music Festival”
Ask the user to enter their username and password “Please enter username and password if you
wish to continue”
If the username or password was entered incorrectly display “Incorrect username or password
please try again”
After the username and password has been entered correctly display greeting “Welcome to the
St. Kitts Music Festival”
After greeting is displayed show menu “Here is the menu 1. View available tickets, 2. Purchase
ticket, 3. Exit”
If option one was selected display whether tickets are available or sold.
After viewing the available tickets you either exist the program or continue using the program
If they then choose to purchase a ticket display “Here is a list of the tickets we offer: Grounds-
$100, VIP-$150, VVIP-$250”
Each time they purchase a ticket the name and price of that ticket will be stored for future use.
The price for each ticket is then calculated plus a 17% Value Added Tax (VAT)
After the tickets have been purchased and calculated a message is displayed “Thank you for
using St. Kitts Music Festival Have A Great Day” and “The grand total of your purchase is $”
If option 3 is selected display “Thank you for choosing St. Kitts Music Festival Come Back
Soon”
Stop
3
Pseudo Code
Start
struct users
char user[10]
char pass[10]
int main ()
FILE *Customer
char user[10],pass[10]
char username[10]="SKMFEST",password[10]="1992"
char str1[11]="Grounds"
char str2[11]="VIP"
char str3[11]
void ExitProgram()
void MenuOption()
int choice
int us,SA,a,i
int count,response
char TA[10]
float option
char Grounds[10],n[6],N[6]
char VIP[10]
char VVIP[10]
char section,ticket
double vat
4
vat = .17
char ticketname[50]
char Status[10]
double grtot,viptot,vviptot,grandtotal
SA=6
//struct user s
Begin
Display" Welcome to the St. Kitts and Nevis Official Website For Music Festival :\n\n"
Display"Please enter your username\n" /*Prompting the user to enter their username*/
Read"%s",u.user
Read"%s",u.pass
End
begin
End
end
Do
begin
void MenuOption();
5
Display"Welcome to the St.Kitts Music Festival\n"
Display"1.View available tickets, 2.You can sell tickets,3.You can exit the
program\n"/*Displaying the menu options*/
Read"%d",&choice
end
if (choice==1)
begin
if (TA[i]=='A')
begin
Status=="Available"
Display"Available"
end
else
begin
Status=="Sold"
Display"Sold"
end
if (Customer == NULL)
begin
end
6
end
/*option 2 specification*/
else if (choice==2)
begin
void SellingTickets();
Read"%s",ticketname
end
if (strcmp(ticketname,"Grounds")==0)
begin
SA=SA-1
end
else if (strcmp(ticketname,"VIP")==0)
begin
7
viptot = (150 * vat) + 100/*Calculating the price of the ticket*/
SA=SA-1
end
else if (strcmp(ticketname,"VVIP")==0)
begin
SA=SA-1
fclose(Customer);
end
while (choice=3)
begin
void ExitProgram()
while (choice != 3)
8
end
end
9
Test Plan
Int main
“1992” as
password
password. incorrect
password. incorrect
10
Void Menu
Comments
Extreme User enter 2 to Please enter the Here is the ticket Test was
ticket is…
Erroneous User enter three Thank you for Program was This was a
program
11
Screen Shots
12
13
#include<stdio.h>
#include<conio.h>
#include <string.h>
#include <iostream>
struct users
{
char user[10];
char pass[10];
}u;
int main ()
{
FILE *Customer;
char user[10],pass[10];
char username[10]="SKMFEST",password[10]="1992";
char str1[11]="Grounds";
char str2[11]="VIP";
char str3[11];
void ExitProgram();
void MenuOption();
int choice;
int us,SA,a,i;
int count,response;
char TA[10];
float option;
char Grounds[10],n[6],N[6];
char VIP[10];
char VVIP[10];
char section,ticket;
double vat;
vat = .17;
char ticketname[50];
char Status[10];
double grtot,viptot,vviptot,grandtotal;
SA==6;
//struct user s;
printf(" Welcome to the St. Kitts and Nevis Official Website For
Music Festival :\n\n");
printf(" This is music's biggest night here in the federation
:\n\n");
printf("Please enter your username\n"); /*Prompting the user to enter
their username*/
scanf("%s",u.user);
printf("Please enter your passwrod\n"); /*Prompting user to enter their
password*/
scanf("%s",u.pass);
14
/*Welcome to St.Kitts Music Festival*/
do{
void MenuOption();
if (choice==1)
{
/* if condition is true then print the following */
for (int i=1; i<=9;i++){
if (TA[i]=='A')
{
Status=="Available";
printf("Available");
}
else
{
Status=="Sold";
printf("Sold");
}
}
}
if (Customer == NULL)
{
printf("File does not exists \n");
return 0;
}
/*option 2 specification*/
else if (choice==2) {
/* function selling tickets */
void SellingTickets();
printf("Here is a list of tickets that we
offer: Grounds-$100.00\n VIP-$150.00\n VVIP-$250.00\n"); /* Displaying the
tickets we offer*/
printf("Enter the name of the ticket you
wish to purchase\n"); /*Accepting the name of the ticket*/
scanf("%s",ticketname);
fprintf(Customer, "ticketname = %s\n",
ticketname); /*Storing the name of the ticket*/
{
if (strcmp(ticketname,"Grounds")==0)
{
printf("17 percent vat is added to your price\n");
grtot = (100 * vat)+100; /*Calculating the price of
the ticket*/
printf("Here is the total for your ticket
15
$%f\n",grtot); /*Displaying the cost of the ticket*/
fprintf(Customer, "Total = %.2f\n",grtot );
SA=SA-1;
printf("There are only %d\n left", SA);
}
else if (strcmp(ticketname,"VIP")==0)
{
printf("17% vat is added to your price\n");
viptot = (150 * vat) + 100;/*Calculating the price of
the ticket*/
printf(" Here is the total for ticket
$%f\n",viptot);/*Displaying the cost of the ticket*/
fprintf(Customer, "Total = %.2f\n",viptot );
SA=SA-1;
printf("There are only %d\n left", SA);
}
else if (strcmp(ticketname,"VVIP")==0)
{
printf("17% vat is added to your price\n");
vviptot = (250 * vat) + 250;/*Calculating the price of
the ticket*/
printf("Here is the total for your ticket
$%f\n",vviptot);/*Displaying the cost of the ticket*/
fprintf(Customer, "Total = %.2f\n",vviptot );
SA=SA-1;
printf("There are only %d\n left", SA);
fclose(Customer);
}
while (choice=3);
void ExitProgram();
{
printf("Thank you for choosing The St.kitts Music
Festival Come Back Soon\n");
grandtotal=grtot+viptot+vviptot; /*Calculating the
grand total*/
printf("Your Grand Total of your purchase is
$%f\n", grandtotal); /*Displaying grand total*/
getch();
return false;
}
getch();
}
getch();
}
} while (choice != 3);
}
16