Question

Write a C++ program to manage a Point of Sale System for a Supermarket. The main...

Write a C++ program to manage a Point of Sale System for a Supermarket. The main user is an employee at the Supermarket.

Build Specifications (36 points)

1. The system should load a catalog of all items that the store sells.

2. A user can search the inventory: The user of the system can search the inventory by using the name of the item or by category.

3. A user can sell items once they are found. Or can sell items by navigating through a tree of categories.

4. A user can return an item that has been bought into the inventory. 5. Add new items to the inventory.
6. The user can update existing items.

The program must have the following properties (20 points):

  • - You should do error handling (Ex: An employee cannot sell an item that is sold out)

  • - You should use inheritance, and polymorphism. Example: You can design a generic item class, then design derived classes for different kinds of items. The item class may have the following data members: Name (string), Category(string), price (floating number), quantity (integer number). An example of an inherited class can be Fruits, where you can add Best By (date time).

    Also, design a menu (should still appear until the exit option is chosen) in the Mainprogram that has the following options implemented to test your classes’ functionality(14 points):

  1. Search Inventory

  2. Sell items.

  3. Return items.

  4. Add new items to inventory

  5. Update items.

  6. Exit

0 0
Add a comment Improve this question Transcribed image text
Answer #1

`Hey,

Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries

#include<iostream>

#include<fstream>

#include<stdio.h>

#include<string.h>

#include<iomanip>

using namespace std;

class book

{

char bno[6];

char bname[50];

char aname[20];

public:

void create_book()

{

cout << "\nNEW BOOK ENTRY...\n";

cout << "\nEnter The book no.";

cin >> bno;

cout << "\n\nEnter The Name of The Book ";

gets(bname);

cout << "\n\nEnter The Author's Name ";

gets(aname);

cout << "\n\n\nBook Created..";

}

void show_book()

{

cout << "\nBook no. : " << bno;

cout << "\nBook Name : ";

puts(bname);

cout << "Author Name : ";

puts(aname);

}

void modify_book()

{

cout << "\nBook no. : " << bno;

cout << "\nModify Book Name : ";

gets(bname);

cout << "\nModify Author's Name of Book : ";

gets(aname);

}

char* retbno()

{

return bno;

}

void report()

{

cout << bno << setw(30) << bname << setw(30) << aname << endl;

}

  

}; //class ends here

class journals

{

char jno[6];

char jname[50];

char aname[20];

public:

void create_journal()

{

cout << "\nNEW JOURNAL ENTRY...\n";

cout << "\nEnter The journal no.";

cin >> jno;

cout << "\n\nEnter The Name of The Journal ";

gets(jname);

cout << "\n\nEnter The Author's Name ";

gets(aname);

cout << "\n\n\nJournal Created..";

}

void show_journal()

{

cout << "\njournal no. : " << jno;

cout << "\njournak Name : ";

puts(jname);

cout << "journal Name : ";

puts(aname);

}

void modify_journal()

{

cout << "\njournal no. : " << jno;

cout << "\nModify journal Name : ";

gets(aname);

cout << "\nModify Author's Name of journal : ";

gets(aname);

}

char* retjno()

{

return jno;

}

void report()

{

cout << jno << setw(30) << jname << setw(30) << aname << endl;

}

  

}; //class ends here

class user

{

char admno[6];

char name[20];

char stbno[6];

int token;

public:

void create_student()

{

cout << "\nNEW STUDENT ENTRY...\n";

cout << "\nEnter The admission no. ";

cin >> admno;

cout << "\n\nEnter The Name of The Student ";

gets(name);

token = 0;

stbno[0] = '\0';

cout << "\n\nStudent Record Created..";

}

void show_student()

{

cout << "\nAdmission no. : " << admno;

cout << "\n Student Name : ";

puts(name);

cout << "\nNo of Book issued : " << token;

if (token == 1)

cout << "\nBook No " << stbno;

}

void modify_student()

{

cout << "\nAdmission no. : " << admno;

cout << "\nModify Student Name : ";

gets(name);

}

char* retadmno()

{

return admno;

}

char* retstbno()

{

return stbno;

}

int rettoken()

{

return token;

}

void addtoken()

{

token = 1;

}

void resettoken()

{

token = 0;

}

void getstbno(char t[])

{

strcpy(stbno, t);

}

void report()

{

cout << "\t" << admno << setw(20) << name << setw(10) << token << endl;

}

}; //class ends here

fstream fp, fp1;

book bk;

user st;

void write_book()

{

char ch;

fp.open("book.dat");

do

{

bk.create_book();

fp.write((char*)&bk, sizeof(book));

cout << "\n\nDo you want to add more record..(y/n?)";

cin >> ch;

} while (ch == 'y' || ch == 'Y');

fp.close();

}

void write_user()

{

char ch;

fp.open("user.dat");

do

{

st.create_student();

fp.write((char*)&st, sizeof(user));

cout << "\n\ndo you want to add more record..(y/n?)";

cin >> ch;

} while (ch == 'y' || ch == 'Y');

fp.close();

}

void display_spb(char n[])

{

cout << "\nBOOK DETAILS\n";

int flag = 0;

fp.open("book.dat", ios::in);

while (fp.read((char*)&bk, sizeof(book)))

{

if (strcmp(bk.retbno(), n) == 0)

{

bk.show_book();

flag = 1;

}

}

fp.close();

if (flag == 0)

cout << "\n\nBook does not exist";

}

void display_sps(char n[])

{

cout << "\nSTUDENT DETAILS\n";

int flag = 0;

fp.open("student.dat", ios::in);

while (fp.read((char*)&st, sizeof(user)))

{

if ((strcmp(st.retadmno(), n) == 0))

{

st.show_student();

flag = 1;

}

}

fp.close();

if (flag == 0)

cout << "\n\nStudent does not exist";

}

void modify_book()

{

char n[6];

int found = 0;

cout << "\n\n\tMODIFY BOOK REOCORD.... ";

cout << "\n\n\tEnter The book no. of The book";

cin >> n;

fp.open("book.dat", ios::in | ios::out);

while (fp.read((char*)&bk, sizeof(book)) && found == 0)

{

if (strcmp(bk.retbno(), n) == 0)

{

bk.show_book();

cout << "\nEnter The New Details of book" << endl;

bk.modify_book();

int pos = -1 * (int) sizeof(bk);

fp.seekp(pos, ios::cur);

fp.write((char*)&bk, sizeof(book));

cout << "\n\n\t Record Updated";

found = 1;

}

}

fp.close();

if (found == 0)

cout << "\n\n Record Not Found ";

}

void delete_student()

{

char n[6];

int flag = 0;

cout << "\n\n\n\tDELETE STUDENT...";

cout << "\n\nEnter The admission no. of the Student You Want To Delete : ";

cin >> n;

fp.open("student.dat", ios::in | ios::out);

fstream fp2;

fp2.open("Temp.dat", ios::out);

fp.seekg(0, ios::beg);

while (fp.read((char*)&st, sizeof(user)))

{

if (strcmp(st.retadmno(), n) != 0)

fp2.write((char*)&st, sizeof(user));

else

flag = 1;

}

fp2.close();

fp.close();

remove("student.dat");

rename("Temp.dat", "student.dat");

if (flag == 1)

cout << "\n\n\tRecord Deleted ..";

else

cout << "\n\nRecord not found";

}

void delete_book()

{

char n[6];

cout << "\n\n\n\tDELETE BOOK ...";

cout << "\n\nEnter The Book no. of the Book You Want To Delete : ";

cin >> n;

fp.open("book.dat", ios::in | ios::out);

fstream fp2;

fp2.open("Temp.dat", ios::out);

fp.seekg(0, ios::beg);

while (fp.read((char*)&bk, sizeof(book)))

{

if (strcmp(bk.retbno(), n) != 0)

{

fp2.write((char*)&bk, sizeof(book));

}

}

fp2.close();

fp.close();

remove("book.dat");

rename("Temp.dat", "book.dat");

cout << "\n\n\tRecord Deleted ..";

  

}

void check_alls()

{

fp.open("student.dat", ios::in);

if (!fp)

{

cout << "ERROR!!! FILE COULD NOT BE OPEN ";

  

return;

}

cout << "\n\n\t\tSTUDENT LIST\n\n";

cout << "==================================================================\n";

cout << "\tAdmission No." << setw(10) << "Name" << setw(20) << "Book Issued\n";

cout << "==================================================================\n";

while (fp.read((char*)&st, sizeof(user)))

{

st.report();

}

fp.close();

}

void display_allb()

{

fp.open("book.dat", ios::in);

if (!fp)

{

cout << "ERROR!!! FILE COULD NOT BE OPEN ";

  

return;

}

cout << "\n\n\t\tBook LIST\n\n";

cout << "=========================================================================\n";

cout << "Book Number" << setw(20) << "Book Name" << setw(25) << "Author\n";

cout << "=========================================================================\n";

while (fp.read((char*)&bk, sizeof(book)))

{

bk.report();

}

fp.close();

}

void book_issue()

{

char sn[6], bn[6];

int found = 0, flag = 0;

cout << "\n\nBOOK ISSUE ...";

cout << "\n\n\tEnter The student's admission no.";

cin >> sn;

fp.open("student.dat", ios::in | ios::out);

fp1.open("book.dat", ios::in | ios::out);

while (fp.read((char*)&st, sizeof(user)) && found == 0)

{

if (strcmp(st.retadmno(), sn) == 0)

{

found = 1;

if (st.rettoken() == 0)

{

cout << "\n\n\tEnter the book no. ";

cin >> bn;

while (fp1.read((char*)&bk, sizeof(book)) && flag == 0)

{

if (strcmp(bk.retbno(), bn) == 0)

{

bk.show_book();

flag = 1;

st.addtoken();

st.getstbno(bk.retbno());

int pos = -1 * (int)sizeof(st);

fp.seekp(pos, ios::cur);

fp.write((char*)&st, sizeof(user));

cout << "\n\n\t Book issued successfully\n\nPlease Note: Write current data in backside of book and submit within 15 days fine Rs. 1 for each day after 15 days period";

}

}

if (flag == 0)

cout << "Book no does not exist";

}

else

cout << "You have not returned the last book ";

}

}

if (found == 0)

cout << "Student record not exist...";

fp.close();

fp1.close();

}

void intro()

{

cout << "LIBRARY";

cout << "MANAGEMENT";

cout << "SYSTEM";

}

void librarian_menu()

{

int ch2;

cout << "\n\n\n\tLIBRARIAN MENU";

cout << "\n\n\t1.CREATE STUDENT RECORD";

cout << "\n\n\t2.DISPLAY ALL STUDENTS RECORD";

cout << "\n\n\t3.DISPLAY SPECIFIC STUDENT RECORD ";

cout << "\n\n\t4.MODIFY STUDENT RECORD";

cout << "\n\n\t5.DELETE STUDENT RECORD";

cout << "\n\n\t6.CREATE BOOK ";

cout << "\n\n\t7.DISPLAY ALL BOOKS ";

cout << "\n\n\t8.DISPLAY SPECIFIC BOOK ";

cout << "\n\n\t9.MODIFY BOOK ";

cout << "\n\n\t10.DELETE BOOK ";

cout << "\n\n\t11.BACK TO MAIN MENU";

cout << "\n\n\tPlease Enter Your Choice (1-11) ";

cin >> ch2;

user a;

switch (ch2)

{

case 1:

a.create_student(); break;

case 2: display_allb(); break;

case 3:

char num[6];

cout << "\n\n\tPlease Enter The Admission No. ";

cin >> num;

display_sps(num);

break;

case 4:a.modify_student(); break;

case 5: delete_student(); break;

case 6:

write_book(); break;

case 7: display_allb(); break;

case 8: {

char num[6];

cout << "\n\n\tPlease Enter The book No. ";

cin >> num;

display_spb(num);

break;

}

case 9: modify_book(); break;

case 10: delete_book(); break;

case 11: return;

default:cout << "\a";

}

librarian_menu();

}

int main()

{

char ch;

intro();

book b;

do

{

cout << "\n\n\n\tMAIN MENU";

cout << "\n\n\t01. BOOK ISSUE";

cout << "\n\n\t02. BOOK DEPOSIT";

cout << "\n\n\t03. ADMINISTRATOR MENU";

cout << "\n\n\t04. EXIT";

cout << "\n\n\tPlease Select Your Option (1-4) ";

   scanf(" %c",&ch);

switch (ch)

{

case '1':

book_issue();

break;

case '2':b.create_book();

break;

case '3':librarian_menu();

break;

case '4':exit(0);

default:cout << "\a";

}

} while (ch != '4');

system("pause");

}

Kindly revert for any queries

Thanks.

Add a comment
Answer #2

#include "stdafx.h"
//Header file section
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <fstream>
using namespace std;
class Supermarket

{

//declare variables

protected:

string Name;
string category;
float price;
string Make;
string Model;
int quantity;
//Access specifier.
public:

//Constructor

Supermarket()

{

  Name = "";

  Make = "";

  Model = "";

  category = "";

  quantity = 0;

  price = 0;

}

//Argumented constructor

Supermarket(string myName, string mymake, string mymodel, int myquantity, float myprice, string mycategory)

{

  Name = myName;

  Make = mymake;

  Model = mymodel;

  quantity = myquantity;

  price = myprice;

  category = mycategory;

}

//Accessor function

string getSupermarketName()

{

  return Name;

}

string getSupermarketMake()

{

  return Make;

}

string getSupermarketModel()

{

  return Model;

}

string getSupermarketCategory()

{

  return category;

}

int getSupermarketquantity()

{

  return quantity;

}

float getSupermarketPrice()

{

  return price;

}

//Print Function.

virtual void print()

{

  cout << endl << endl;

  cout << "Name:" << Name << endl;

  cout << "Make:" << Make << endl;

  cout << "Model:" << Model << endl;

  cout << "quantity:" << quantity << endl;

  cout << "Price:" << price << endl;

  cout << "category:" << category << endl;

}

};

//New Supermarket definition.

class NewSupermarket :public Supermarket

{

//warranty provider

string warrantyProvider;

//Access specifier

public:

//constructor

NewSupermarket() :Supermarket()

{

  warrantyProvider = "";

}

//argumented constructor

NewSupermarket(string myName, string mymake, string mymodel, int myquantity, float myprice, string mycategory, string mywarranty) :

  Supermarket(myName, mymake, mymodel, myquantity, myprice, mycategory)

{

  warrantyProvider = mywarranty;

}

//accessor

string getSupermarketWarranty()

{

  return warrantyProvider;

}

//print

void print()

{

  Supermarket::print();

  cout << "Warranty Provider:" << warrantyProvider << endl;

  cout << endl;

}

};

//old Supermarket definition

class OldSupermarket :public Supermarket

{

//Declare variables

int milleage;

//declare methods

public:

//constructor

OldSupermarket() :Supermarket()

{

  milleage = 0;

}

//argumented constructor

OldSupermarket(string myName, string mymake, string mymodel, int myquantity, float myprice, string mycategory, int mymilleage) :

  Supermarket(myName, mymake, mymodel, myquantity, myprice, mycategory)

{

  milleage = mymilleage;

}

//accessor

int getSupermarketMilleage()

{

  return milleage;

}

//print

void print()

{

  Supermarket::print();

  cout << "Milleage:" << milleage << endl;

  cout << endl;

}

};

//Define method to check by Name

bool checkSupermarketByName(string Name, vector<Supermarket*> &list)

{

//declare boolean variable

bool flag = false;

//Using for-loop to check the Supermarket depends on the Name

for (int temp = 0; temp < list.size(); temp++)

  if ((*list[temp]).getSupermarketName() == Name)

   flag = true;

return flag;

}

//define method to check by make

bool checkSupermarketByMake(string make, vector<Supermarket*> &list)

{

bool flag = false;

//Using for-loop to check the Supermarket depends on the Name

for (int temp = 0; temp<list.size(); temp++)

  if ((*list[temp]).getSupermarketMake() == make)

  {

   flag = true;

   (*list[temp]).print();

  }

return flag;

}

//define method to check by model

bool checkSupermarketByModel(string model, vector<Supermarket*> &list)

{

//Declare flag variable

bool flag = false;

for (int temp = 0; temp<list.size(); temp++)

  if ((*list[temp]).getSupermarketModel() == model)

  {

   temp = true;

   (*list[temp]).print();

  }

return flag;

}

//define method to check by category

bool checkSupermarketByCategory(string category, vector<Supermarket*> &list)

{

bool flag = false;

for (int temp = 0; temp<list.size(); temp++)

  if ((*list[temp]).getSupermarketCategory() == category)

  {

   flag = true;

   (*list[temp]).print();

  }

return flag;

}

//print the menu

void SupermarketMenu()

{

cout << "Menu" << endl;

cout << "1. Search Inventory." << endl;

cout << "2. Sell items" << endl;

cout << "3. Return items." << endl;

cout << "4. Add new items to inventory" << endl;
cout << "5. Update items" << endl;
cout << "6. Exit." << endl;

cout << endl;

}

//main metho

int main()

{

//file

ifstream fin("Supermarketinventory.txt");

//Declare local variables

string Name;

string Make;

string Model;

string category;

int quantity;

float price;

string warrantyProvider;

int milleage;

vector<Supermarket*> Supermarketlist;

vector<Supermarket*> leaselist;

int option;

int choicesearch;

//check condition and load file

if (fin.is_open())

{

  while (fin >> Name >> Make >> Model >> quantity >> price >> category)

  {

   if (category == "new")

   {

    fin >> warrantyProvider;

    int flag = checkSupermarketByName(Name, Supermarketlist);

    if (flag == 0)

     Supermarketlist.push_back(new NewSupermarket(Name, Make, Model, quantity, price, category, warrantyProvider));

    else

     cout << "Supermarket exists" << endl;

   }

   else if (category == "old")

   {

    fin >> milleage;

    int flag = checkSupermarketByName(Name, Supermarketlist);

    if (flag == 0)

     Supermarketlist.push_back(new OldSupermarket(Name, Make, Model, quantity, price, category, milleage));

    else

     cout << "Supermarket exists" << endl;

   }

  }

  fin.close();

}

//Infinite loop

while (1)

{

  //display menu

  SupermarketMenu();

  cout << "Enter ur choice:";

  cin >> option;

  switch (option)

  {

   //Search inventory

  case 1:

  {

   cout << "Select \n 1. Search By Make.\n 2. Search by Model \n 3. Search By Category" << endl;

   cout << "Ur Option:";

   cin >> choicesearch;

   if (choicesearch == 1)

   {

    cout << "Enter Make:";

    cin >> Make;

    bool fg = checkSupermarketByMake(Make, Supermarketlist);

    if (fg == false)

     cout << "Supermarket Not Found" << endl;

   }

   else if (choicesearch == 2)

   {

    cout << "Enter Model:";

    cin >> Model;

    bool fg = checkSupermarketByModel(Model, Supermarketlist);

    if (fg == false)

     cout << "Supermarket Not Found" << endl;

   }

   else if (choicesearch == 3)

   {

    cout << "Enter category:";

    cin >> category;

    bool fg = checkSupermarketByCategory(category, Supermarketlist);

    if (fg == false)

     cout << "Supermarket Not Found" << endl;

   }

  }

  break;

  //sell or lease Supermarket

  case 2:

  {

   choicesearch = 0;

   cout << "Select \n 1. Sell\n 2. Lease" << endl;

   cout << "Ur option:";

   cin >> choicesearch;

   cout << "Enter Name:";

   cin >> Name;

   bool pk = checkSupermarketByName(Name, Supermarketlist);

   if (pk == 0)

    cout << "Supermarket Not Found" << endl;

   else

   {

    if (choicesearch == 1)

    {

     for (int temp = 0; temp<Supermarketlist.size(); temp++)

      if ((*Supermarketlist[temp]).getSupermarketName() == Name)

      {

       Supermarketlist.erase(Supermarketlist.begin() + temp);

       cout << "Supermarket sold successfully." << endl;

       cout << "Inventory" << endl;

       for (int temp = 0; temp<Supermarketlist.size(); temp++)

        (*Supermarketlist[temp]).print();

       break;

      }

    }

    else if (choicesearch == 2)

    {

     for (int temp = 0; temp<Supermarketlist.size(); temp++)

      if ((*Supermarketlist[temp]).getSupermarketName() == Name)

      {

       leaselist.push_back(Supermarketlist[temp]);

       Supermarketlist.erase(Supermarketlist.begin() + temp);

       cout << "Supermarket Leased successfully." << endl;

       cout << "Inventory" << endl;

       for (int temp = 0; temp<Supermarketlist.size(); temp++)

        (*Supermarketlist[temp]).print();

       break;

      }

    }

   }

  }

  break;

  //return leased Supermarket

  case 3:

  {

   cout << "Enter Name:";

   cin >> Name;

   bool pk = checkSupermarketByName(Name, leaselist);

   if (pk == false)

    cout << "Supermarket Not Found" << endl;

   else

   {

    for (int temp = 0; temp<leaselist.size(); temp++)

     if ((*leaselist[temp]).getSupermarketName() == Name)

     {

      Supermarketlist.push_back(leaselist[temp]);

      leaselist.erase(leaselist.begin() + temp);

      cout << "Supermarket Returned to Inventory" << endl;

      cout << "Inventory" << endl;

      for (int temp = 0; temp<Supermarketlist.size(); temp++)

       (*Supermarketlist[temp]).print();

      break;

     }

   }

  }

  break;

  //add Supermarket

  case 4:

  {

   cout << "Enter Name:";

   cin >> Name;

   cout << "Enter Make:";

   cin >> Make;

   cout << "Enter Model:";

   cin >> Model;

   cout << "Enter quantity:";

   cin >> quantity;

   cout << "Enter price:";

   cin >> price;

   cout << "Enter category:";

   cin >> category;

   if (category == "new")

   {

    cout << "Enter warranty provider:";

    cin >> warrantyProvider;

    int flag = checkSupermarketByName(Name, Supermarketlist);

    if (flag == 0)

     Supermarketlist.push_back(new NewSupermarket(Name, Make, Model, quantity, price, category, warrantyProvider));

    else

     cout << "Supermarket exists" << endl;

   }

   else if (category == "old")

   {

    cout << "Enter milleage:";

    cin >> milleage;

    int flag = checkSupermarketByName(Name, Supermarketlist);

    if (flag == 0)

     Supermarketlist.push_back(new OldSupermarket(Name, Make, Model, quantity, price, category, milleage));

    else

     cout << "Supermarket exists" << endl;

   }

   cout << "Inventory" << endl;

   for (int temp = 0; temp<Supermarketlist.size(); temp++)

    (*Supermarketlist[temp]).print();

  }

  break;

  //exit

  case 6:

   exit(0);

   //default

  default:

   cout << "Invalid choice" << endl;

  }

}


return 0;

}

Add a comment
Know the answer?
Add Answer to:
Write a C++ program to manage a Point of Sale System for a Supermarket. The main...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • For Programming Assignment 3 you will be creating a program to manage cars in a dealership....

    For Programming Assignment 3 you will be creating a program to manage cars in a dealership. This will again be a menu driven system. The following is your menu: 1. Display Inventory 2. Add a vehicle 3. Update a vehicle 4. Delete a vehicle 5. Sort inventory by VIN 6. Search inventory by Model 7. Read inventory from file 8. Write inventory to file and exit our program will be class based with the following UML representing the classes: Dealer...

  • DESCRIPTION Create a C++ program to manage phone contacts. The program will allow the user to...

    DESCRIPTION Create a C++ program to manage phone contacts. The program will allow the user to add new phone contacts, display a list of all contacts, search for a specific contact by name, delete a specific contact. The program should provide the user with a console or command line choice menu about possible actions that they can perform. The choices should be the following: 1. Display list of all contacts. 2. Add a new contact. 3. Search for a contact...

  • Write a C++ program to manage a list of inventory items using a linked list. Operations...

    Write a C++ program to manage a list of inventory items using a linked list. Operations should include adding a new inventory item at the end of the list, adding a new inventory item at the beginning of the list, removing an inventory item from the beginning of the list, removing an inventory item from the end of the list, removing an inventory item by name, and display the current list of inventory items. Allow the user an option to...

  • C++ program Write a C++ program to manage a hospital system, the system mainly uses file...

    C++ program Write a C++ program to manage a hospital system, the system mainly uses file handling to perform basic operations like how to add, edit, search, and delete record. Write the following functions: 1. hospital_menu: This function will display the following menu and prompt the user to enter her/his option. The system will keep showing the menu repeatedly until the user selects option 'e' from the menu. Arkansas Children Hospital a. Add new patient record b. Search record c....

  • Write the following program in Java using Eclipse. A cash register is used in retail stores...

    Write the following program in Java using Eclipse. A cash register is used in retail stores to help clerks enter a number of items and calculate their subtotal and total. It usually prints a receipt with all the items in some format. Design a Receipt class and Item class. In general, one receipt can contain multiple items. Here is what you should have in the Receipt class: numberOfItems: this variable will keep track of the number of items added to...

  • Need help working through CLion: Description: For this assignment you will create a program to manage...

    Need help working through CLion: Description: For this assignment you will create a program to manage phone contacts. Your program will allow the user to add new phone contacts, display a list of all contacts, search for a specific contact by name, delete a specific contact. Your program should provide the user with a console or command line choice menu about possible actions that they can perform. The choices should be the following: 1. Display list of all contacts. 2....

  • Write a program Ct+ that processes a user's monthly budget. Note that this program can easily...

    Write a program Ct+ that processes a user's monthly budget. Note that this program can easily be enhanced to process any number of budget items he program should contain several Classes A parent class named SpentItemType. The parent class should contain several member variables and member functions Just need classes below Above, we will restrict the program to process a maximum of 10 budget items for each group For each Budget items, there should be a class created that contains...

  • My Java code from last assignment: Previous Java code: public static void main(String args[]) { //...

    My Java code from last assignment: Previous Java code: public static void main(String args[]) { // While loop set-up boolean flag = true; while (flag) { Scanner sc = new Scanner(System.in); // Ask user to enter employee number System.out.print("Enter employee number: "); int employee_number = sc.nextInt(); // Ask user to enter last name System.out.print("Enter employee last name: "); String last_name = sc.next(); // Ask user to enter number of hours worked System.out.print("Enter number of hours worked: "); int hours_worked =...

  • please write in C++ Write a program that uses a structure to store the following inventory...

    please write in C++ Write a program that uses a structure to store the following inventory data in a file: The data can be either read from a text file or the keyboard Item name (string) Quantity on hand(int) Wholesale cost(double) Retail Cost(double) The program should have a menu that allows the user to perform the following tasks: Add new records to the file Display any record in the file User will provide the name of the item or the...

  • Please help!! (C++ PROGRAM) You will design an online contact list to keep track of names...

    Please help!! (C++ PROGRAM) You will design an online contact list to keep track of names and phone numbers. ·         a. Define a class contactList that can store a name and up to 3 phone numbers (use an array for the phone numbers). Use constructors to automatically initialize the member variables. b.Add the following operations to your program: i. Add a new contact. Ask the user to enter the name and up to 3 phone numbers. ii. Delete a contact...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT