Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with this C++ program. I'm wanting to learn so I would prefer relatively non-complex code but anything is fine to help me understand.

Need help with this C++ program. I'm wanting to learn so I would prefer relatively non-complex code but anything is fine to help me understand.

Create a program that will assign a random number to each seat in a classroom. The program should work for a classroom of any size, so your solution must use a 2-dimensional dynamic array. The main program should ask the user for the size of the classroom (number of rows along with number of seats per row) and the largest maximum number to be generated. Numbers generated will be in the range [1..MAX].

The program should continue asking for user input until valid data has been entered. For example, if the user entered 3 rows by 5 students per row and a maximum value of 10, it wouldnt be possible to generate unique numbers for each student. When the data is valid, allocate the space for your 2-D dynamic array.

The program needs to call four functions below the main:

  • One to generate the data and store it in the array. Be sure you dont repeat any numbers
  • Display the data in a tabular format
  • Display the smallest, largest, and mean value
  • Free up the memory that was allocated to the array

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

Students also viewed these Databases questions

Question

What are the four types of initiatives suggested in this chapter?

Answered: 1 week ago

Question

Design a training session to maximize learning. page 296

Answered: 1 week ago

Question

Design a cross-cultural preparation program. page 300

Answered: 1 week ago