C++ CST 280 Week 2 Practice 2A

Feb 3rd, 2012
Studypool Tutor
Delta College
Course: CST280
Price: $10 USD

Tutor description

CST 280 In-Class Practice – Week 2 Access the following files from the course web materials via code ty4a: data file listWork.cpp data file list1.txt data file list2.txt Create a new Visual C++ project. Additional required algorithms can be accessed from the course web page, development on the board, and below. All algorithms exist – none have to be developed from scratch. In its current form, this program will read two lists into arrays and display them. Using the examples discussed in class, perform the following actions on the two lists. 1) Display both lists (DONE) 2) Reverse the order of List 1 3) Remove duplicates from List 2 (key in algorithm below) 4) Display both lists 5) For List 1: insert values 14 and 24, and delete the value 11 6) Merge List 1 and List 2 together into List 3 7) Display combined list: List 3 A new function is provided below that will remove any duplicates within an ordered list of values. This code below will need to be keyed into your program. /**********

Word Count: 986
Showing Page: 1/6
// CPPWeek2Practice2B.cpp //#include "stdafx.h"//******************************************************************// CST 280 In-Class List Algorithm Practice //******************************************************************#include #include using namespace std;const int MAX_LIST_SIZE = 100; // Max list size// Function prototypesvoid GetList(int inList[], int& listsize, int maxlistsize, ifstream& inFile);void DisplayList(int theList[], int listsize);void ReverseList(int theList[], int& numItems);void RemoveDuplicates(int theList[], int& listSize);void MergeList(int List1[], int &list1_size, int List2[], int &list2_size, int List3[], int &list3_size);int Merge(int List1[], int list1_size, int List2[], int list2_size, int List3[]);void MergeSort(int inList[], int listsize);void DeleteValue(int inList[], int& listsize, int newint);void InsertValue(int inList[], int& listsize, int newint);int _tmain(int argc, _TCHAR* argv[]){cout << "Assignment 7: YOUR_NAME(S)_HERE" << endl << endl;int List1[MAX_LIST_SIZE], List2[MAX_LIST_SIZE], List3[MAX_LIST_SIZE], ScratchList[MAX_LIST_SIZE];int list1_size, list2_size, list3_size;// Read both input lists from files ifstream inList1("list1.txt");GetList(List1, list1_size, MAX_LIST_SIZE, inList1);ifstream inList2("list2.txt");GetList(List2, list2_size, MAX_LIST_SIZE, inList2);// Display list 1 cout << "List 1 (initial): " << e

Review from student

Studypool Student
" Wow this is really good.... didn't expect it. Sweet!!!! "
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1821 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