C++ Answers

Questions answered by Experts: 9 913

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

The Area of a Circle = pi *(r*r). Where pi=3.1415 and r=Radius, Make a program that will


input Radius and compute and display the Area. Your program will be terminated if input zero


in the radius.

Make a program that will input Dollar currency, convert it into peso. Peso= dollar



currency*50.00 pesos, Display the peso equivalent. Your program will be terminated if the



inputted Dollar currency = 0.

Create class Student which contains database of rollNo, name, height, weight & percentage using


constructor and also display this database of 3 student using a method called display(). Then destroy the


objects when they are no longer needed.

Q#4). Create a class called Stack for storing integers. The data members are an integer array for storing

the integers and an integer for storing the top of stack (tos). Include member functions for initializing tos

to 0, pushing an element to the stack and for popping an element from the stack. The push() function

should check for “stack overflow” and pop() should check for “stack underflow”.


1.     Make a program that will input type of accommodation room. A-for first class, B-for second class. Charge as follows : first class=800.00 and second class = 650.00. Your program will be terminated if you input C in the accommodation room type.


Choose the correct answer



1. Which of the following is a valid prototype for a function that accepts an integer argument and


returns a double value?


a. int function (double);


b. int function (double)


c. double function (int);


d. double function (int)



Study the function header below:


double getResults(double fN, double sN)



2. Which of the following is a valid function prototype for the header?


a. getResults(double firstnum1, double num2);


b. double (double num1, double num2);


c. double getResults(double, double);


d. results = getResults(num1, num2);



3. What value is returned by the following return statement?


int x = 5;


return x / 2;


a. 2


b. 2.5


c. 2.1


d. nothing

Choose the correct answer



1. A void function _____.


a. contains no statements


b. requires no parameters


c. returns nothing


d. has no name



2. The value used in a functions’ return statement must _____.


a. be numeric


b. be a variable


c. match the data type used before the method name in the header


d. all of the above



3. When a function definition appears above the main () function, you must have a (n) ____ above the


main () function.


a. argument


b. value parameter


c. prototype


d. none of the above



Write True or False



1. A function prototype only consist of the name of the function as well as



the parameter list.





2. A function prototype in C++ has a local scope as it is only



accessible within the main or the function where they are



declared in.



3. By default all parameters are declared as integer values.



4. The following is a valid C++ call to a function that will calculate the



final results of two assessments:



results = summativeResults (valtest1, vallTtest2, valResults);



5. The following is a valid C++ function header that will determine if the



entered value is a multiple of 3 or not.



Function determineMuliple (valFirst)




Write a code in C++ programming language

Create three variables that will hold:

Student Name

Student Id

Current Course Intake

Assign your name, student ID, your current course intake to the three variables created previously.

After presenting the output of the three variables you will present the date of this assignment such as:

The date of this Assignment is: 8-12-2021


write program link list insert midle and delete ?

LATEST TUTORIALS
APPROVED BY CLIENTS