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

#include<iostream>


using namespace std;


int area(int);


int area(int,int);


float area(float);


float area(float,float);


int main()


{


int a,length,b;


float radius,base,ht;


cout<<"enter one side of the square";


cin>>a;


cout<<"enter length and breadth the rectangle:";


cin>>length>>b;


cout<<"enter the radius of the circle:";


cin>>radius;


cout<<"enter the base and height of the triangle:";


cin>>base>>ht;


cout<<"Area of square = "<<area(a);


cout<<"\nArea of rectangle = "<<area(length,b);


cout<<"\nArea of circle = "<<area(radius);


cout<<"\nArea of triangle = "<<area(base,ht);


}


int area(int a)


{


return(a*a);


}


int area(int length,int b)


{


return(length*b);


}


float area(float radius)


{


return(3.14*radius*radius);


}


float area(float base,float ht)


{


return((base*ht)/2);


}





Output

Create a program that will compute the 1st quiz 11/11 2nd quiz 15/15 and the 3rd quiz 20/20 with 10% of quiz and compute the online laboratory 1st 15/20 2nd 10/20 3rd 5/20 with 30% of online laboratory and compute the exam with 20% 1st exam 30/50 2nd exam 45/50 3rd exam 20/50 and compute the quiz+online+ exam1+exam 2+ exam 3


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):

1.Try running your program with only 11 passengers. What happens? Why?

2. Try running your program with 12 passengers. What happens? Why?

3. Try running your program with 50 passengers and 100 tours. What happens? why?

4. Try running your program with 100 passengers and 20 tours. What happens? Why?

5. What is the minimum number of passengers that will guarantee avoidance of

deadlock? Why?


Starlight company has revised their employs salaries they had certain criteria on which they decided the total increment value of employee on their salary following


1. 10%increase if he has only worked on company's local project


2.15%increase if he has only worked on company's international projects


3.20%increase if he has worked one company's both local and international projects


Now you are required from to ask your 3 employees there names salary's and calculate the total salary they will get this month


You output should display old salary of each employee and new salary get now he will get

Write a function that computes the average of the digits in an integer and use the following function header.double average Digits(long n)




There are 12 teams in the tournament and every team will play

one match each on the knock-out basis in the first round. It means that the losing team of every match

leaves the tournament while the winning team continues to play the next match. From the twelve teams,

six winning teams will play another knock-out match. From these six teams, three winning teams will play

against each other on the round robin basis (i.e. team A plays against team B, team B plays against team

C, and team C plays against team A). The top two teams from this round will move to the final match. In

case all the teams win one match each at this stage, then there will be a toss to move one team to the

final while the other two teams will play against each other and the winner moves to the final.

For every match, you can generate a random number to declare the winner of the match. Similarly, you

can use a random number to simulate the toss. You are required to use if-else (if-else-if) structure to run



22. Make a program that will input minutes and convert it into seconds. Your program will be terminated when you input zero in the minutes.




20. Make a program that will input seconds, convert it into minutes and hour. Display the equivalent minutes and hour/s . Your program will be terminated if you input zero in the hour.


Ex. Enter seconds: 120


Minutes = 2 (120 seconds/60)


Equivalent Hour is = 0.033 (120 seconds/ 3,600 seconds in 1 hour)




11. Make a program that will input hour, convert it into minutes and seconds. Display the minutes and seconds respectively. Your program will be terminated if you input zero in the hour.


Ex. Hour = 2


Minutes = 120


Seconds = 7200



12. Make a program that will input Sales, process the Value Added Tax deduction as follows:


Sales VAT


Less than equal =10000.00 10%


Above 10000.00 15 %



Display the taxable amount, Your program will be terminated if you input zero in the sales.



LATEST TUTORIALS
APPROVED BY CLIENTS