(Practice) a. Write a C++
Enter the temperature in degrees Celsius:
Have your program accept a value entered from the keyboard and convert the temperature entered to degrees Fahrenheit, using this formula:
Your program should then display the temperature in degrees Fahrenheit with an appropriate message.
b. Compile and run the program written for Exercise 2a. To verify your program, use the following test data and calculate the Fahrenheit equivalents by hand, and then use your program to see whether you get the same results:
When you’re sure your program is working correctly, use it to complete the following chart
Trending nowThis is a popular solution!
Chapter 3 Solutions
C++ for Engineers and Scientists
- (b) The following equations are used to calculate the voltage and power of a load in an electric circuit: Voltage of a load, V = IR Power of a load, P = 1²R (i) Draw a flowchart of a program which allows user to input the current (I) and resistance (R) of a load. The program is required to provide selections for the user to calculate either the voltage (V) or power (P) of the load. The program should also output the message "Invalid Selection" if the user makes invalid choice. (ii) Based on the flowchart above, write a complete program in C.arrow_forward(c programming) Write a program using switch to input a letter (L) and and number of cars(C). The program will do the following according the value of L and displays it as shown belowarrow_forward(permu_combi.cpp), that .arrow_forward
- (Pass or fail) Write a c++ program that prompts a student to enter a score.If the score is greater or equal to 60, display “you pass the exam”; otherwise, display “you don’t pass the exam”.Your program ends with input -1.Here is a sample run:Enter your score: 80You pass the exam.Enter your score: 59You don’t pass the exam.Enter your score: -1No numbers are entered except 0arrow_forward2. (Guess the Number) Write a C program that plays the game of "guess the number" as fol- lows: Your program chooses the number to be guessed by selecting an integer at random in the range 1 to 1000. The program then types: 5.32 I have a number between 1 and 1000. Can you guess my number? Please type your first guess. The player then types a first guess. The program responds with one of the following: 1. Excellent! You guessed the number! Would you like to play again (y or n)? 2. Too low. Try again. 3. Too high. Try again. If the player's guess is incorrect, your program should loop until the player finally gets the number right. Your program should keep telling the player Too high or Too low to help the player “zero in" on the correct answer. [Note: The searching technique employed in this problem is called binary search. We'll say more about this in the next problem.]arrow_forward(b) Given a and b are int variables and c is a double variable. The initial value for a, b, and c are 8, 4, and 2.5. Show the working steps and result for the following expression: (i) (ii) 23 % 11 + 6.2 + a / (c + 1.5) (iii) a / static_cast(b)+ 2.0 * c a + b++ - carrow_forward
- (Electrical eng.) a. The voltage gain of an amplifier is given by this formula: voltagegain=[275 23 2 +0.5 f 2 ]n f is the frequency in Hz. n is the number of stages in the amplifier. Using this formula, write, compile, and run a C++ program to determine the value of the voltage gain for a four-stage amplifier operating at a frequency of 120 Hz. Your program should produce the following display: At a frequency of xxxxx hertz, the voltage gain is yyyyy Your program should replace xxxxx with the frequency and yyyyy with the voltage gain. b. Manually check the value your program produces. After verifying that your program is working correctly, modify it to determine the voltage gain of a 12-stage amplifier operating at a frequency of 9500 Hz.arrow_forward(python) Write a program with a user-defined function called 'clamp', which takes as an input a single integer. If the input number is negative, have the function return zero. If the value is postivie and greater than 255, have the function return 255. If the value is between 0 and 255, have the function return the number unaltered. Write a main program section that prompts the user to enter a number, recasts it to an integer, and calls the clamp function. The program should then print out the value returned by the function call.arrow_forward(Use Python) The function course_average should calculate and return the average of the three values pass to it. The function main should ask the user to enter three grades and then pass these values to the course_average function. This function should also display a message to the user in the format below. For example, if the user entered 100, 90 and 95 the message would be:The average of 100 , 90 and 95 is 95arrow_forward
- Need C++ program Correct answer plzz i will upvote.arrow_forward(a) Using the program above, Compute a monthly tax (in Namibian Dollars) payableby an individual earning N$980, 953 per annum, with a tax free monthly allowanceof N$15, 000. NB: Your answer to this question should be presented as a commentat the end of the main code, with all details.arrow_forward(python) 6. Write the code that would exit the program if the choice variable is 4. Should create the if statement and the code to exit the program. Make sure to output to the user an exit message.arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr