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

Write a program that generate 20 random integers between 10 and 90 and then stores

it in an array. Your goal is to find:

• Mean

• Median

• Mode

For this question, provide switch menu to user in order to select one of the option from

above.



Write a program that allow you to write the salaries of 10 employees. The program will tell you tha maximum and the minimun salary

The following are the assumed existing equivalent currency rates corresponding to the US 

dollar ($1.00); Australia (Aus $), 1.09; Hong Kong (HK $), 7.81; Indonesia (Rupiah), 990.41; 

Japan (Yen), 234.93; Malaysia (Ringgit), 2.34; Philippines (Peso), 13.80. Prepare a program that 

will accept US dollar and currency to be converted as inputs, then compute the equivalent in 

the chosen foreign currency. Print the results. 

(Use if then else statement.) 


Make a program that will input two number, If the two number entered are ODD then perform the addition and display the Sum. Your program will be terminated by an option if the user not to proceed another entry.

Ex, No. 1: 5 No. 2: 3

No. 1: 3

No. 2: 2

Sum is : 8

One of the number entered is not ODD


You are tech-entrepreneur venturing into the field of Financial technology and is concerned about the lack financial savings culture among the youth. You have settled on an idea to come up with your own software that allows users to deposit cash for safe keeping and future planning. Whenever a user wants to withdraw money from their accounts, they can visit nearby cash ATM that your company has setup, and withdraw directly by first keying in usernames and passwords. They are also given the option of checking their balance and changing their password. In order to make cash deposits, you have settled on the role of an administrator who will be stationed near an ATM machine, and users will be approaching this administrator to help them make deposits to their accounts. The administrator will log in t using their admin usernames and passwords. They will then be given an option of making a cash deposit for normal users, create an account for new users and also be able to change their administrator passwords.


Q3: Write a complete Class called “Triangle”, which represents a mathematical

triangle. (10 points)

The structure has the following instance variables:

1. base – double value representing the base of a triangle

2. height – double value representing the height of the rectangle

The structure has the following methods

1. Constructor - This constructor takes two formal parameters representing the base and height respectively. The parameters are used to initialize the corresponding instance variables.

2. getBase - This method returns the base value.

3. getHeight - This method returns the height value.

4. setBase - This method updates the base value with the single parameter.

5. setHeight - This method updates the height value with the single parameter.

6. Area - This is a static method that takes as formal parameter a Triangle reference and returns a double representing the area of the triangle.


Q4: Create a Car class. Identify the attributes and functions of the class (with respect to driver and not engineer)


For Example:


Attribute: No. of Seats


Function: accelerate() or startCar()

Question 2a: Explain further on the three main principles of Object-Oriented Programming


You will be simulating an airport where 8 planes go out on tours repeatedly. Each tour will be



for exactly 12 passengers and last approximately 30 seconds. In performing the simulation,



you must make sure that no plane tries to leave a gate with less (or more) than 12 passengers



and that no plane lands or takes off at the same time as another plane is landing or taking off.



The first thing your program should do is read the following from the command line (in the



order specified):



• the total number of passengers that are in the airport.



• the sum total number of tours that all of the planes are to do. (NOT the number of tours



that each plane is to do, the total number of tours that all planes will do when their



number of completed tours is added together.

You are required to build a program for ABC Builders, they have various models of houses which are all build on 1 canal area, the three models with costs are

House Models Building Cost Double

Story House 10000000

House with basement 20000000

Single Story 5000000

The property dealer give them the latest prices for area their house covers and the construction price building each model. The price of area is 1 crore, Calculate the total cost of whole house after construction. Suppose you have two users for this program, take input from them and based on their inputs calculate the total cost for their choice of house


LATEST TUTORIALS
APPROVED BY CLIENTS