Calculate height and velocity of balloon

Assignment Help Basic Computer Science
Reference no: EM13861762

Goal:  Using loops, functions, and formatting output. Do not use arrays.

Problem:  Once launched a weather balloon can gather data about temperature and pressure for days.  During the day the sun will warm the helium in the balloon and the balloon will rise to a higher altitude.  At night, the helium will cool and the balloon will sink.  This change in altitude can be approximated by the equation

Altitude(t) = -0.12t4 + 12t3 - 380t2 + 4100 t +220

where t is time in hours and altitude is in meters.  The velocity of the balloon can similarly be approximated by the polynomial

Velocity(t) = -0.48t3 + 36t2 - 760t + 4100

where t again is in hours and velocity is in meters/hour.

For this project you are to write a program that will calculate the altitude (in meters) and velocity (in meters per second) of the balloon to create a table and histogram of the height.  You program should:

prompt the user to enter a start time for the monitoring,

robustly confirm that the number is greater than or equal to  0 and less than or equal to 50,

prompt the user to enter when the calculating should end,

robustly confirm that the input is greater than the starting time and less than or equal to 50 hours,

prompt the user to enter the time increments,

and robustly confirm that the time increments > 0 and less than 3 hours. 

Next your program should use a for loop to generate a table beginning at the start time and ending at the stop time.  This table should contain the time, the balloon height (meters) and the balloon velocity (meters/second) and a horizontal histogram that displays the height of the balloon using asterisks.  Each asterisk should symbolize 500 meters and you should round the number of asterisks that are printed, e.g. 3225 would be printed as 6 asterisks and 3790 would be printed as 8 asterisks.  Your table would then look something like

Time        Height         Velocity        (Each * symbolizes 500 meters)

(hrs)        (meters)        (m/s)

0.00         220.00         1.14                

0.50       2176.49         1.04                 ****

1.00       3951.88         0.94                 ********

1.50       5554.89         0.84                 ***********

2.00       6994.08         0.76                 **************

2.50       8277.81         0.67                 *****************

3.00       9414.28         0.59                 *******************

The calculation of height and velocity should be done in a single function that will accept the time, calculate the height and velocity of the balloon and send both the height and velocity back to the function call.

Your program should also employ a do-while loop that allows the user to repeat the entire process with different starting and stopping times.

Reference no: EM13861762

External strategic audit and pestel analysis

Explain how you would conduct an external strategic audit and PESTEL analysis for your firm (or a firm that you are familiar with). As a business leader, explain how you wou

Produce an identical product

There are two firms in a market that produce an identical product. Each firm has either one or zero units to sell. The probability of having a unit to sell is q and the p

Types of customer complainers and four types of complaints

Review the five types of customer complainers and the four types of complaints. Then, below describe a time when you did not "complain" - What caused you not to provide this

Reduce the potential for economic damage

Disaster planning can help eliminate and reduce the potential for economic damage, loss of life, and destruction of property during a disaster. This task will focus on the r

Determining the pseudocode and flowcharts

General knowledge suggests that pseudocode or flowcharts can include clear and obvious logic errors. Give your opinion as to whether you believe it is worth time and effort

Track of current inventory and re-orders automatically

Assignment 3 This assignment is marked out of 15. The marks will be scaled to be worth 15% for the assignment. The learning objectives are here. The due date is 26th October

Describe the multicultural and multinational issues

Describe the multicultural and multinational issues surrounding information security and describe the security challenges presented when an organization has multiple director

Determining the important terminology

Give a short overview of the topic(s) covered; include as many details as necessary to make the topic(s) clear. Explain any important terminology covered (including any terms

Reviews

Write a Review

 
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