Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C + + create a client program ( main ) called lab 1 . cpp . Create a dynamic 1 D array of strings

In C++create a client program (main) called lab1.cpp.Create a dynamic 1D array of strings called "members". Create a dynamic 2D array of integers called "ratings". The rows of the "ratings" array is associated with the members and the columns will associated with the book ratings (which can be values -5,-3,-1,0,1,3,5). Open and read from the "ratings.txt" file (only once!) and populate the members and ratings with all the member and book ratings information read from file. The user must specify the file path for the data file; however, for testing, you can add these files (books.txt and ratings.txt) to your lab1/ project. Download the project files here: p1-files.zip (you will only be using "ratings.txt" for this lab!)Populate the "members" array with the member names and the "ratings" array with that members' ratings.Since the first two lines of the "ratings.txt" file include:Brandon 5000000101-3500055000050000000013010-5005505550550005555-5 Moose 55000030010530503350000050000035000005-30005000000550300...The first two rows of the "members" array will contain:0Brandon1Moose2...And the "ratings" array will contain:012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535405000000101-3500055000050000000013010-5005505550550005555-5155000030010530503350000050000035000005-300050000005503002......The highlighted portions are array indexes. Note: both the "members" array and the 2D "ratings" array will have 86 rows, or the numbers of members listed in the "ratings.txt" file; the "ratings" array will have 55 columns, or the number of ratings listed for each member in the "ratings.txt" file.Print the contents of the "members" array and the "ratings" array.Deallocate memory from the two dynamic arrays.

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

Databases Illuminated

Authors: Catherine M Ricardo, Susan D Urban

3rd Edition

1284056945, 9781284056945

Students also viewed these Databases questions