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

  Build a class hugeinteger which uses a 40-element array

make a class HugeInteger which uses a 40-element array of digits to store integers as large as 40 digits each. Provide methods input, output, add and subtract.

  Potential vulnerabilities in purchasing with a debit card

Recognize any potential vulnerabilities in the act of forming a purchase along with a debit card.

  Pros and cons of application software in business

Operating system software for your personal PC: define What are the differences among Windows OSs

  Straight-line depreciation method calculations

Describe how to carry out the Straight-line Depreciation Method calculations and understand the meaning of elements within the Straight-line formula.

  Write down an application that plays "guess the number"

Write an application that plays "guess the number" as follows: Your application chooses number to be guessed by selecting an integer at random in range 1-1000.

  Modify a program that reads a line of text

Write down a program that reads a line of text, changes each uppercase letter to lowercase, and places each letter both in a queue and onto a stack. The program should then verify whether the line of text is a palindrome.

  What are values of sum1 and sum2

If the operands in expressions are evaluated left to right. If the operands in the expressions are evaluated right to left? Sum1=48, Sum2=46

  Explain computer programming is art or science

Which programming language appeals to you, and which language do you consider least appealing.

  Suppose that it is the largest number so far

make a program to determine the largest number out of 15 numbers entered (numbers entered one at a time). This should be done in a function using this prototype.

  Capability maturity model (cmm) is in software development

For each level in your model, desribe how toidentify the maturity level and what steps are necessary to move to the next level. For each level, specify needs for relevant quality standards and quality management.

  What types on a lan and the type of software licensing

Discuss role of each of the following server types on a LAN and the type of software licensing with which the software should be purchased.

  A function can also be called an inheritance

In computer programming would you say that a function could also be known an inheritance product due to the reuse of it in the program? A while loop that calls the function once the statement is true can be used over and over.

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