72 l l 12:44 s d E Laboratory Activi... AGUSAN DEL SUR STATE COLLEGE OF AGRICULTURE AND TECHNOLOGY College of Engineering and Information Sciences LABORATORY ACTIVITY No.6 1. Consider and study the...


72<br>l l 12:44 s d<br>E Laboratory Activi...<br>AGUSAN DEL SUR STATE COLLEGE OF AGRICULTURE AND TECHNOLOGY<br>College of Engineering and Information Sciences<br>LABORATORY ACTIVITY No.6<br>1. Consider and study the program CircleFunction.cpp, modify the program to allow the user to display a circle's<br>circumference, given its radius. Include the printing of circumference as number 3 selection. Create also a<br>function for circumference.<br>Program Circlefunction.cpp<br>tinclude <<iostream><br>tinclude <cmath><br>using namespace std;<br>double getArea (double rad) ;<br>double getDiameter (double rad) ;<br>int main ()<br>6.<br>10<br>int choice = 0;<br>double radius = 0.0<br>11<br>12<br>cout << *1 circle area> choice; 13 14 15 16 17 18 if (choice <1 ||="" choice=""> 2) cout <« "invalid="" choice"="" «="" endl;="" else="" 19="" 20="" 21="" 22="" 23="" cout=""><>< "enter="" the="" radius:="" ";="" cin="">> radius; if (choice 1) cout < "the="" area="" is:"="">< getarea="" (radius);="" 24="" 25="" 26="" 27="" else="" 28="" cout="">< "the="" diameter="" is:="" "="">< getdiameter="" (radius):="" 29="" end="" if="" 30="" 31="" 32="" 33="" cout="">< endl,="" }="" end="" if="" return="" 0,="" }="" end="" of="" main="" function="" 34="" 35="" **...eunction="" definitions*****="" 36="" double="" getarea="" (double="" rad)="" 37="" 38="" const="" double="" pi="" -="" 3.141593;="" 39="" double="" area="" -="" 0.0;="" 40="" area="" -="" pi="" *="" pow="" (rad,="" 2):="" 41="" return="" area/="" 42="" )="" end="" getarea="" function="" 43="" 44="" double="" getdiameter="" (double="" rad)="" 45="" 46="" return="" 2="" rad,="" end="" getdiameter="" function="" 47="" e4="" -="" computer="" fundamentals="" and="" programming="" ructor:="" j.="" o.="" balolot="" unit="" 7:="" functions="" agusan="" del="" sur="" state="" college="" of="" agriculture="" and="" technology="" ii="" "/="">
Extracted text: 72 l l 12:44 s d E Laboratory Activi... AGUSAN DEL SUR STATE COLLEGE OF AGRICULTURE AND TECHNOLOGY College of Engineering and Information Sciences LABORATORY ACTIVITY No.6 1. Consider and study the program CircleFunction.cpp, modify the program to allow the user to display a circle's circumference, given its radius. Include the printing of circumference as number 3 selection. Create also a function for circumference. Program Circlefunction.cpp tinclude tinclude using namespace std; double getArea (double rad) ; double getDiameter (double rad) ; int main () 6. 10 int choice = 0; double radius = 0.0 11 12 cout < *1="" circle="" area"="">< endl;="" cout=""><« *2="" circle="" diameter"="">< endl;="" cout="">< "enter="" your="" choice="" (1="" or="" 2):";="" cin="">> choice; 13 14 15 16 17 18 if (choice <1 ||="" choice=""> 2) cout <« "invalid="" choice"="" «="" endl;="" else="" 19="" 20="" 21="" 22="" 23="" cout=""><>< "enter="" the="" radius:="" ";="" cin="">> radius; if (choice 1) cout < "the="" area="" is:"="">< getarea="" (radius);="" 24="" 25="" 26="" 27="" else="" 28="" cout="">< "the="" diameter="" is:="" "="">< getdiameter="" (radius):="" 29="" end="" if="" 30="" 31="" 32="" 33="" cout="">< endl, } //end if return 0, } //end of main function 34 35 //**...eunction definitions***** 36 double getarea (double rad) 37 38 const double pi - 3.141593; 39 double area - 0.0; 40 area - pi * pow (rad, 2): 41 return area/ 42 ) //end getarea function 43 44 double getdiameter (double rad) 45 46 return 2 rad, //end getdiameter function 47 e4 - computer fundamentals and programming ructor: j. o. balolot unit 7: functions agusan del sur state college of agriculture and technology ii endl,="" }="" end="" if="" return="" 0,="" }="" end="" of="" main="" function="" 34="" 35="" **...eunction="" definitions*****="" 36="" double="" getarea="" (double="" rad)="" 37="" 38="" const="" double="" pi="" -="" 3.141593;="" 39="" double="" area="" -="" 0.0;="" 40="" area="" -="" pi="" *="" pow="" (rad,="" 2):="" 41="" return="" area/="" 42="" )="" end="" getarea="" function="" 43="" 44="" double="" getdiameter="" (double="" rad)="" 45="" 46="" return="" 2="" rad,="" end="" getdiameter="" function="" 47="" e4="" -="" computer="" fundamentals="" and="" programming="" ructor:="" j.="" o.="" balolot="" unit="" 7:="" functions="" agusan="" del="" sur="" state="" college="" of="" agriculture="" and="" technology="">
Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here