Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Introduction In this assignment you will write a small C+ program. Your program should compile correctly and produce the specified output. Please note that the

image text in transcribed
image text in transcribed
Introduction In this assignment you will write a small C+ program. Your program should compile correctly and produce the specified output. Please note that the computer program as has been done in class. For example, there should be a header for the whole program that gives the author's name, class name, date, and description. End braces should be commented, and there are alignment and indenting requirements as discussed. Please ask if you have any questions. should comply with the commenting and formatting rules Purpose Demonstrate the ability to use pointers to handle arrays and variable locations, and accomplish dynamic memory allocation Description Write a C++ program to do the following In the main function display a menu to get user's option for: (15 points) A. Create and initialize a dynamic array B. Display statistics on the array C. Search for an element D. Quit The user should choose A first to proceed with the rest of the options. You need to implement some input validation to make sure that A was chosen before any other option (10 points) When A is chosen: (20 points) Ask the user for an integer value, this value will be used as the size of the array that you will create dynamically. Then call a function with the following prototype and description int *createArray (int &size) Dynamically allocate and inialize with random numbers [80,1001) an array of size size. The parameter to this function is a reference variable which will store the size of the array. The function will return a pointer to the dynamically allocated 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

Recommended Textbook for

Beginning C# 2005 Databases

Authors: Karli Watson

1st Edition

0470044063, 978-0470044063

More Books

Students also viewed these Databases questions

Question

Distinguish between formal and informal reports.

Answered: 1 week ago