Simple textual table defining catalogues of retail store

Assignment Help Computer Engineering
Reference no: EM1332151

Consider a simple textual table describing the catalogues of retail stores, with a line for each product offered by a store, like

Argos Barbie 6.99
Argos PS2 159.99
Hamleys Barbie 16.99

Each line consists of three words: a vendor code, a product code and the price of that product from that vendor (a floating point number).

Define a class to hold the catalogue record.

Write a function to read a series of catalogue records from a file into a vector of catalogue objects. You will need to use the class ifstream, which is derived from istream, like so:
#include <fstream>
...
ifstream in("catalog");
... istream operations ...

The constructor opens the file; you can then test in to see whether it succeeded.

Write a main program that reads from standard input a series of lines describing orders, like
Barbie 200
PS2 1
Barbie 2

where each line consists of two words: a product code (as in the catalogue file) and a requested quantity (a whole number).

For each input line, the program should produce on the standard output a line for each store stocking that product, combining the information from both records. For example, the above inputs might result in

Barbie 200 Argos 6.99
Barbie 200 Hamleys 16.99
PS2 1 Argos 159.99
Barbie 2 Argos 6.99
Barbie 2 Hamleys 16.99

If there are no store records for a particular vendor, there will be no output for that line.

Reference no: EM1332151

Questions Cloud

Modify a single program using control structures : For your strength of materials course you will write down a single program using control structures(including nested loops)and file I/O to explore the deflection of the cantilever beam with a point load at the free end.
The airline industry using excel solver : During the month of July, Pittsburgh resident Bill Fly must make 4 round-trip flights between Pittsburgh and Chicago. These are the dates of the meetings Bill must attend:
How many units of the contract will the agent buy : Suppose a risk averse agent. Explain how many units of the contract will the agent buy if the price is q=k.
Organizational structure employed by the organization : Analyze the reason for the type of organizational structure employed by the organization
Simple textual table defining catalogues of retail store : make a function to read a series of catalogue records from a file into a vector of catalogue objects. You will need to use the class ifstream that is derived from istream, like so.
Buy or sell the commodity depending on its cost : This customer can buy or sell the commodity depending on its cost.
Create a function definition called addarray : Write down a function definition called addarray that takes two parameters- one an array as an int and the other an int that contains the number of elements of the array. The function would return the sum of the number of elements of the array as ..
Make a function definition called backward : build a function definition called backward, with three parameters, the first and second parameters are arrays of integers of equal size and the third is an integer indicating the size of each array.
Make a function definition called reverse : Write down a function definition called reverse, with two parameters, the first is an array of integer and the second is the number of elements in the array. The function reverses the elements of the array and does not return a value.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Why computers and software used to better our society

why computers and software used to better our society.

  Generate the tables attach the primary key and foreign key

Generate the tables attach the primary key and foreign key

  Use a database in this fashion ebay

however there is great risk in implementing a database in this fashion Ebay gained an extreme performance boost because the database didn't have to work as hard to ensure that the data "conformed."

  Program on inline internal procedures deposit and withdraw

Program on Inline internal procedures deposit and withdraw.

  Select which currency they wish to display

Expand the "Currency Conversion" program to have a menu of five currencies that allows the user to choose which currency they wish to show in its equivalency to the US dollars.

  Explain the situation in terms of pci compliance standard

On your exit, a store employee asks to give your receipt and checks all the contents of the store bag. Document each of the above described events that are described and explain them in terms of PCI compliance standard.

  Implementing the sql query

Employees relation describes pilots and other kinds of the employees as well; every pilot is certified for some aircraft, and only pilots are certified to fly. Write down each of following queries in SQL.

  Find out another design pattern for web based development

There are other design patterns that could be directly applicable to PHP programming, or web programming in general.

  Complete the design wlan based on ieee 802.11

Explain why 802.11b, is the first widely popular standard and still by far most used by the IT industry today.

  Designing program

Write down a Program that lets the user enter an amount as a float value representing a total in the dollars and cents.

  Which applications are not particularly well-suited

Which of these applications are well-suited for the minimalist Internet multicast service model? Why? Which applications are not particularly well-suited for this service model.

  Find minimal cover and identify all possible candidate keys

Find minimal cover and identify all possible candidate keys - Functional Dependencies

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd