Design and code a program that calculates the time at which a projectile will reach a certain height.. Your program prompts for and accepts the initial vertical velocity component and [r]
(1)Part B – C++ Foundation Data Structures Workshop 2: Fireworks LEARNING OUTCOME
Upon successful completion of this workshop, you will have demonstrated the ability
• to design a derived type that consists of several primitive data types and
• to use your design with program input and output
EXERCISE
You have been asked to design a set of simultaneous fireworks for your next National Holiday In the design, you need to ensure that each firework reaches a specified height
You know that the height (in m) of a projectile is given by the formula
h = - g * t ² / + b * t
where t is the time from launch, g is the acceleration due to gravity (9.8 m/sec2) and b is the initial vertical velocity component (in m/sec)
Design and code a program that calculates the time at which a projectile will reach a certain height Your program prompts for and accepts the initial vertical velocity component and the desired height Your program handles cases where the desired height is the maximum height reached and the desired height is never attained The output from your program might look something like:
Fireworks =========
Initial vertical velocity (m/sec): 20
(2)Desired Height (m): 10
Your firework will reach the desired height at times: 0.58 sec
3.50 sec
Your program includes a function named roots that receives an instance of a Triple type and returns an instance of a Roots type The Triple type holds the coefficients of the quadratic equation The Roots type holds the real roots of the equation and the number of real roots found Place your function prototype and the declarations of your two derived types in a file named Fireworks.h