Lots of files to submit. The first 4 submissions essentially represent a tutorial which you will follow in kind of a cookbook fashion. Most of the code is provided and you can copy and paste that. You...

1 answer below »


Lots of files to submit. The first 4 submissions essentially represent a tutorial which you will follow in kind of a cookbook fashion. Most of the code is provided and you can copy and paste that. You will need to make adjustments. Many of the exercises require written answers to questions. Carefully read the instructions so that your submissions are complete. The last 2 submissions will be programs that you will create from scratch.



You will need to submit:




  • The source code for the Module 8 Lab Part 1 Ex 1– Name this file “yourNamePart1Ex1.cpp."


  • The source code for the Module 8 Lab Part 1 Ex 2– Name this file “yourNamePart1Ex2.cpp."



  • The source code for the Module 8 Lab Part 2 Ex 3– Name this file “yourNamePart2Ex3.cpp."


  • The source code for the Module 8 Lab Part 2 Ex 4– Name this file “yourNamePart2Ex4.cpp."


  • The source code for the Module 8 Lab Part 3 PP 3 - Name this file “yourNamePart3PP3.cpp."


  • The source code for the Module 8 Lab Part 3 PP 4 - Name this file “yourNamePart3PP4.cpp."



  • TEST RUN - Copy the test run output from your program and paste it to the bottom of your source code. Make each line a comment so that all you need to do is submit your source code and your output will be at the bottom of your program. Also copy any answers to written questions to the bottom of the source file to which the question applies.






Answered 4 days AfterOct 22, 2021

Answer To: Lots of files to submit. The first 4 submissions essentially represent a tutorial which you will...

Sathishkumar answered on Oct 26 2021
102 Votes
yourNamePart1Ex3.cpp
yourNamePart1Ex3.cpp
#include
#include
using namespace std;
double PI = 3.14159;  // This variable is defined globally, known to all functions in this program as PI
double cross_area(double r);  // Function prototype for fu
nction cross_area
double side_area(double r, double h);  // Function prototype for function Side_area
double total_area (double c_area, double s_area);
int main(void)
{

      double h, r;  //variables local to the main function
      cout << "Enter the radius and the height of the cylinder in Cm  ";
      cin >> r >> h;
      cout << endl;
      cout << "Before I do any computation or call any function, I want to let you know that \n";
      cout << "you have entered r = " << r << " and h = " << h << "." << endl;
      cout << "I am planning to use inch, thus in the first function, I will convert r, and " << endl;
      cout << "in the second one I will convert h \n";
      cout << "The cross section area of the cylinder is " << cross_area(r) << "  inch-sqr" << endl;
      cout << "The side area of the cylinder is " << side_area(r,h) << " inch-sqr \n\n";

      cout << "The Total area of the cylinder is " << total_area(cross_area(r), side_area(r,h)) << " inch-sqr \n\n";


      return 0;
}
double cross_area(double r)
{
     //Cross secion area includes the disks at the bottom and the top
      r = r * 0.3937;  // converting r to inch
      return 2*PI*pow(r,2);
}
double side_area(double r, double h)
{
      double area; //variable local to Side_area function
      h = h * 0.3937;  // converting h to inch
      r = r * 0.3937;   ////// ******************************* I added
      area = 2*PI*r*h;
      return area;
}
double total_area(double c_area, double s_area)
{
      double area;
      area = c_area + s_area;
      return area;
}
/*
The answer should be:
      The cross section area of the cylinder is 3.8955634 c
      The side area of the cylinder is 19.474819  inch-sqr
Did you get the same answer?  Explain the reason for such an error and fix the problem.
No
Converted r to inch in function side_area
*/
/* Output
Before I do any computation or call any function, I want to let you know that
you have entered r = 2 and h = 10.
I am planning to use inch, thus in the first function, I will convert r, and
in the second one I will convert h
The cross section area of the cylinder is 3.89556  inch-sqr
The side area of the cylinder is 19.4778 inch-sqr
The Total area of the cylinder is 23.3734 inch-sqr */
yourNamePart1Ex4.cpp
yourNamePart1Ex4.cpp
#include
#include
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here