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

Program that receives the current temperature as input. If the temperature is 80 degrees or more, output a message telling the user to go swimming, otherwise, if the temperature is 50 degrees or more, output a message to go running, otherwise stay inside.

 

#include <iostream.h>

void main()

{

double temperature;

cout<<”Input Temperature :”;

cin>>temperature;

if (temperature<=80)

{cout<<”go swimming”;}

else if (temperature<=50)

{cout<<”go running”;}

else

{cout<<”stay inside”;}

}

 


The system accepts maximum 2 input of answers for a displayed mathematical question. “WELL DONE” message is displayed for the correct answer and “TRY AGAIN” for the wrong answer. “SORRY. TIME’S UP” message is displayed if both answers are incorrect.


Write a program that uses nested for loops to print the following pattern to the console

*******

******

*****

****

***

**

*


Write a program to find the number and sum of all integers between 100 and 200 which are divisible by 9. Only a single for loop is required for this exercise.


 Some counting

Use your newly acquired knowledge of the for loop to complete the following tasks. Print all values to console in each case.

• Write a program that counts up from 0 to 50 in increments of 1.

• Write a program that counts down from 50 to 0 in decrements of 1.

• Write a program that counts up from 30 to 50 in increments of 1.

• Write a program that counts down from 50 to 10 in decrements of 2.

• Write a program that counts up from 100 to 200 in increments of 5.


Write a program to design a class

representing complex numbers and having functionality of performing addition

and multiplication of two complex numbers using operator overloading and friend function.


Write a program to design a class

representing complex numbers and having functionality of performing addition

and multiplication of two complex numbers using operator overloading.


Write a program to overload unary (-) operator using

friend function


Write a program to overload unary (++) operator and unary

(--) operator.


Write a program to overload unary

(++) operator and unary (--) operator using friend function.


LATEST TUTORIALS
APPROVED BY CLIENTS