




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





FINAL Exercise
Student Name: ______________________________
Student ID: ______________________________
if (x % 3 == 0) cout << "x is a multiple of 3"; else
cout << "x is NOT a multiple of 3";
for (TempF = 0; TempF <= 100; TempF += 10) { TempC = (TempF - 32.0) * 5.0 / 9.0; cout << TempF << " " << TempC << endl; }
x = 1; product = 1; while (x <= 8) { product *= x; x += 2; }
int map[ROWS][COLS]; int numRows; int numCols; }; bool find (const bitmap s, const int val, int &row, int &col);
a) The code below is the body of the implementation of member function get(). What is the error in it, and why is it an error? // body of function get() {
count += increment; return count; };
b) Implement the constructor for Cjar. It should set increment to 1, count to zero, and label to "?????".
c) Assume Cjar is correctly defined/implemented. The following code is from a client of the Cjar class. If there are errors, identify them. All required include files have been included. // code from client of Cjar const Cjar jar1; Cjar jar2; cout << jar1.get() << jar2.get(); jar2.set("Pickles");
int main() { Customer john; cout << "Enter customer ID number" << endl; cin >> _____________________; cout << "Enter customer first and last name" << endl; cin >> _____________________ >> _____________________; return 0; }
product = 1; while (x <= 5) { product *= 2; x += 2; }
int incrementNum (const double &a) { return (a += 2); }
void readstring (string s) { cout << "Enter a string: "; cin >> s; }
int sumOf (const int num1, const int num2) { cin >> num1; cin << num2; // ā>>ā sum = num1 + num2; return; }
void swap(double a, double b) { double temp; temp = a; a = b; b = temp; }
void mystery (double a[], int n) { for (int i = n-1; i>=0; i--) cout << a[i] << endl; return; }
void mysteryprint (int last, int current) { int temp; if (current < 10) { cout << current << endl; temp = current + last; mystryprint(current, temp); } }