Vous êtes sur la page 1sur 16

Table of Contents

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

success creates buzz for days.

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

purchase their ticket before all is sold out.

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" This is music's biggest night here in the federation :\n\n"

Display"Please enter your username\n" /*Prompting the user to enter their username*/

Read"%s",u.user

Display"Please enter your passwrod\n" /*Prompting user to enter their password*/

Read"%s",u.pass

End

if (strcmp(user,username)!=0 && strcmp(pass,password)!=0)

begin

Display"Incorrect username or password please try again *.*\n"

End

else if (strcmp(user,username)==0 && strcmp(pass,password)==0);

end

/*Welcome to St.Kitts Music Festival*/

Do

begin

void MenuOption();

Display" *Its The Night Of The Stars* \n "

5
Display"Welcome to the St.Kitts Music Festival\n"

Display"Here is the menu that consists of your options\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 condition is true then print the following */

for (int i=1; i<=9;i++)

if (TA[i]=='A')

begin

Status=="Available"

Display"Available"

end

else

begin

Status=="Sold"

Display"Sold"

end

Customer = fopen("emp.rec", "w")

if (Customer == NULL)

begin

Display"File does not exists \n"

end

6
end

/*option 2 specification*/

else if (choice==2)

begin

/* function selling tickets */

void SellingTickets();

Display"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*/

Display"Enter the name of the ticket you wish to


purchase\n"/*Accepting the name of the ticket*/

Read"%s",ticketname

fprintf(Customer, "ticketname = %s\n", ticketname) /*Storing the


name of the ticket*/

end

if (strcmp(ticketname,"Grounds")==0)

begin

Display"17 percent vat is added to your price\n"

grtot = (100 * vat)+100; /*Calculating the price of the ticket*/

Display"Here is the total for your ticket $%f\n",grtot /*Displaying the


cost of the ticket*/

fprintf(Customer, "Total = %.2f\n",grtot )

SA=SA-1

Display"There are only %d\n left", SA

end

else if (strcmp(ticketname,"VIP")==0)

begin

Display"17% vat is added to your price\n"

7
viptot = (150 * vat) + 100/*Calculating the price of the ticket*/

Display" Here is the total for ticket $%f\n",viptot/*Displaying the cost of


the ticket*/

fprintf(Customer, "Total = %.2f\n",viptot )

SA=SA-1

Display"There are only %d\n left", SA

end

else if (strcmp(ticketname,"VVIP")==0)

begin

Display"17% vat is added to your price\n"

vviptot = (250 * vat) + 250/*Calculating the price of the ticket*/

Display"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

Display"There are only %d\n left", SA

fclose(Customer);

end

while (choice=3)

begin

void ExitProgram()

Display"Thank you for choosing The St.kitts Music Festival


Come Back Soon\n"

grandtotal=grtot+viptot+vviptot /*Calculating the grand total*/

Display"Your Grand Total of your purchase is $%f\n",


grandtotal/*Displaying grand total*/

while (choice != 3)

8
end

end

9
Test Plan

Int main

Type of Input Description Expected Result Actual Result Success?/ Comments

User eneter Program should “Welcome to the Test case was

Normal “SKMFEST” as direct user to the St.Kitts Music successful

username and main menu. Festival”

“1992” as

password

Extreme User entered Program should Incorrect Test case successful

“john” as the display error username and

username and message that password”

“four” as the combination is

password. incorrect

Erroneous User entered Program should Program Test case

“@$%`” as the display error terminated unsuccessful, fix

username and message that applied to prevent

“*&&” as the combination is this.

password. incorrect

10
Void Menu

Type of Input Description Expected Result Actual Result Success?/

Comments

User enter 1 to Program should Program Failure. Needs to

Normal view available display available displayed all sold be adjusted

tickets and sold

Extreme User enter 2 to Please enter the Here is the ticket Test was

sell tickets name of the and your total successful

ticket is…

Erroneous User enter three Thank you for Program was This was a

to exit the choosing us terminated success.

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);

if (strcmp(user,username)!=0 && strcmp(pass,password)!=0)


printf("Incorrect username or password please try again *.*\n");

else if (strcmp(user,username)==0 && strcmp(pass,password)==0);

14
/*Welcome to St.Kitts Music Festival*/
do{
void MenuOption();

printf(" *Its The Night Of The Stars* \n


");
printf("Welcome to the St.Kitts Music Festival\n");
printf("Here is the menu that consists of your options\n");
printf("1.View available tickets, 2.You can sell tickets,3.You can
exit the program\n"); /*Displaying the menu options*/
scanf("%d",&choice);
getch();

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");
}
}
}

Customer = fopen("emp.rec", "w");

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

Vous aimerez peut-être aussi