Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "SLL.cpp"
- using namespace std;
- int createMenu(){
- cout << "=====Menu=====" << endl;
- cout << "1. Tambah Makanan" << endl;
- cout << "2. Show Data Makanan" << endl;
- cout << "3. Show Available Makanan" << endl;
- cout << "4. Show makanan yang laku terjual" << endl;
- cout << "5. Hapus makanan yang laku terjual" << endl;
- cout << "6. Transaksi" << endl;
- cout << "0. Exit" << endl;
- cout << "==============" << endl;
- int input;
- cout <<" Pilih Menu : ";
- cin >> input;
- return input;
- }
- int main(){
- List data;
- createNewList(data);
- int menu = -1;
- while(menu != 0){
- menu = createMenu();
- switch(menu){
- case 0:
- {
- return 0;
- }
- case 1:
- {
- int input;
- cout << "Masukan Total Makanan : ";
- cin >> input;
- addNelementList(data,input);
- break;
- }
- case 2:
- {
- showAllFood(data);
- break;
- }
- case 3:
- {
- showAvailableFood(data);
- break;
- }
- case 4:
- {
- showBestSeller(data);
- break;
- }
- case 5:
- {
- deleteAllSoldOut(data);
- break;
- }
- case 6:
- {
- int no,porsi;
- cout << "Masukan Nomor makanan : ";
- cin >> no;
- cout << "Masukan Porsi makanan : ";
- cin >> porsi;
- transaction(data,no,porsi);
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement