Answer:
int withinArray(int * intArray, int size, int * ptr) {
if(ptr == NULL) // if ptr == NULL return 0
return 0;
// if end of intArr is reached
if(size == 0)
return 0; // element not found
else
{
if(*(intArray+size-1) == *(ptr)) // check if (size-1)th element is equal to ptr
return 1; // return 1
return withinArray(intArray, size-1,ptr); // recursively call the function with size-1 elements
}
}
Explanation:
Above is the completion of the program.
I'm going have to go with with 1.b and 2.d hope this helps and I don't need help right now.
Booting would be complete if the normal, runtime environment has been achieved. A boot loader is a program that loads operating system for the computer after the completion of power on tests. The boot manager is a program that displays graphics and loading screens during the boot process.
Answer:
The algorithm is as follows;
1. Start
2. Input TeddyBears
3. Input Hours
4. WagebyTeddy = 2 * TeddyBears
5. WagebyHour = 5 * Hours
6. If WagebyHour > WagebyTeddy then
6.1 Print WagebyHour
7. Else
7.1. Print WagebyTeddy
8. Stop
Explanation:
The following variables are used;
TeddyBears -> Number of teddy bears made
Hours -> Number of Hours worked
WagebyTeddy -> Wages for the number of teddy bears made
WagebyHour -> Wages for the number of hours worked
The algorithm starts by accepting input for the number of teddy bears and hours worked from the user on line 2 and line 3
The wages for the number of teddy bears made is calculated on line 4
The wages for the number of hours worked is calculated on line 5
Line 6 checks if wages for the number of hours is greated than wages for the number of bears made;
If yes, the calculated wages by hour is displayed
Otherwise
the calculated wages by teddy bears made is displayed
#include <iostream>
using namespace std;
class CarCounter {
public:
CarCounter();
CarCounter(const CarCounter& origCarCounter);
void SetCarCount(const int count) {
carCount = count;
}
int GetCarCount() const {
return carCount;
}
private:
int carCount;
};
CarCounter::CarCounter() {
carCount = 0;
return;
}
CarCounter::CarCounter(const CarCounter &p){
carCount = p.carCount;
}
void CountPrinter(CarCounter carCntr) {
cout << "Cars counted: " << carCntr.GetCarCount();
return;
}
int main() {
CarCounter parkingLot;
parkingLot.SetCarCount(5);
CountPrinter(parkingLot);
return 0;
}
Sample output:
Cars Counted: 5