For homework we had to generate a table based on user input here's the code //This program prints the altitude and velocity for a ballon over a given amount of time given in hours. #include <stdio.h> #include<math.h> #define FILENAME "balloon1.txt" int main(void){ double t; //t is in hours double alt_max,sum,start_time,end_time,alt,v, period; double time_incr,new_incr; alt_max=0; FILE *balloon; balloon=fopen(FILENAME,"w"); printf("Enter the start time,and end time, in hours:\n Values must be BELOW 48 hours \n"); scanf("%lf %lf",&start_time,&end_time); if(start_time > end_time) { printf("Please choose an end time larger than the start time."); exit(); } if(start_time<0 || end_time>48) { printf("Please enter values that are between 0 and 48"); exit(); } printf("Enter the time increment in minutes: \n must be BELOW 48 hours \n"); scanf("%lf",...
Comments
Post a Comment