• 0

C++ simple question


Question

hi, i am a beginner and i have 2 quesion 

 

1. Use for loop to write the C++ program that display the integers from 0 to 50.

2. Write the C++ program that displays the message "Input error" when a user enters an integer less than or equal to 0 for the integer variable called units.

3. Modify the C++ program in exercise 2 such that it displays the message "Input error" when a user enters 0 or less for the variable called units; otherwise, it computes the total owed by multiplying the units by 5 and stores this product into the variable called total, and then displays the total value.

 

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

1. Write the C++ program that prompts a user to enter an integer value as follows: Enter an integer: The program takes the user-input integer value and stores it into the variable called x. The x variable has the int data type. The program then displays the user-input integer value as follows if the user-input integer value is 8: The integer you have just entered is: 8

2. Modify the above C++ program such that it computes the user input value plus 3, and the result times 9. The program then displays the computation result as follows if the user-input integer value is 8: The integer you have just entered plus 3, then the result times 9: 99

3. Write the C++ program that takes a user-input value and stores it into the variable called Celcius. The Celcius variable has the float data type. The program then converts the user input into a new value based on the following formula, stores the new value into the float variable called Fahrenheit and displays the Fahrenheit value: Fahrenheit = Celcius × 5/9 + 32

 

please help 

thank you

Link to comment
https://www.neowin.net/forum/topic/1280348-c-simple-question/
Share on other sites

1 answer to this question

Recommended Posts

This topic is now closed to further replies.