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
- Assignment: Class, Constructors, Destructors 1. Write a c++ program that uses <iostream> that has a class staff having fields: Staff_id , name, salary. Writea menu driven program for: 1) To accept the data2) To display the data3) To sort the data by namearrow_forwardCourse: 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_forward
- This 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_forwardSolution by C++arrow_forward
- Please help me in c++ languagearrow_forwardAgain I'm stuck give me answer please. In form.arrow_forwardoop 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_forward
- Why do you need to include function prototypes in a program that contains user-defined functions? (5)arrow_forwardC++ Programming Pleasearrow_forwardBook: C++ Programming: From Problem Analysis to Program Design 8th edition, D. S. Malik In C++ In this programming exercise, you use abstract classes and pure virtual functions to design classes to manipulate various types of accounts. For simplicity, assume that the bank offers three types of accounts: savings, checking, and certificate of deposit, as described next. Savings accounts: Suppose that the bank offers two types of savings accounts: one that has no minimum balance and a lower interest rate and another that requires a minimum balance and has a higher interest rate. Checking accounts: Suppose that the bank offers three types of checking accounts: one with a monthly service charge, limited check writing, no minimum balance, and no interest; another with no monthly service charge, a minimum balance requirement, unlimited check writing, and lower interest; and a third with no monthly service charge, a higher minimum requirement, a higher interest rate, and unlimited check…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