Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. [20pts] Write console code that, given an initial velocity in m/s by the user, writes to the screen the height (in meters) of a

image text in transcribed
1. [20pts] Write console code that, given an initial velocity in m/s by the user, writes to the screen the height (in meters) of a projective launched straight up for each second from launch time (time 0) until the projectile hits the ground. The last entry should show a projectile height of 0. The height after t seconds is given by: S=v, *t - %*g*t^2 where g is the gravitational constant (9.8 m/sec^2), and V, is the initial velocity at time 0 (gotten from the user). The output should look something like this: Initial velocity: 60 m/s Time (seconds) Height (meters) 0 0.0 1 55.1 2 100.4 12 14.4 13 0.0 Use the double data type for calculations and velocity and height variables. User input must be validated (numeric value > 0 and within range of the double data type)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 Universal Database V7.1 Application Development Certification Guide

Authors: Steve Sanyal, David Martineau, Kevin Gashyna, Michael Kyprianou

1st Edition

ISBN: 0130913677, 978-0130913678

More Books

Students also viewed these Databases questions