Chat with us, powered by LiveChat Dynamic Arrays Write And Test An Array Class Write An Array Application | Writedemy

Dynamic Arrays Write And Test An Array Class Write An Array Application

Dynamic Arrays Write And Test An Array Class Write An Array Application

Question Description
This assignment involves the writing of 2 CPP’s. To it’s clear which CPP goes with which “part” of the assignment, make sure that you have some reference to the part number in your file names (like part1.cpp or testing.1.cpp for example).

Part 1, Write And Test An Array Class [MyDynamicArray.h]
Write and test a data structures template. The resulting template can be used in any program in place of a C++ array.

Requirements. Develop MyDynamicArray.h as you write a test driver with class MyDynamicArray, defined and fully tested. Write the public interface exactly as specified below — do not add to, or change the public interface as specified.

Write the template for an array of 2 values (initially) of unspecified type.
Include a public square bracket getter and setter pair, both with index range-checking, returning whatever value you wish if out of range. But apply capacity auto-adjusting for the setter if out of range high.
Include a public getter named MyDynamicArray::capacity( ) to return the data structure’s now-variable capacity
Include a public setter named MyDynamicArray::capacity(int) to change the capacity.
Do tests with int, double, or char. Also do tests with an object, like string.
Note that there is no good reason to copy the “dummy” value in the dynamic memory management functions, so don’t include it in your testing of const object copy or object assignment.

Part 2, Write An Array Application
Write a C++ console app using your MyDynamicArray template. Use your already-tested and verified H file from part 1.

Exactly as in Lab Assignment 2, this app lets its user enter as many values as they like, and when that process is completed, lets the user look up values by matching index.

In a loop, the app should prompting the user to enter a pair of numbers on the same line: a whole number index and its corresponding floating point value. Do validate index input in the app. Quit the loop when an uppercase or lowercase Q is entered for either the index or the value. Indexes can be entered in any order — they don’t have to start with zero and go up by one thereafter. It’s whatever the user enters.

Your app should keep track of which indexes got entered. Use a bool MyDynamicArray for that.

After all data entry is complete, the app should:

output how many (unique) indexes got entered,
output the list of all used indexes and their values, per the example below, and
implement an event-controlled loop that prompts for an index value and outputs whether the index is in use or not, and if in use, what is the value stored for that index. Loop until the user elects to stop by entering uppercase or lowercase Q.
Here’s a sample of how this should work (user input in blue):

Input an index and a value [Q to quit]: 33 1.2
Input an index and a value [Q to quit]: 4 100
Input an index and a value [Q to quit]: 5 300
Input an index and a value [Q to quit]: x 1.7
Input an index and a value [Q to quit]: 33 120
Input an index and a value [Q to quit]: -1 23.4
Input an index and a value [Q to quit]: 2000 -999.9
Input an index and a value [Q to quit]: q

You stored this many values: 5
The index-value pairs are:
0 => 1.7
4 => 100
5 => 300
33 => 120
2000 => -999.9

Input an index for me to look up [Q to quit]: 33
Found it — the value stored at index 33 is 120
Input an index for me to look up [Q to quit]: 0
Found it — the value stored at index 0 is 1.7
Input an index for me to look up [Q to quit]: -10
Sorry, but there is no value stored at index -10
Input an index for me to look up [Q to quit]: 38
Sorry, but there is no value stored at index 38
Input an index for me to look up [Q to quit]: 10000
Sorry, but there is no value stored at index 10000
Input an index for me to look up [Q to quit]: 2000
Found it — the value stored at index 2000 is -999.9
Input an index for me to look up [Q to quit]: q
Design the prompts and the output formatting as you like. It should work just like your StaticArray from Lab Assignment 2, but with auto-adjusting capacity.

Submit 4 Files
Submit your app CPP and your test driver CPP (named as you wish), and your template H file (named as specified) for grading.Also, submit a word doc with yor code and screen shot of the test

Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.

Do you need an answer to this or any other questions?

About Writedemy

We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.

How It Works

To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Are there Discounts?

All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.

Hire a tutor today CLICK HERE to make your first order