Q1 if 5 Points Given an integer num, write C++ 'if' conditions corresponding to each of the following sets (2.5 points e

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
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

Post by answerhappygod »

Q1 If 5 Points Given An Integer Num Write C If Conditions Corresponding To Each Of The Following Sets 2 5 Points E 1
Q1 If 5 Points Given An Integer Num Write C If Conditions Corresponding To Each Of The Following Sets 2 5 Points E 1 (23.45 KiB) Viewed 28 times
Q1 If 5 Points Given An Integer Num Write C If Conditions Corresponding To Each Of The Following Sets 2 5 Points E 2
Q1 If 5 Points Given An Integer Num Write C If Conditions Corresponding To Each Of The Following Sets 2 5 Points E 2 (52.5 KiB) Viewed 28 times
Q1 if 5 Points Given an integer num, write C++ 'if' conditions corresponding to each of the following sets (2.5 points each). 1.1. num is inside the range [2, 10] (including 2 and 10) and num is odd. Enter your answer here 1.2. num is outside the range [2, 10] (excluding 2 and 10) and num is even. Enter your answer here Save Answer
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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply