(Physics) A golf ball is dropped from an airplane. The distance, d, the ball falls in t seconds is given by the formula
Using this information, write and run a C++
Want to see the full answer?
Check out a sample textbook solutionChapter 5 Solutions
C++ for Engineers and Scientists
- (ouall La5) Word-[lll ] (1) COMP1411 final exam Sample 4exlya 11 1 12 113 14 cion B Short Answers: Each answer is worth 2 marks wer all the questions Write a C++ program to convert meters to miles. Recall that 1 mile 1.6 km. Write a C++ program to convert miles to kilometers. Recall that 1 mile = 1.6 km.arrow_forward(permu_combi.cpp), that .arrow_forward(Don't copy) Write C++ program to find as many prime Fibonacci numbers as you can. It is unknown whether there are infinitely many of these. Find out the times taken to find first 10, 20, 30, 40…up to 200 and draw a graph and see the pattern.arrow_forward
- Instructions(C++) A company hired 10 temporary workers who are paid hourly and you are given a data file that contains the last name of the employees, the number of hours each employee worked in a week, and the hourly pay rate of each employee. You are asked to write a program that computes each employee’s weekly pay and the average salary of all employees. The program then outputs the weekly pay of each employee, the average weekly pay, and the names of all the employees whose pay is greater than or equal to the average pay. If the number of hours worked in a week is more than 40, then the pay rate for the hours over 40 is 1.5 times the regular hourly rate. Use two parallel arrays: a one-dimensional array to store the names of all the employees (Name) a two-dimensional array of 10 rows and 3 columns to store the number of hours an employee worked in a week (Hrs Worked), the hourly pay rate (Pay Rate), and the weekly pay (Salary). Your program must contain at least the following…arrow_forward(c++) Write a program that takes user input describing a playing card with the following shorthand: A = Ace 2...10 card values J = Jack Q = Queen, etc. D = Diamonds S = Spades. etc. Ex. if the user enters QS then your program responds with Queen of Spadesarrow_forward(C++) Question: Write a function string middle(string str)that returns a string containing the middle character in str if the length of str is odd, or the two middle characters if the length is even. For example, middle("middle") returns "dd". I'm not getting the correct output. What am I doing incorrectly?arrow_forward
- (Physics) a. The weight of an object on Earth is a measurement of the downward force onth e object caused by Earth’s gravity. The formula for this force is determined by using Newton’s Second Law: F=MAeFistheobjectsweight.Mistheobjectsmass.AeistheaccelerationcausedbyEarthsgravity( 32.2ft/se c 2 =9.82m/ s 2 ). Given this information, design, write, compile, and run a C++ program to calculate the weight in lbf of a person having a mass of 4 lbm. Verify the result produced by your program with a hand calculation. b. After verifying that your program is working correctly, use it to determine the weight, on Earth, of a person having a mass of 3.2 lbm.arrow_forward(General math) The volume of oil stored in an underground 200-foot deep cylindrical tank is determined by measuring the distance from the top of the tank to the surface of the oil. Knowing this distance and the radius of the tank, the volume of oil in the tank can be determined by using this formula: volume=radius2(200distance) Using this information, write, compile, and run a C++ program that accepts the radius and distance measurements, calculates the volume of oil in the tank, and displays the two input values and the calculated volume. Verify the results of your program by doing a hand calculation using the following test data: radius=10feetanddistance=12feet.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_forward
- (Electrical eng.) The amplification of electronic circuits is measured in units of decibels, which is calculated as the following: 10LOG(Po/Pi) Po is the power of the output signal, and Pi is the power of the input signal. Using this formula, write, compile, and run a C++ program to calculate and display the decibel amplification, in which the output power is 50 times the input power. Verify your program’s result by doing a hand calculation. After verifying that your program is working correctly, use it to determine the amplification of a circuit, where output power is 4.639 watts and input power is 1 watt.arrow_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(python) Find at least 12 issues in the code. A = int(input("Enter a number for A: ")) B = str(input("Enter a number for B: ")) C = int(input("Enter a number for C: ")) #Check that user input for A is not 0. if A = 0: print("Your coefficient for 'A' MUST BE a value greater than 0, otherwise your equation is not a quadratic!") int(input(Please enter a new value for a:")) = A import math: //Compute the discriminant. disc = (B*B) - (4*A*C) #Display the disciminant computed. print("\nThe discriminant of your equation is", str(disc) + ".") #Check the sign of the computed discriminant if disc == 0: print("This equation has 1 real solution.") x = (-B + math.sqrt(disc)) / (2 * A) print("The solution to your equation is:", x) elif disc > 0 print("This equation has 2 real solutions.") x1 == (-B + math.sqrt(disc)) / (2 * A) x2 == (-B - math.sqrt(disc)) / (2 * A) print("One solution to your equation is:", x1) print("The other solution to your equation…arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr