Explanation of Solution
Given: The following code:
// Header files.
#include
// Defining the function.
int main()
{
//Function declaration
int funA (int x);
int funB (int x);
//calling the main Function
int main(void)
{
//Local declarations
int a;
int b;
int c;
//Statements
a=10;
funB(a);
b=5;
c=funA(b);
funB(c);
printf("%3d %3d %3d", a, b, c);
return 0;
}
int funA (int x)
{
//Statements
return x*x;
}
void funB (int x)
{
//Local declarations
int y;
//Statements
y=x%2;
x/=2;
printf("\n%3d %3d\n", x, y);
return;
}
To find:Â The structure chart for the following code.
#include
Want to see the full answer?
Check out a sample textbook solutionChapter 4 Solutions
Computer Science: A Structured Programming Approach Using C, Third Edition
- Course: Object Oriented programming Lnaguage: C++ You have to solve the Make the program correctly and in 2 hours. kindly Make program correct as much as you can. Question: Develop a polymorphic banking program using the Account hierarchy in which two types of Accounts can be created i.e.Current Account and Saving Account respectively. Each account must have to give the interest to the bank depending upon their account type. A function of name InterestRate() will calculate the interest of account and returns the interest amount. Current Account has annual interest rate of 0.1% of actual amount and SavingAccount will have to pay interest rate of 1.0% of actual amount. Also write a main function for polymorphic calls of the functions. Note: Polymorphic calls for the functions are necessary. Necessary constructor, Destructors, setters, getters and other functions should also be defined.arrow_forwardIn C/C++, True or False: A variable's type helps define the range of values that can be held by that type. A variable's type helps define the operations that can be performed on that type. A parameter that has a default value must be the first parameter listed in the function's parameter list.arrow_forwardC++arrow_forward
- int func (int a, int b); is an example of a int func (int a, int b) zeturn a*b; is an example of a declaration; definition prototype; function header implementation directive; bodyarrow_forwardThis is an computer programming question The code should be in C++ Create a namespace student having following members:a)student_id, student_name, course_code, course_title,obtained_marks, grade, gpab) Create a function void calculate_grade() to calculate the gradeaccording to the criteria given below:c) Create a function void display_grade() to display the graded) Create a function void calculate_gpa() to calculate the GPAe) Create a function void display_gpa() to display the GPAIn the main() function, take appropriate inputs and display the completeinformation of the student.arrow_forwardAnswer pl I'm stuck give me answer please. In form. .arrow_forward
- oop using c++ please give me full answer thanks Write a Program that implements Base class calculator and a Derived class scientific calculator, The Derived class should take the basic operations i.e. add, divide, subtract from calculator. However it should have its own methods such as square root.arrow_forwardWhy do you need to include function prototypes in a program that contains user-defined functions? (5)arrow_forwardPassing Structures in Parameters in C Program Create a structure called Vehicle with the fields string brand int speed in km/hr. Create a function timeCompute that accepts a Vehicle type of parameter and a distance in km. Return the time needed for the vehicle to reach the distance in minutes. In the main function, create a Vehicle instance called vehicle1 and ask the user to input the details for the vehicle1's brand and speed. Also ask for an integer input, distance, then call the timeCompute function while passing in the vehicle1 instance and the inputted value of distance. Print the return value and interpolate it in this sentence: "It will take a CodyVehicles vehicle {time_in_minutes} minutes to reach a distance of {distance}." Input 1. One line containing a string brand 2. One line containing an integer speed in km/hr 3. One line containing an integer distance in km Output: Enter brand: CodyVehicles Enter speed: 70 Enter distance: 140 It will take a…arrow_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 Learning