Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi , there hope ur doing well below i have mention 19 and 25 with short simple option , wanna see if u think of

Hi , there hope ur doing well below i have mention 19 and 25 with short simple option , wanna see if u think of a same option as me, i have included the codede need below to get the anserr
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
4
61
99
12
66
47
47
40
19
3
22
97
25
1
25
17
74
24
34
36
2
30
3
24
2
13
63
86
84
2
88
75
49
24
85
33
73
62
37
23
13
83
33
89
41
23
59
73
80
90
26
66
36
9
8
2
46
33
35
91
29
70
4
39
26
79
49
50
99
64
3
23
3
94
95
74
77
16
20
85
73
91
95
59
10
26
37
4
92
43
75
52
99
22
91
2
80
46
64
83

Question 25)))))

Download the file named "file1.txt" in the folder "Files Needed For Coursework Exam 2Folder". Then run the following piece of code, which reads in data from the file, sorts it and searches for a particular number using the binary search algorithm:

#include
#include
using namespace std;

int binarySearch(int arr[], int value, int left, int right)
{
int count = 0;
while (left {
count++;
int middle = (left + right) / 2;
if (arr[middle] == value)
{
cout return middle;
}
else if (arr[middle] > value)
right = middle - 1;
else
left = middle + 1;
}
cout return -1;
}

void selectionSort(int arr[], int n) {
int i, j, minIndex, tmp;
for (i = 0; i minIndex = i;

for(j = i + 1; j if(arr[j] minIndex = j;
}
if (minIndex != i) {
tmp = arr[i];
arr[i] = arr[minIndex];
arr[minIndex] = tmp;
}
}
}

int main()
{
ifstream input("file1.txt");
const int size = 100;
int list[size];
for (int i = 0; i input >> list[i];
selectionSort(list, size);
int number = 16;
cout int pos1 = binarySearch(list, number, 0, size-1);
cout return 0;
}

Question 19))))

The Employee base class, the derived classes Sales and Technician (their definitions and implementations) and the test program testEmployee.cpp can be found in "Files Needed For Coursework Exam 2Folder". Download the files and inspect them.

Which of the following are features of the classes and their use in this example?

Select one or more:
a.

pointer-returning function(s)

b.

polymorphism

c.

dynamic objects

d.

file input/output

e.

inheritance

f.

dynamic binding

g.

string streams

h.

dynamic array

i.

generic function(s)

j.

static member(s)

inaoect then. Which of the folbwing are features of the classes and their ust in thin easpiel. select ose or more: a. painter-nesining tanstiaria b. Doberoprokism c. Ityarnic shects d. Nis inputroutput 1. inherkaned 14 dyarrie thedmy g. siring wrearta h. dyarric atray I. peneric favenonisi I stakic nembertaI algorithen Mot ires Finclude eipeterearo finclide etctuam, wing namespace stat. int bonarysearchoes arril. int wave, isc ieft, ins rigul 1 Felt seiectiensortant arpli. int ni 1 . lets in minindes, iaver, for (q(i+a=ti+)f miripden = i Nary =i+1;i=f(i ilintili nalectionSogtipt, sizekis int number a 16 . cout se whearching for number " es number ec end. int most a binarysearchoin, nember, 0 , siev-11; rebist 0 How many steps are taken in the search algorithm to find the number 73 ? (Hint: check the output from the program, it will tell you how many steps were taken). Select one: a. 3 b. 7 c. 12 d. 1 e. 5 f. Number 73 is not found g. 4 11:59 Employee \#ifndef EMPLOYEE_H \#define EMPLOYEE_H \#include \&string> using namespace std; class Employee \{ protected: string name; int salary; public: virtual Demployee(); void setiname(string); virtual void setSalary(); string getName(); int getSalary(); virtual void giveRaise(); \}; \#endif

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

Advances In Knowledge Discovery In Databases

Authors: Animesh Adhikari, Jhimli Adhikari

1st Edition

3319132121, 9783319132129

More Books

Students also viewed these Databases questions

Question

How satisfied are you with this attitude?

Answered: 1 week ago

Question

Where is your key public located geographically?

Answered: 1 week ago

Question

What is the socioeconomic status of your key public?

Answered: 1 week ago