C program to solve the quadratic equation of rocket launch

Assignment Help C/C++ Programming
Reference no: EM13162486

  1. You have your won space transport services such as SpaceX. You are testing new rocket designs. As the part of testing new rocket designs, you are checking their launching sequence. Consider you are launching a rocket straight up from 50 meters above ground (height) with 300 m/s velocity. You need to calculate when the rocket would fall down to earth. To solve this, you can represent this entire scenario through a quadratic equation (since we are not considering sending the rocket into space, we do not have to worry about other factors such as weight or drag).

    height = gravitational pull on the rocket (g) + velocity (v) + height of launch (l) = 0

    -5t2 + 300t + 50 = 0 (or) multiply by (-1) 5t2 - 300t - 50 = 0

    Note: height = 0 means the rocket has reached the earth, -5t2 is calculated by 1?2 at2 where a = 9.8 m/s2. So g is always around the value 5.

    Write a C program to solve the quadratic equation of rocket launch by computing the roots (t1 and t2) of that quadratic equation: gt2 + vt + l = 0 (or) for simplicity ax2 + bx + c = 0. Get the values of g, v, and l from the user. The program should determine the nature of roots (?)- whether the roots are real or imaginary and should print the roots for each case. The program should also consider the case where a = 0.

    ?=b2 -4ac(orv2 -4gl)

If ? ? 0 then the roots are real and given by,

?b+?b2 ?4ac
t1 = 2a and t1 =

?b??b2 ?4ac 2a

?b? i?? 2a

Note: Calculate real part and imaginary part separately. To print imaginary roots just add an "i" in printf.

page3image4784 page3image4944 page3image5104 page3image5264

If ? < 0 then the roots are imaginary and given by,

?b + i??
t1 = 2a and t1 =

page3image7184 page3image7344 page3image7504 page3image7664

If a = 0 then it becomes a linear equation and the root is given by,

t = ? bc

Reference no: EM13162486

Questions Cloud

Describe how to prepare 1l of a buffer : Explain how to prepare 1L of a buffer at pH 7.4 using 1M hypochlorous acid (Ka = 3.5 x 10-8) and a 1 M NaOH solution.
Determine the optimal size of the shopping center : Determine the optimal size of the shopping center (to the nearest 100 square meters) based on existing estimates of the demand for retail space.
First display the smallest volume and then the largest volum : first display the smallest volume and then the largest volume.
Compute the equilibrium constant kc for the reaction : Analysis shows that there are 1.8 moles of H2, 7.45e-05 moles of S2, and 7.2 moles of H2S present in a 50.8 L flask at equilibrium. Calculate the equilibrium constant Kc for the reaction.
C program to solve the quadratic equation of rocket launch : Write a C program to solve the quadratic equation of rocket launch by computing the roots (t1 and t2) of that quadratic equation: gt2 + vt + l = 0 (or) for simplicity ax2 + bx + c = 0. Get the values of g, v, and l from the user. The program should d..
Compute the partial pressure of no : At equilibrium the total pressure was 1.00 atm and the NOCl prssure was 0.27 atm. 2NOCl(g) &hArr 2NO(g) + Cl2(g) Calculate the partial pressure of NO and Cl2 in the system
State what is the partial pressure of ibr at equilibrium : What is the partial pressure of Br2 at equilibrium? What is the partial pressure of I2 at equilibrium? What is the partial pressure of IBr at equilibrium?
Compute the molar amounts of naoh used in the reaction : Calculate the molar amounts of NaOH used in the reaction with the HCI solution and with the HC2H3O2 solution?
Write a program with a while loop to print 1 to n in square : Write a program with a while loop to print 1 to N in square brackets. N is an integer input from the user. (i) Write the same program using a for-loop

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Implement database having array of pointers

One way to implement this database is to have an array of pointers pointing to Employee objects. You will obviously require a function named Calculate_salary() which will be different for each employee class. Write code in c++

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Write a function num_digits(n)

C programing, not C++ write a function num_digits(n) that returns the number of digits in a nonnegative integer n.

  Calculation of mortgage interest rates

Instruction of pointers and the calculation of mortgage interest rates.

  Write a program for find greatest common divisor

Write code for a recursive implementation of Euclid's algorithm

  Design and write a c++11/fltk game program

The project is to design and write a C++11/FLTK game program with a graphical user interface. The game is based on "pancake sorting," which actually has some mathematical significance.

  Write a program that will be used to gather statistical data

Write a program that will be used to gather statistical data about the number of movies

  Computing value of the return statement

In the following code snippet, what is the value of the return statement for x = 4 and n = 4? int foo(int x, int n)

  Write a program to calculate students average test scores

Write a program to calculate students average test scores

  Write program using c language to find page fault

Write program using c language to find page fault for individual processes, group of processes and system as whole using following system call int sys_pgfltstats(pid_t pid,int flag,pf_info_struct *info).

  By a minimal interpretation that makes a formula

By a minimal interpretation that makes a formula true, we mean that if one atom is removed from the interpretation then the resulting interpretation does no longer make the formula true.

  Implement method to advance any given date by one day

Write C++ implementation of this method. Create and specify any other methods that you require. Include comments which will be helpful to someone who will maintain implementation in the future.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd