Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ Write a complete C++ program as described below files are given to you. Please go through them on Titanium before beginning to program The

c++ image text in transcribed
Write a complete C++ program as described below files are given to you. Please go through them on Titanium before beginning to program The cash register scanned item. Your program should code part of this logic. at a grocery store calculates the total bill by looking up the price of every The price of every type of item carried in the store is in a text file in the following format 23043 0.99 Apple 74001 0.79 Coke 10078 3.29 Eggs_ 6ct 0079 6.00 Eggs_12ct 4302 2.49 Milk iqt 59004 2.99 Bread wheat Column 1 is the item name, column 2 is the item code, and column 3 is the price in dollars. Implement your logic within a class GroceryBill. The class should have the following public member functions . GroceryBill: the constructor void readFile (string filename): a function which takes in the filename of the e data to its member variables. You should complete reading of pricelist an the file in this function (i.e., do not read the file outside this function) bool isValid(int itemcodes [ ], int nitems) : given an array of item codes return true if ALL the item codes are valid (i.e., appeared in the text file); it should return false otherwise. For example, if the array is: [34302, 10078, 34302], it should return true. ic member functions will be called from the provided main program and the answers ese publ rinted ther Th e (see file part2.cpp - do not change the contents of this file) empty file is provided) Item codes are integers Note that item codes can be repeated when scanning . You must implement all your code in one header file called GroceryBil1.h (an Simplifying assumptions: . Item names are a single word without spaces . Price is a float You do not need to do any error-checking when reading the data file

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Build It For The Real World A Database Workbook

Authors: Wilson, Susan, Hoferek, Mary J.

1st Edition

0073197599, 9780073197593

More Books

Students also viewed these Databases questions