Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

daddy

Rating
-
Sold
-
Pages
9
Uploaded on
01-03-2023
Written in
2022/2023

Lecture notes study book Cracking the AP Calculus BC Exam, 2015 Edition of Princeton Review - ISBN: 9780804124836 (sba7o)

Institution
Course

Content preview

#include <iostream>
#include <conio.h>
#include <string>
#include <string.h>
#include <fstream>
#include <stdlib.h>
#include <ctime>
/*
#include <iostream>
#include <ctime>

using namespace std;

int main() {
// current date/time based on current system
time_t now = time(0);

// convert now to string form
char* dt = ctime(&now);

cout << "The local date and time is: " << dt << endl;
The local date and time is: Sat Jan 8 20:07:41 2011
*/

using namespace std;

#define product_file "product.txt"
#define temp_file "temp.txt"
#define bill_file "bill.txt"


struct marketitem{
int num, quantity;
string name;
string manufacture_name;
float price, weight;


void add_item(){
cout << "Enter the item Number: ";
cin >> num;
cout << "Enter the item Name: ";
cin >> name;
cout << "Enter the item Manufacture Name: ";
cin >> manufacture_name;
cout << "Enter product Weight :";
cin >> weight;
cout << "Enter the item Price: ";
cin >> price;
cout << "Enter the item Quantity: ";
cin >> quantity;
}

void display_item(){
cout << "The item Number: " << num << "\n";
cout << "The item Name: " << name << "\t\t\t";
cout << "The item Manufacture Name: " << manufacture_name << "\n";
cout << "The item Price: " << price << "\t\t\t";
cout << "The item Quantity: " << quantity << "\n";

, cout << "The item Weight: " << weight<< "\n";
}
int item_num(){
return num;
}
string item_name(){
return name;
}
float item_price(){
return price;
}
int item_quantity(){
return quantity;
}
string item_manufacture_name(){
return manufacture_name;
}

};


marketitem item;
fstream pf;
fstream tf;
fstream bf;

void entry_hello()
{
cout << "Hi :)" << endl;
cout << "This is my super Market program"<<endl;
cout << "It is very easy to use" << endl;
cout << "1. Customer Panel: " << endl;
cout << "2. Admin Panel: " << endl<< endl;
cout << "------------------------"<<endl;
cout << "Enter your choice (1-2)" << endl;

}

void admin_hello(){
cout << "\n\nIt is very easy to use" << endl;
cout << "1. Create products: " << endl;
cout << "2. View products list: " << endl;
cout << "3. Search for product: " << endl ;
cout << "4. Delete item: " << endl << endl;
cout << "------------------------"<<endl;
cout << "Enter your choice (1-4)" << endl;
}


void create_item(){
pf.open(product_file, ios::out|ios::app);
if(pf.fail()){
cout << "Error opening the file...\n";
exit(1);
}
item.add_item();
pf.write((char*)&item, sizeof(marketitem));
pf.close();
cout << "Item Created successfully" << endl;

Connected book

Written for

Course

Document information

Uploaded on
March 1, 2023
Number of pages
9
Written in
2022/2023
Type
Class notes
Professor(s)
Daddy
Contains
All classes

Subjects

$12.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
giveye6139

Get to know the seller

Seller avatar
giveye6139 Cairo Univesity
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
3 year
Number of followers
0
Documents
4
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions