Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE HURRY!!! C++ Language Task 2: Write a function named readInput. (10 marks) a) It receives an array of Item of type struct. b) The

image text in transcribedPLEASE HURRY!!! C++ Language

Task 2: Write a function named readInput. (10 marks) a) It receives an array of Item of type struct. b) The function should read data from the given input text file named input.txt. The file contains items' codes and the number of items sold. Figure 1 shows an example of data that can be used to test the program. c) Assuming you do not know, the number of items. Calculate the number of items sold based on the number of item records found in the input file. d) The function should return the number of items calculated in (c). M101 12 B202 21 C303 15 F404 9 F404 27 C303 25 B202 16 M101 9 M101 14 C303 26 B202 31 F404 13 M101 9 C303 38 B202 33 Figure 1: Sample data in the input file "input.txt

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

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions