Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use the unorderedArrayListType.h and arrayListType.h from the book and add the min() function as specified. the arrayListType has a pure virtual min() function and the

Use the unorderedArrayListType.h and arrayListType.h from the book and add the min() function as specified. the arrayListType has a pure virtual min() function and the unorderedArrayListType contains the min() function and its definition.

  1. Do not change anything in the supplied code below that will be the Ch12_Ex9.cpp except to add documentation and your name.
  2. Please use the file names listed below since your file will have the following components: Ch12_Ex9.cpp given file

    //Data: 18 42 78 22 42 5 42 57

    #include #include "unorderedArrayListType.h"

    using namespace std;

    int main() { unorderedArrayListType intList(25);

    int number;

    cout << "Enter 8 integers: ";

    for (int count = 0; count < 8; count++) { cin >> number; intList.insertEnd(number); }

    cout << endl; cout << "intList: "; intList.print(); cout << endl;

    cout << "The smallest number in intList: " << intList.min() << endl; system("pause"); return 0; }

    arrayListType.h arrayListType.Imp.cpp unorderedArrayListType.h unorderedArrayListTypeImp.cpp

  3. Add the function min as an abstract function to the class arrayListType to return the smallest element of the list.
  4. Also, write the definition of the function min in the class unorderedArrayListType and write a program to test this function.

here is what i try to do but got lots of error, please use visual studio.

include #include #include "unorderedArrayListType.h" #include "arrayListType.h" using namespace std; class unorderedArrayListType { virtual void min(int);//creating function min in class void print(); }; //class unorderedArrayListType.h #include #include using namespace std; //#ifndef unorderedArrayListType_H //#define unorderedArrayListType_H //#include "arrayListType.h" class unorderedArrayListType : arrayListType { public: int a[10], i; unorderedArrayListType() { i = 0; } void insertEnd(int n) { a[i] = n; i++; } int min() { int m = a[0]; int j; for (j = 0; j { if (a[j] > m) { m = a[j]; } } return m;

} void print() { for (int j = 0; j cout << a[j] << endl; } }; //arrayListType.h #include #include using namespace std; //#ifndef arrayListType_H //#define arrayListType_H class arrayListType { public: int min(); };

class//arrayListType.cpp #include #include using namespace std; #include "arrayListType.h" //#endif

yes

write min functions

just follow the solution I post it i am in right way but couldn't fixed the problem, this is c++

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2018 Dublin Ireland September 10 14 2018 Proceedings Part 1 Lnai 11051

Authors: Michele Berlingerio ,Francesco Bonchi ,Thomas Gartner ,Neil Hurley ,Georgiana Ifrim

1st Edition

3030109240, 978-3030109240

Students also viewed these Databases questions