Q1 if 5 Points Given an integer num, write C++ 'if' conditions corresponding to each of the following sets (2.5 points e
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Q1 if 5 Points Given an integer num, write C++ 'if' conditions corresponding to each of the following sets (2.5 points e
Q2.3 4 Points Suppose your program as following: #include <iostream> using namespace std; int main() { } const int balance = 3000; balance + balance * 0.05; cout << "Next year balance with the rate of 5% is: " << balance << endl; Upon compiling the above program and running the executable file, what is the output on screen (2 points)? Please explain why (2 points)? Enter your answer here Save Answer Q3 Vector 20 Points Q3.1 max 10 Points Given an array of int numbers, write a function that return the maximum value of that array. Function prototype is provided below. E.g., 1: (3, 5, 7, -9, 100, 0, -20) 0:100 int maxArr(vector<int> arr); // you can test your code in main function like this int main(){ } vector<int> arr = {3, 5, 7, 9, 100, 0, -20}; cout << maxArr(arr) << endl; NOTES: 1. You only need to put the maxArr function in the answer box (no need for main function). If you use some given functions from C++ libraries, please let me know what headers you include. 2. You need to make sure that your provided code works. The best way to do it is write your code in your computer, make sure it compiles and run properly, then copy then maxArr function and paste it in the answer box. Enter your answer here Save Anewar