C++ questions

Oct 27th, 2015
Anonymous
Category:
Engineering
Price: $125 USD

Question description

Please note out where in the code is the answer for question 1A-1D, please make question 2 a separate program from question 1. Question 3 should also be a separate program.

All source code for testing and verifying terminal input using !cin.eof() and cin.good() in that order, followed by source code for testing of applications requirements must be present.  Testing of cin.good() need not be done for character or string input.


For question 1 A-D it refers to the BagMenuProg3B_wc.cpp program code http://www.mediafire.com/view/1h999h25hsk1889/BagMenuProg3B_wc.cpp

1.  The BagMenuProg3B_wc.cpp program creates a linked list in which the first item entered is at the end of the list and the last item entered is at the front of the list. Please make a version of the list, which is a linked list within the program’s Heap, in sorted order with the lowest user data value in the front position and the highest is in the last position.  Please make the following upgrades to the program. Please follow the ASCII internal character sequence in which the capital letters precede the small letters.

A.  Create a new menu entry in the main of the program which allows the user to produce this sorted list.

B.  Create an entry in the program’s Container class which implements the production of the sorted linked list as follows:

For B part 1:  This entry will dump the original linked list to a dynamic array, which is then sorted in ascending order.

For B part 2: The sorted array list will then be loaded to a new linked list which retains the sorted order from lowest at the front to highest at the last.

C.  The original list and the array list will then be deleted and the sorted list will replace the original list within the program.

D. Criteria for test data – (1) Input data should be alphanumeric and in any order not ascending or descending, and (2) user enters EOF to terminate input. Please submit your test data sets along with your problem solution.

2.  Now make the program from Question 1 create the linked list in ascending order from the smallest at the top and the largest at the bottom instead of using the reorg procedure which is described in Question 1.  The list is to be created in sorted order dynamically as the individual user data values are entered.  Please do this task by only upgrading the putNode method of the program’s Node class to produce the linked list in sorted order.  Criteria for test data are the same as for problem 1 as expressed in problem 1D.


Question 3 refers to the ArrayListProg4_wClass.cpp code: http://www.mediafire.com/view/qaeka7birxksm4j/ArrayListProg4_wClass.cpp

3.  In the program ArrayListProg4_wClass.cpp the Delete option just deletes the first element in the list named by the user, then compresses the remainder of the array by moving all successors forward by one position and the last occupied position is initialized to a null character string.  Create another menu entry in the program which will allow the user to delete all elements on the list which contain the same data string.  Also, the positions of the elements which have been deleted from the array will be individually compressed as they are found.  The reason for this new menu option is that the user’s personnel have become frustrated by having to run the existing delete menu option multiple times in order to clear all elements which contain the same data string.  Please include your test data set, which should include various string data which need to include multiple occurrences of identical strings.

Tutor Answer

(Top Tutor) Studypool Tutor
School: UT Austin
PREMIUM TUTOR

Studypool has helped 1,244,100 students
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1829 tutors are online

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors