
Concept explainers
define keyword is used to define macros
An object-like macros is defined i.e.
#define pi 3.14
A function-like macros is defined i.e.
#define VOL( x ) ( 4.0 / 3 ) * pi * ( x * x * x )
Variable r is declared to store the value of radius.
printf (): used to print the data onto output screen.
Program Description: Purpose of the program is to define macros tofind the volume of sphere for radius values ranging from 1 to 10 in tabular form.

Explanation of Solution
Program: Following is C++ program that defines macros to find the volume of sphere for radius values ranging from 1 to 10.
#include<stdio.h>//header file for input output //defining macros #define pi 3.14 #define VOL( x ) ( 4.0 / 3 ) * pi * ( x * x * x ) //start of main intmain() { //defining variable for storing value of radius int radius; //tabular reprsentation of data printf( "Radius\tVolume of sphere\n" ); printf( "\n" ); //for loop to iterate over the value of radius ranging from 1 to 10 for (radius = 1; radius < 11; radius++ ) { printf( "%d\t%f\n", radius, VOL( radius ) ); } }//end of main
Explanation:
The given C++ program calculates the volume of sphere.
For declaring the macros statements the define keyword is used for VOL(x) and pi.
Then using the for loop to iterate over the radius variable from 1 to 10 and to print one by one via “\n”. The “\t” is used to print six spaces between the radius and their volume.
Sample Output:
Want to see more full solutions like this?
Chapter 13 Solutions
EBK C HOW TO PROGRAM
- The mail merge process has ____ steps. Question 19Select one: a. five b. six c. seven d. eightarrow_forwardIf you created a main document based on an existing document entitled "Confirmation Letter," what default filename would Word give the main document? Question 14Select one: a. Confirmation Letter-1 b. Confirmation Letter-merge c. Document1 d. MergedDocument1arrow_forwardClick the ____ option button in the Mail Merge task pane to use an Outlook contact list as a data source for a merge. Question 11Select one: a. Use Outlook contacts list b. Select from Outlook contacts c. Select Contacts d. Mail Merge Recipientsarrow_forward
- A(n) ____ cannot be selected as the document type in the Mail Merge task pane. Question 9Select one: a. Letter b. Directory c. Fax d. E-mail messagearrow_forwardConsider a Superstore Database which consists of 3 tables, Orders, Returns, and Managers. The CSV files have been provided along with this DOC file in the Midterm 2 Link in the Moodle. Answer the questions as below: Use the created table as in the provided SQL query file, solve the problems as mentioned below. You will have to import the respective CSV files of the above created tables as without them, it is impossible to solve the questions below. If you are not able to upload the files successfully, do not leave the query questions. Just write the query to the best of your knowledge. Do not copy. To be graded for the screenshot answer, you must upload the CSV properly and paste the resulting screenshot of the queries as asked. Write Query to Find out which Product Sub-Category has a sum of Shipping Cost to sum of Sales ratio > 0.03.arrow_forwardI need to render an image of a car continuously for a smooth visual experience in C# WinForms. It gets the location array (that has all the x,y of the tiles it should visit) from another function - assume it is already written.arrow_forward
- write c program with features: Register a Bunny: Store the bunny's name, poem, and initialize the egg count to 0. Modify an Entry: Change the bunny's poem or update the egg count. Delete a Bunny: Remove a registered bunny from the list. List All Bunnies: Display all registered bunnies and their details. Save & Load Data: Store bunny data in a file to persist between runs. Use a struct to represent a bunny contestant. Store data in a binary file (bunnies.dat) for persistence. Use file I/O functions (fopen, fwrite, fread, etc.) to manage data. Implement a menu-driven interface for user interaction.arrow_forwardHelp, how do I write the pseudocode for the findMean function and flowchart for this?arrow_forwardNeed help drawing a flowchart for the findMax function herearrow_forward
- Need help writing the pseudocode for the findMin function with attachedarrow_forwardCreate a static function in C# where poachers appear and attempt to hunt animals. It gets the location of the closest animal to itself. Take account of that the animal also move too, so it should update the closest location (x, y) everytime it moves to a new location. Use winforms to show the movements of poachers.arrow_forwardCreate a static function in C# where poachers appear and attempt to hunt animals. It gets the location of the closest animal to itself. Take account of that the animal also moves too, so it should update the closest location (x, y) everytime it moves to a new location. Use winforms to show to movementsarrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,


