Problem: A company has stock of many goods, and they want to filter the stock so that some of the materials can go on sale. The stock information recorded in a file"data.txt" as shown in the sample. (in the following sequence) (item name, price_perunit, profit, months_of_stocking, customer_reviews ) The sale policy of the company depends on many factors according to the following. • if item in stock more than 8 months and item profit is more than average profit of all items o yes - if customer reviews low quality ● yes – sale 50% ● no – if customer reviews medium quality o yes – sale 30% o no – sale 15% o no- if item profit more than 8% of the item price ● Yes – if in stock more than 1 year o yes- sale 40% o no- not on sale ● No - not on sale Write a C++ program that reads the information from “data.txt” input file into 5 arrays, then processes these arrays to produce three arrays, first array holds the items on sale, second array holds percentage of sale , and the third one holds the items without sale. Print these arrays on the screen.
Problem:
A company has stock of many goods, and they want to filter the stock so
that some of the materials can go on sale. The stock information recorded
in a file"data.txt" as shown in the sample. (in the following sequence)
(item name, price_perunit, profit, months_of_stocking, customer_reviews )
The sale policy of the company depends on many factors according to the
following.
• if item in stock more than 8 months and item profit is more
than average profit of all items o yes - if customer reviews
low quality
● yes – sale 50%
● no – if customer reviews medium quality o
yes – sale 30% o no – sale 15%
o no- if item profit more than 8% of the item price
● Yes – if in stock more than 1 year o yes-
sale 40% o no- not on sale
● No - not on sale
Write a C++ program that reads the information from “data.txt” input file
into 5 arrays, then processes these arrays to produce three arrays, first
array holds the items on sale, second array holds percentage of sale , and
the third one holds the items without sale. Print these arrays on the screen.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images