CCIT-102-LEC-BASIC-IO.pptx

Document Details

Uploaded by Deleted User

Tags

C++ programming basic input output programming exercises

Full Transcript

Quiz 1: Celsius to Fahrenheit formula is F = C(9/5) + 32. Write a program that will convert 95 degree Celsius to Fahrenheit. Quiz 2: Write a program that declares three integer variables namely x1, y1 and z1 with your desired values. Find and display the...

Quiz 1: Celsius to Fahrenheit formula is F = C(9/5) + 32. Write a program that will convert 95 degree Celsius to Fahrenheit. Quiz 2: Write a program that declares three integer variables namely x1, y1 and z1 with your desired values. Find and display the following: a. The sum of x1 and y1. b. The average of the 3 variables. c. The product of y1 and z1. d. The remainder in diving x1 by z1. e. The 10% of the sum of the three variables. C++ Basic Input/Output Sir Gilboy Sources https://www.tutorialspoint.com/ https://www.computerscience.org/ https://www.freecodecamp.org/ https://www.geeksforgeeks.org/ C++ Input cin takes formatted input from standard input devices such as the keyboard. We use the cin object along with the >> operator for taking input. Example 2: Example 3: Write a C++ program to add two numbers and accept them from the keyboard. Example 4: Write a C++ program to find the volume of a cylinder. V=πr2h. Activities.. Activity 1: Write a program that accepts a user’s hourly rate of pay and the number of hours worked. Display the user's gross pay, the withholding tax(15% of gross pay) and the net pay(gross pay – withholding). Save it as LASTNAME_Activity1 Activity 2: Write a program that accepts a temperature in Fahrenheit from user and converts it to Celsius by subtracting 32 from the Fahrenheit value and multiplying the result by 5/9. Save it as LASTNAME_Activity2 Activity 3. Write a program that calculates and displays the amount of money a user would have if his or her money at 5% interest every year. The program should prompt the user for the number of capital and the number of year(s) he/she wish to invest the money. Display the interest gained. Activity 4. Write a program that computes for the circumference of a circle. The formulas is c = 2πr. Your program should prompt the user for the value of the radius. Display the circumference.

Use Quizgecko on...
Browser
Browser