Answered step by step
Verified Expert Solution
Question
1 Approved Answer
my code isnt printing and im not sure why. here's my code: // midtermc++.cpp : This file contains the 'main' function. Program execution begins and
my code isnt printing and im not sure why.
here's my code:
// midtermc++.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include
using namespace std;
int main ()
{
// time
int time = 0;
// height
int height = 3;
// loops until ball hits the ground so it won't go into negatives
while (time >= 3)
{
// h = 3 + 10t - t^2
height = 3 + (10 * time) - (time * time);
// go up in increments of 1
time++;
cout << "Height- " << height << " " << "Time-" << time << ' ';
return 0;
}
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started