Professional Documents
Culture Documents
Computer Fundamental Llololouul
Computer Fundamental Llololouul
ertyuiopasdfghjklzxcvbnmqwert
yuiopasdfghjklzxcvbnmqwertyui
opasdfghjklzxcvbnmqwertyuiopa
Computer fundamental
sdfghjklzxcvbnmqwertyuiopasdf
Project of c++
ghjklzxcvbnmqwertyuiopasdfghj
Submitted to:-
Sir Talha Asghar
klzxcvbnmqwertyuiopasdfghjklz
xcvbnmqwertyuiopasdfghjklzxcv
bnmqwertyuiopasdfghjklzxcvbn
mqwertyuiopasdfghjklzxcvbnmq
wertyuiopasdfghjklzxcvbnmqwe
rtyuiopasdfghjklzxcvbnmqwerty
uiopasdfghjklzxcvbnmqwertyuio
pasdfghjklzxcvbnmqwertyuiopas
dfghjklzxcvbnmqwertyuiopasdfg
hjklzxcvbnmqwertyuiopasdfghjk
Submitted by:-
2
Work flow
Work in the Supermarket will be done in thefollowing way:
1. The product will come in the store.
2. The Administrator will enter the information of the product in
database and price and discount available for each product.
3. The customer will come and take the basket withhim/her and choose
the product and take it to thecounter.
4. The bill calculating operator will enter the productnumber then it will
show its information and priceand the bill will be calculated and total
payment willshown.
5. Customer will pay for the products.
6. All the products will be packed and delivered tothe customer
Hadders files
#include<iostream>
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<string>
#include<windows.h>
Functions
Void main()
Void menu()
Used for showing menu which takes the customer name as input and
provides the login for admin and provides the exit.
Void customer()
For storing the customer information and the items bought by them.
Void admin()
Void showdata()
Void enterdata()
For entering the data that Is the items, item code and item price.
Void password()
void menu(void);
void customer(void);
void enterdata(void);
void addmore(void);
void readdata(void);
void admin(void);
void showdata();
void password();
void place_order(void);
void exit(void);
struct
{
int item_no;
char name[50];
int price;
}data, update,check;
void main()
{
int i;
cout<<"\n\n\t ***** WELCOME TO SUPER MARKETING BILLING
SYSTEM *****\n";
cout<<"\n\n\n\t\t\t\tLoading";
for (i = 0; i <= 3; i++)
{
Sleep(500);
cout<<".";
}
system("cls");
menu();
_getch();
}
void menu()
{
int input;
cout << "\n\n\n\t\t\tSUPER MARKETING BILLING";
cout << "\n\t\t\t_______________________";
cout << "\n\n\n\t01.CUSTOMER";
cout << "\n\n\t02.ADMINISTRATION";
cout << "\n\n\t03.EXIT";
cout << "\n\n\tPlease Select Your Option(1-3)\t";
cin >> input;
system("cls");
switch (input)
{
case 1:
customer();
cout << "empty";
break;
case 2:
admin();
cout << "empty";
case 3:
exit();
default:
printf("Invalid");
Sleep(2000);
menu();
}
}
void customer()
{
int input2;
cout << "\n\n\n\t01.ADD ITEMS";
cout << "\n\n\t02.BILL DETAILS";
cout << "\n\n\t03.EXIT";
cout << "\n\n\tPlease Select Your Option(1-3)\t";
cin >> input2;
system("cls");
switch (input2)
{
case 1:
place_order();
case 2:
readdata();
case 3:
system("cls");
exit();
break;
break;
default:
cout << "invalid";
system("cls");
Sleep(2000);
menu();
}
}
void admin()
{
int a;
password();
cout << "\nenter 1 for enter data ";
cout << "\nenter 2 for add more data ";
cout << "\nenter 3 for read data ";
cout << "\nenter 4 for show data ";
cin >> a;
switch (a)
{
case 1:
enterdata();
break;
case 2:
addmore();
break;
case 3:
readdata();
break;
case 4:
showdata();
place_order();
default:
break;
}
}
void enterdata()
{
int choice,a;
FILE *fptr;
}
void showdata()
{
FILE *fptr;
fptr = fopen("record.txt", "r");
while (fscanf(fptr, "%d %s %d", &data.item_no, &data.name,
&data.price) != EOF)
{
cout << "\t\t" << data.item_no << "\t\t" << data.name <<
"\t\t" << data.price;
cout << "\n";
}
fclose(fptr);
}
void place_order()
{
FILE *fptr,*fqtr;
int order_arr[50], quan[50], c = 0;
char ch;
float amt, total = 0;
cout << "\n\t\t===================================";
cout << "\n\t\t PLACE YOUR ORDER";
cout << "\n\t\t===================================";
cout << "\n\n\n";
cout << "\t\tPr.No\t\tPr.Code\t\tPrice\n";
showdata();
cout << "\n\n\n";
do{
cout << "\n\nEnter Product Number";
cin >> order_arr[c];
cout << "enter quantity";
cin >> quan[c];
//c++;
cout << "Do you want to order any other Product ?(y/n)";
cin >> ch;
} while (ch == 'y' || ch == 'Y');
cout << "thank u for placing order";
system("cls");
cout << "\n\nINVOICE\n";
cout << "Pr.NO\tPr.Name\tPr.Price\tAmount";
fprintf(fqtr,"**********INVOICE**********");
fprintf(fqtr,"\nPr.NO\tPr.Name\tPr.Qty\tPr.Price\tAmount");
//Sleep(5000);
for (int x = 0; x <= c; x++)
{
while (fscanf(fptr, "%d %s %d", &data.item_no,
&data.name, &data.price) != EOF)
{
if (order_arr[c] == data.item_no)
{
amt = data.price*quan[x];
cout << "\n" << order_arr[x] << "\t" <<
data.name << "\t" << quan[x] << "\t\t" << data.price << "\t" << amt;
fprintf(fqtr, "%d\t%s\t%d\t%d\t%d\n",
order_arr[x], data.name, quan[x], data.price,amt);
total += amt;
}
cout << "\n\n\n\n\nTOTAL=" << total;
_getch();
fclose(fptr);
fclose(fqtr);
}
void password()
{
string arr[3][3] = { "sonu", "1234", "Welcom Shahzaib", "rizwan",
"3456", "Welcom Rizwan" };
string user_name;
string password;
char pas[10];
}
void exit()
{
exit(0);