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

Questions Cloud

Make a connectionless protocol reliable? : make a Connectionless Protocol reliable?
Major frictional losses for a 30-m length of smooth pipe : Sulfuric acid (a Newtonian fluid) with a density of 1980 kg/m3 and a viscosity of 26.7 cP is flowing in a 35-mm-diameter pipe. If the acid flow rate is 1 m3/min, what is the pressure drop from major frictional losses for a 30-m length of smooth pipe?
State the topic or hypothesis and the methods of research : Abstract will state the topic or hypothesis and the methods of research or subtopics covered in the paper. Not a great amount of detail, but enough to inform the reader of what your paper is about.
What was the concentration of ni2+ in the original solution : A 50.0 mL sample containing Ni2+ was treated with 25.0 mL of 0.050M EDTA to complex all of the Ni2+ and leave excess EDTA. The excess EDTA was then back-titrated, requiring 5.00 mL of 0.050M Zn2+ standard. What was the concentration of Ni2+ in the or..
Calculate height and velocity of balloon : 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.
Calculate energy of a photon of electromagnetic radiation : Calculate the energy of a photon of electromagnetic radiation at each of the following frequencies 104.9 MHz 1090. kHz 838.7 MHz express answer in joules using four significant figures
Advantage of assembly and high-level programming languages? : What are the advantages and disadvantage of assembly and high-level programming languages?
What will be the specific rotation of a mixture containing : If a pure (+) enantiomer has [α]25D = +90o, what will be the specific rotation of a mixture containing 25% of the (+) enantiomer and 75% of the (-) enantiomer?
Measure the kinetics of an enzyme e as a function : You measure the kinetics of an enzyme E as a function of [S] and plot the following Lineweaver-Burke plot. a)The enzyme concentration is kept constant at 1μM (10-6 M). From these data, determine vmax, KM, kcat and the turnover for the enzyme. Justify..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Does managerial behavior warrant reporting

Many employees are aware of reporting procedures for ethics violations, but which of the managerial behaviors would be worthy of reporting as an ethics violation? At what point does managerial behavior warrant reporting?

  What is a knowledge repository?

What is a knowledge repository? What is a community of practice? What is a chief knowledge office? What are his or her duties? What is natural language processing? What are the three (3) levels of voice recognition? What is a learning system?

  Allow different payment and shipping options

allow different payment and shipping options. There are a plenty of examples of this kind of web sites. Some well-known ones are amazon.com, Barnes & Nobles, and Borders.

  Is there a fixed path from past to future

Is there a fixed path from past to future, or do our individual momentary decisions shift and twist the course of human events? What people believe about the effects and consequences of their actions is part of the larger picture of what motivates..

  Client of yours is concerned about external intrusion

Client of yours is concerned about external intrusion on their corporate network, and those inside their environment that they seek to fire! They've heard about firewalls and they need your professional opinion as to whether, with the implementation ..

  How many threads will you create to perform the input

Given: A system with two dual-core processors has four processors available for scheduling. A CPU-intensive application is running on this system. All input is performed at program start-up, when a single file must be opened. Similarly, all output is..

  Explain dual signature used in set protocol

Explain dual signature used in SET (Secure Electronic Transfer) protocol and provide example.

  Develop a program that determines the monthly charges

Develop a program that determines the monthly charges for a checking account. the following criteria is to be used.

  Operational analysis and quality improvement

Operational Analysis and Quality Improvement- Consider Kotter's eight-stage model of change (Table 2-1). How does it compare to Berwick's rules of the diffusion of innovation

  Write program take input and test scores

I need a program that allows me to... 1. Input students test scores(Tests, Quizzes, Classwork, and Homework) stored in dynamically declared arrays and PPS weights given to each score

  Probability is the chance of an event happening

Probability is the chance of an event happening. During the day, you may hear various probabilities, such as a 30% chance of rain or a 50% chance of winning a contract bid. Two of the main types of probability are classical (theoretical) and empirica..

  Update the variables belonging to the main program

Write a program using functions where a function collects 8 numbers from the user, finds the largest, smallest of those 8 numbers and uses passing by reference to update the variables belonging to the main program.

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