Write a C++
Program Plan:
An inline function circleArea() is defines to calculate the area of circle.
Variable radiusValue is used to save the value of radius entered by user.
Program Description: Purpose of the program is to define an inline function circleArea() to calculate the area of circle. The formula used to calculate area of circle is =II×r2.
Explanation of Solution
Program: Following is C++ Program that prompt user to enter radius of circle calculates area of circle by calling inline function circleArea.
//include necessary header files #include <iostream> usingnamespace std; /*The inline function circleArea is defined which takes input argument radius and calculates the area of circle */ inlinedoublecircleArea( constdouble radius ) { // formula for Radius = pi * ( radius ^ 2 ) return (3.14) * radius * radius; } //start of main method intmain() { // Declare variables to store the value of radius doubleradiusValue; // Prompt user to enter the value of radius cout<<"\nEnter the radius of your circle: "; // read the value of radius from user cin>>radiusValue; // calculate the area of circle and finally display the result cout<<"Area of circle with radius "<<radiusValue<< " is "<<circleArea( radiusValue ) <<endl; }//end of main
Explanation:
The given C++ program calculates the area of circle using inline function.
- Import the essential header and initialize the main() function.
- Define inline function circleArea with radius as argument.
- Declare variable radiusValue for radius of the circle.
- Formula used to calculate the area of circle is =?×r2.
- Prompt user to enter the radius of circle.
- Calculate and finally display the output.
Sample Output:
Want to see more full solutions like this?
Chapter 15 Solutions
EBK C HOW TO PROGRAM
Additional Engineering Textbook Solutions
Elementary Surveying: An Introduction To Geomatics (15th Edition)
Starting Out with Python (4th Edition)
Management Information Systems: Managing The Digital Firm (16th Edition)
SURVEY OF OPERATING SYSTEMS
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Electric Circuits. (11th Edition)
- make a screen capture showing the StegExpose resultsarrow_forwardWhich of the following is not one of the recommended criteria for strategic objectives? Multiple Choice a) realistic b) appropriate c) sustainable d) measurablearrow_forwardManagement innovations such as total quality, benchmarking, and business process reengineering always lead to sustainable competitive advantage because everyone else is doing them. a) True b) Falsearrow_forward
- Vision statements are more specific than strategic objectives. a) True b) Falsearrow_forwardThe three components of the __________ approach to corporate accounting include financial, environmental, and social performance measures. Multiple Choice a) stakeholder b) triple dimension c) triple bottom line d) triple efficiencyarrow_forwardCompetitors, as internal stakeholders, should be included in the stakeholder management consideration of a company and in its mission statement. a) True b) Falsearrow_forward
- At what level in the organization should the strategic management perspective be emphasized? Multiple Choice a) throughout the organization b) from the bottom up in an organization c) at the top of the organization d) at the middle of the organizationarrow_forwardA good manager can be flexible when it comes to sticking to the original plan; to get good results, the intended strategy has to become the realized strategy. a) True b) Falsearrow_forward________ tend to be quite enduring and seldom change. Multiple Choice a) Strategic objectives b) Vision statements c) Strategic plans d) Mission statementsarrow_forward
- The idea that organizations are not only accountable to stockholders but also to the community-at-large is known as social responsibility. a) True b) Falsearrow_forwardAmong the leaders needed for an effective strategic management process are ________, who, although they have little positional power and formal authority, generate their power through the conviction and clarity of their ideas. Multiple Choice a) executive leaders b) triple bottom line advocates c) internal networkers d) local line leadersarrow_forwardI would like to get help to resolve the following casearrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,