Textual table describing the catalogues of retail stores

Assignment Help C/C++ Programming
Reference no: EM13938686

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: EM13938686

Questions Cloud

Croissantonomics : Question 1Read the article "Croissantonomics" and use the demand and supply model with graphs to demonstrate the changes in the market for croissants at different times of the year. Briefly explain.
Ethical decision-making model : What are the available courses of action now that I have gathered knowledge and information and considered the range of value positions? (accountability)
What exactly will you tell your patient about her condition : What exactly will you tell your patient about her condition and what are your specific concerns about her treatment options at this time?
Mechanism to achieve secure key exchange : In 1976 Diffie and Hellman have suggested their famous protocol for key exchange based on number theory. More recently (around 2002) I. Kanter, W. Kinzel and E. Kanter [1] proposed to use neural networks synchronization by mutual learning as the m..
Textual table describing the catalogues of retail stores : 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:
Calculate the standard fixed overhead rate : Compute the applied fixed overhead and the applied variable overhead. What is the total fixed overhead variance? Total variable overhead variance? Calculate the standard fixed overhead rate and the standard variable overhead rate.
How could you positively affect your profit using sales mix : How could you positively affect your profit using sales mix? What are some ways you can decrease your break-even point?" 3 paragraph
Identify the organs of the respiratory passageways : An essential part of maintaining homeostasis in the body is supplying tissues with oxygen and eliminating carbon dioxide from the tissues. Identify the organs of the respiratory passageways. Then we will examine how Boyle's law relates to the even..
How do you think those disturbances affected fish : Effect of the presence of predator on the prey is to be analyzed - The changes that occur in the eating pattern are to be observed - How do you think those disturbances affected fish? Or do you think they affected osprey? In which ways?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  That reads ten numbers from input and prints

Write a C program that reads ten numbers from input and prints them in reverse order. We assume that the data consists of integers. The program should conform to the following format

  Write a complete c++ program that read

Write a complete C++ program that read in from the key board a string and converts all letters in the string to upper cases. You are not allowed to use topper function.

  Basics of code development on linux and cryptography

Prepare a C program that gives simple mono-alphabetic substitution between plaintext, and Enhance your code to use "-e" to encrypt a string argument and "-d" to decrypt it using argv and argc

  Implements the features of the minesweeper game

The map generator generates a rectangle matrix of 9 rows and 10 columns, and each cell of the matrix contains an integer 0 or 1 only. Such a matrix represents the map of the minesweeper game - write a Windows Console Application that implements mos..

  Prepare a program to print the permutation

write a program to print the permutation that lexicographically precedes the given input permutation. If the given permutation is the lexicographically least permutation, then print the input permutation itself.

  C program to mips program

Convert the following C program to MIPS program. Assuming that i, j, k, f, are stored in registers $s0, $s1, $s2, $s3 already. The base address of arrays A and B are in registers $s4 and $s5, respectively. (30

  Explain the difference between a shallow copy and deep copy

Overload the operator + for the class newString to perform string concatenation. For example, if s1 is "Hello" and s2 is "there", the statement s3 = s1 + s2; should assign "Hello there" to s3, where s1, s2 and s3 are newString objects.

  1 what is the output of the following c programsnbspinclude

1. what is the output of the following c programs?nbspinclude ltiostreamgtusing namespace stdint mainnbspnbspnbsp cout

  Requirements of flyhigh airlines

The development team of SoftSols Inc. has revamped the software according to the requirements of FlyHigh Airlines and is in the process of testing the software. While testing the software, the team encounters the following issues:

  Write program that user ask to enter floating point numbers

Write the following program: The user is asked to enter 2 floating point numbers (use doubles). The user is then asked to enter one of the following mathematical symbols: +, -, *, or /.

  Calculate the celsius equivalent of a fahrenheit temperature

Prepare a program to calculate the Celsius equivalent of a Fahrenheit temperature

  Class mail order

Set up one one-dimensional array for each field: product number (integer), unit price (double), and current inventory level (integer) in main memory to hold the above product information. There should be five rows (0 to 4) in each array, one for e..

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