C++ for Engineers and Scientists
4th Edition
ISBN: 9781133187844
Author: Bronson, Gary J.
Publisher: Course Technology Ptr
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Write a c++
Sample input:
Enter the temperature in celsius: 38
Sample Output:
The equivalent temperature in Fahrenheit is 100.4
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Write a C++ program that will convert temperature at any temperature scale (0C, 0F, 0K or 0R) into its corresponding value in the other 3 temperature scales. For example, if the temperature entered from the keyboard is in 0F, your program will convert it into 0C, 0K, and 0R. Tabulate the result of computation as shown in the sample input/output display below: Enter the temperature and its scale( C, F, K, or R): 212 F CELSIUS FAHRENHEIT KELVIN RANKINE 100 212 373 672 Use switch structure in processing the input data. The program must work on both lowercase and uppercase input values. If the temperature scale entered is not C, F, K or R, the program must print: “Please enter temperature in C, F, K, or R scale only.” Use the following formulas: F = (9/5)C + 32 K = C + 273 R = F + 460 where: F = temperature in Fahrenheit scale K = temperature in the Kelvin…arrow_forwardWrite a program using integers userNum and x as input, and output userNum divided by x three times. Ex: If the input is: 2000 2 the output is: 1000 500 250 Note: In C++, integer division discards fractions. Ex: 6/4 is 1 (the 0.5 is discarded). 347538.2318274.qx3zgy7 LAB 3.25.1: LAB: Divide by x 0/ 10 ACTIVITY main.cpp Load default template... 1 #include 2 using namespace std; 3 4 int main() { 5 | 6 return 0; 7 } 8 When done developing your program, press the Submit for grading button below. This will submit your program for auto-grading. Develop mode Submit modearrow_forwardWrite a C++ program that reads in two integers, and then outputs whether the first number is greater than the second, the first number is less than the second, or the two numbers are equal. See the examples for the correct format of the output. For example: Input Result 3 5 3 is less than 5 6 1 6 is greater than 1 -42 -42 -42 is equal to -42arrow_forward
- CREATE A C++ PROGRAM THAT THE USER WILL INPUT 3 COORDINATES AND THE OUTPUT IS TO DETERMINE IF THREE POINTS ARE COLLINEAR OR NOT.arrow_forwardWrite a c++ program to calculate the area of a circle and display the result. Use the formula Area= pir2 where pi is approximately equal to 3.1416 Sample Input: Enter the value of radius: 1 Sample output: The area is 3.1416arrow_forwardWrite a program in C++ to convert temperature in Kelvin toFahrenheit. Formula :° F = 9/5(K – 273.15) + 32 Sample Input:Input the temperature in Kelvin : 300Sample Output:The temperature in Kelvin : 300The temperature in Fahrenheit : 80.33arrow_forward
- Write a C++ program to enter two integers (divisor and dividend) and computes the quotient and remainder. To compute quotient and remainder, both divisor anddividend should be integers. Sample input:Enter dividend: 13Enter divisor : 4Sample output:Quotient : 3Remainder : 1arrow_forwardWrite a C++ program that reads integers from standard input until a number greater than 1000 is entered. When a number greater than 1000 is entered, the program prints a report regarding how many numbers were entered that were not greater than 1000. After the report is printed, the program ends. Match the form of your output to the given examples. Hint: Solve this problem with a while loop. For example: Input Result 45 823 1000 1001 You entered 3 numbers <= 1000. 2018 You entered 0 numbers <= 1000.arrow_forward2. Write a C - program to convert temperature from Fahrenheit to Celsius degree. Test Data Input a degree in Fahrenheit:212 Expected Output : 212.0 degree Fahrenheit is equal to 100.0 in Celsius EQUATON: C/5 = (F – 32) / 9arrow_forward
- Write a C++ program that reads integers from standard input and keeps a running sum of all the positive integers that are entered until a negative number is entered. As soon as a negative integer is entered, the program outputs the sum of the positive integers that were read, and then the program ends. If the first number is negative, then the result should be 0. Format your output as in the given examples. Hint: Solve this problem using a while loop. For example: Input Result 4 6 -5 The sum of the positive numbers is 10. -65 The sum of the positive numbers is 0.arrow_forwardWrite a C++ program that would ask a user to input time in seconds and then it prints this time duration in hours, minutes and seconds. Sample output Input time in seconds: 3672 Hours: 1 Minutes: 1 Seconds: 12 Input time in seconds: 61 Hours: 0 Minutes: 1 Seconds: 1arrow_forwardWrite a C++ program called hw.cpp that performs addition and multiplication operations. The user enters an initial number and then continues to add or multiply new user-specified numbers to the growing sum/product. At each loop repetition, the user enters x to multiply, + to add, or q for quit. If s/he chooses add or multiply, the user then specifies the additional number to be added or multiplied. The program reports the latest sum/product. Note: operator is a C++ reserved name (keyword). Do not use it as a variable name. Test Case Output Welcome to the math loop. Give a first number: 5 Choose an operation: + Choose a number to add: 6 5+6 = 11 Choose an operation: x Choose a number to multiply: 3 11x3 = 33 Choose an operation: x Choose a number to multiply: 2 33x2 = 66 Choose an operation: + Choose a number to add: 15 66+15 = 81 Choose an operation: q We are finished!arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr