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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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