Concept explainers
The formula for converting centigrade temperatures to Fahrenheit is
Write a
Want to see the full answer?
Check out a sample textbook solutionChapter 4 Solutions
Computer Science: A Structured Programming Approach Using C, Third Edition
- write a program that prompts the user to enter the number of students and each student name and score and finally display the name of student with highest score and the student with second highest score.arrow_forwardWrite a program that asks the user for a number in the range of 1 through 7. The programshould display the corresponding day of the week, where 1 = Monday, 2 = Tuesday, 3 =Wednesday, 4 = Thursday, 5 = Friday, 6 = Saturday, and 7 = Sunday. The program shoulddisplay an error message if the user enters a number that is outside the range of 1 through 7arrow_forwardWrite a program that asks the user for a 24-hour time, then displays the time in 12-hour form: Enter a 24-hour time: 21:11 Equivalent 12-hour time: 9:11 PM Be careful not to display 12:00 as 0:00.arrow_forward
- Write a program that calculates the attendance percentage for students, there are total 120 working days in a semester, you are required to ask 100 students the days they attended university, then calculate the percentage it makes. If the percentage is above 75, then display that he is eligible to sit in examination, if not display that he will not get admit card to sit in exams. In the end calculate how many students were eligible to sit in exams.arrow_forwardWrite a program that prompts the user to enter the number of students and each student’s name and score, and finally displays the names of the students with the lowest and secondlowest scores.arrow_forwardWrite a program that will ask the user to enter salary amount. And then compute for the TAX amount. If salary is 10,000 and below, the tax amount is 21% of the salary amount. if the salary is between 10,001 and 30,000, the tax amount is 28% of the salary amount. If the salary is more than 30,000, the tax is 31% of the salary amount. Then compute the net salary which is the Salary amount less tax amount. Display tax amount and net Salary.arrow_forward
- Write a program that prompts the user to input three positive angle values in degrees to determine which type of triangle it is (acute, right, obtuse). TEST CASES: If a user inputs three valid angle values: Enter the first angle in degrees: 60 Enter the second angle in degrees: 30 Enter the third angle in degrees: 90 Result: You have a right triangle! If a user inputs any negative angle values: Enter the first angle in degrees: 45 Enter the second angle in degrees: 55 Enter the third angle in degrees: -80 Result: Error! Please input a positive angle value. If a user inputs values whose sum exceeds 180: Enter the first angle in degrees: 20 Enter the second angle in degrees: 70 Enter the third angle in degrees: 100 Result: Error! It is not a triangle.arrow_forwardWrite a program that apt the user to input three positive angle values in degrees to decide which type of triangle it is (obtuse, acute, right). Test Cases: If a user inputs three valid angle values: Enter the first angle in degrees: 60 Enter the second angle in degrees: 30 Enter the third angle in degrees: 90 Result: You have a right triangle! If a user inputs any negative angle values: Enter the first angle in degrees: 45 Enter the second angle in degrees: 55 Enter the third angle in degrees: -80 Result: Error! Please input a positive angle value. If a user inputs values whose sum exceeds 180: Enter the first angle in degrees: 20 Enter the second angle in degrees: 70 Enter the third angle in degrees: 100 Result: Error! It is not a triangle. Note: - Include comments in All lines. - Do not use Loop in code. - The header file for input and output should be "#include <iostream>"arrow_forwardWrite a program which prompts the user for a Celsius temperature, convert the temperature to Fahrenheit, and print out the converted temperature. Write a program which prompts the user for a Celsius temperature, convert the temperature to Fahrenheit, and print out the converted temperature.arrow_forward
- Write a program that converts U.S. dollars toCanadian dollars, German marks, and British pounds, as shown in Figure .The user enters the U.S. dollar amount and the conversion rate, and clicks the Convertbutton to display the converted amount.arrow_forwardWrite a program that prompts the user to enter the number of students and each student’s score, and displays the highest and second highest scores.arrow_forwardWrite a program that prompts the user to enter five test scores and then prints the average test score. Indicate the average test score by printing it to the terminal using the following format: Your average test score is: Xarrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning