Question: Can you please help me with the following assignment with all the questions that need to be answer. In this lab, you'll learn how to

Can you please help me with the following assignment with all the questions that need to be answer.

Can you please help me with the followingCan you please help me with the followingCan you please help me with the followingCan you please help me with the followingCan you please help me with the followingCan you please help me with the followingCan you please help me with the followingCan you please help me with the followingCan you please help me with the followingCan you please help me with the followingCan you please help me with the followingCan you please help me with the followingCan you please help me with the following
In this lab, you'll learn how to define and use your own functions. Important Links: o CS110 Lab Material o Lab 8 Notes and Exercises o Links to videos can be found on the CS110 Labs pages Deliverables: 1. Exercise 1: Screenshots show four runs with the following inputs: an even positive number an odd positive number sored ae an even negative number 4. an odd negative number 2. Exercise 2: o Screenshots show two runs with two different numbers. 3. Exercise 3: Screenshots show the run with similar outputs to the sample run in the exercise description. e After finishing all exercises, submit ex1_is_even.cpp, ex2_functionP.cpp, ex3_average.cpp, and all your screenshots Value Parameter Exercise: isEven Create ex1_is_even. cpp with the following code in the Visual Studio project or copy the following code into your IDE: // Program to test "is_even" function. 5 #include 6 using namespace std; void is_even(int); // Function Prototype 10 11 12 int main( ) 13 14 int num; 15 16 cout > num; 18 cout 10 #include 11 using namespace std; 12 13 /* ADD: the function prototype for printStars */ 14 15 int main( ) 16 { 17 int numOfStars; 18 19 cout > numOfStars; 21 22 while (numOfStars > 0) 23 24 25 /* ADD: code to invoke function *printStars* */ 26 /* ADD: code to update the control variable *numOfStars+ */ 28 30 31 return 0; 32 } 33 34 35 36 void printStars (int num) 37 { 38 /* ADD: code to print the *num+ of stars in a line by using a loop*/ 39 } Copy Code The purpose of this program is to practice using user defined functions. Complete the Program . Read the program and add code to complete it. . Compile and run this C++ program. . Test it with different at least two different numbers of stars. When you are done: . Take a screenshot of your IDE and console window after compiling and then running the program with two different numbers. For this exercise, you will have: ex2_functionP. cpp. . Complete all the exercises in this lab and upload the .cpp files and screenshots for the output.Value Returning Function Exercise: avg() In this exercise you will practice writing and using value returning functions by writing a C++ program that asks the user to enter five integer marks, uses a function to calculates the average of the five marks, then prints the average. Create a C++ program named ex3_average. cpp in the Visual Studio project or create it in your IDE. Declare 5 integers in main(). Prompt for and read five integer marks in main(). Write and use a value returning function with five integer parameters to calculate and return the average to the calling function, main(). Here is a partial prototype for you to use: avg(int, int, int, int, int); Be sure the calculation in the function produces decimal places for a more precise average. You must determine a return type that will preserve those decimal places. Print the average in the main() function. Compile and run the C++ program. Test the program with an input guaranteed to produce decimal places. For example: Please enter 5 integer marks: 12111 The average of those marks is: 1.2 When you are done: e Take a screenshot of your IDE and console window after compiling and running the program. For this exercise, you will have: ex3_average. cpp. If you have completed everything, congratulations! Please upload .cpp files and screenshots to URCourses. In this lab, you'll continue to learn how to work with functions that return values using the "return" keyword and using reference parameters. Important Links: o CS110 Lab Material o Lab 9 Notes and Exercises o Links to videos can be found on the CS110 Labs pages Deliverables: e Lab 9 has two options: 1. finish ex1-2 2. finish ex3 Use this link to submit option 1 only. 1. Exercise 1: o Screenshots show one run with the following inputs: 7.88 and 6.3. 2. Exercise 2: o Screenshots show two runs with your own inputs. e After finishing this option, submit ex1_area.cpp, ex2_calcPay.cpp, and all your screenshots to the In this lab, you'll continue to learn how to work with functions that return values using the "return" keyword and using reference parameters. Important Links: o CS110 Lab Material o Lab 9 Notes and Exercises o Links to videos can be found on the CS110 Labs pages Deliverables: e There are two options: 1. finish ex1-2 2. finish ex3 Use this link to submit option 2 only 1. Exercise 3: o Screenshots one run similar to the Sample Program Output in the Lab exercises note. e After finishing this option, submit ex3_metabolic.cpp and all your screenshots Function Practice Exercise: Rectangle Areas Create C++ program ex1_area. cpp with the following code in the Visual Studio project or copy the following code into your IDE: #include using namespace std; W // Function prototypes : 8 void getValues (double &, double &) ; 10 float computeArea (double, double) ; 11 12 void printArea (double) ; 13 14 15 int main( ) 16 { 17 float length, width, area; 18 19 cout mass o at- ambient temperature > cp - chamber pressure pre - concentration of ambient air (pre-animal) post - concentration of ambient air (post-animal) > vaf - rate in which oxygen is pumped into the chamber . Include a void function, called calcVOC(), that takes four parameters and determines voc. . Include a value-returning function, called calcSTP(), that takes three parameters (voc,cp,at) and calculates stp. . Include a value-returning function, called calcMP(), that takes two parameters (stp,mass) and calculates mp. . Include a function, called printMetPower(), that takes seven parameters and prints an appropriate concluding message on the screen. . Use function coding style as shown in lab: use function prototypes and use reference parameters only where necessary. . Use meaningful variable names, proper indentation, and appropriate header and in-line comments. . Use the output format and style shown in the sample run below. Demonstrate that your program works using the squirrel example above. Sample Program Output This program computes the metabolic power of mammals and reptiles. Please input the mass of the animal: 30 Please input the ambient temperature: 5 Please input chamber pressure: 756 Please input concentration of oxygen in ambient air (pre- animal): 0.2095 Please input concentration of oxygen in ambient air (post- animal): 0.2092 Please input the rate of oxygen: 6000 The mass of the animal is 30 grams. The ambient temperature is 5 degrees. The chamber pressure is 756 mmHG. The concentration of ambient air (pre-animal) is 0.2095. The concentration of ambient air (post-animal) is 0.2092. The rate of oxygen is: 6000 mL/hr. The metabolic power for this mammal or reptile is 0.4141. When you are done: e Take a screenshot demonstrating either: Visual Studio: 3 out of the 4 Input/Ouput tests are successful. o Other IDEs: a sample run with the squirrel test data shown in this exercise. e For this exercise, you will have: ex3_metabolic. cpp. e If you have completed this exercise, congratulations! Option 2 is complete! Please upload .cpp file and screenshots to

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!