(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) Write a C+t code to check whether a string is a valid password. Password rules: A password must have at least ten characters. A password consists of only letters and digits. A password must contain at least two digits. Expected Output: 1. A password must have at least eight characters. 2. A password consists of only letters and digits. 3. A password must contain at least two digitsarrow_forwardPut code as well as code with outputarrow_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_forwardPART 2 (Lab) a. Write a C+ program that asks the user to enter N, the program should then output the Fibonacci series. Use do-while loop to ask user to re-enter N if the user entered a number below 2. Hint: The first two numbers in the Fibonacci series are 0 and 1. F, = 0 F, = 1 Any Fibonacci number is equal to the summation of the two previous numbers Fn = Fn-1+ Fn-2 Therefore, F, + F, = 1+ 0 = 1 F, + F, = 1+1= 2 F4 = F3 + F2 = 2 +1 = 3 F2 .... FN = FN-1 + FN-2 Enter N: 20 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 b. Write a program that use loops to print the following patterns separately, one below the other. In your code use for, while and do-while loops to generate the patterns, use one loop for each question. * ********* ** ******* *** ***** **** *** ***** *arrow_forwardPlease use C PROGRAM. Thanks in advance :)arrow_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_forwardDO A CODE PER LETTER IN NO.4. DO IT IN C++ I NEED 3 CODES. PLEASE DO IT ACCORDING TO THE INSTRUCTION. DONT DO IT AS ONE, DO IT SEPARATELY. THANK YOU SO MUCH A. FUNCTION HEADER B. FUNCTION PROTOTYPE C. PARAMETERS AND RETURNarrow_forwardNeed C++ program Correct answer plzz i will upvote.arrow_forward
- [C++ Programming] Please do not copy other sources in Chegg or other sites. Please write new code.arrow_forwardc++ programming b) Given x and y are int variables and z is a double variable. The initial value for x, y, andz are 4, 6, and 2.5. Show the working steps and result for the following expression:(i) x / (3 + y) + 11 % y(ii) x - y++ + zarrow_forward(25 min) The following table shows the foreign exchange rates for a few currencies. Foreign Currency RM USD (D) 1 Dollar 4.16 GBP (P) 1 Pound 5.68 KRW (W) 1000 Won 3.51 JPY (Y) 100 Yen 3.69 Develop a complete C++ program that will prompt the user to enter the currency preferred and the amount required. The program should include a function with the following prototype: double CurrencyBuy(char, double): The first parameter in the function prototype is for the type of currency where the characters D, P, W and Y represent Dollar, Pound, Won and Yen respectively. The second parameter is the amount to be bought. This function CurrencyBuy should return, to the calling function, the payment to be paid in RM. A sample of the output is given as follows. Foreign Exchange Currency Country Code USD (D) GВР (Р) KRW (W) JPY (Y) Enter the country code: D Enter the amount to be bought: 300 Payment due is RM 1248.arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr