Question: Read a File Into An Array 2. Write a program that reads a file, prices.txt, into an integer array of size 15. The program must

Read a File Into An Array 2. Write a program that reads a file, prices.txt, into an integer array of size 15. The program must have a void function called readPrices that takes in two arguments: an ifstream object for the input file and an integer array. There must also be a void function called displayPrices that takes in an integer array and array size as inputs. The program should display the prices to the user as such:

The prices for the 15 rows are:

$15

$14

$13

$12

$11

$10

$9

$8

$7

$6

$5

$4

$3

$2

$1

//prices.txt

$15 $14 $13 $12 $11 $10 $9 $8 $7 $6 $5 $4 $3 $2 $1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!