Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Loops
Message
De
22/09/2002 19:37:05
 
 
À
Tous
Information générale
Forum:
Borland C++ Builder
Catégorie:
Langage C++ Builder
Titre:
Loops
Divers
Thread ID:
00703216
Message ID:
00703216
Vues:
61
Hi all, I am new to C++ Builder. I am having a problem, I need your help.
This is my program, called "Weather Balloons"
***
#include
#include

int main(void)
{
/* Declare and initialize variables. */
double initial, increment, final, time, height,
velocity, max_time=0, max_height=0;

/* Get user input. */
printf("Enter initial value for table (in hours) \n");
scanf("%lf",&initial);
printf("Enter increment between lines (in hours) \n");
scanf("%lf",&increment);
printf("Enter final value for table (in hours) \n");
scanf("%lf",&final);

/* Print report heading. */
printf("\n\nWeather Balloon Information \n");
printf("Time Height Velocity \n");
printf("(hrs) (meters) (meters/s) \n");

/* Compute and print report information. */
for (time=initial; time<=final; time+=increment)
{
height = -0.12*pow(time,4) + 12*pow(time,3)
- 380*time*time + 4100*time + 220;
velocity = -0.48*pow(time,3) + 36*time*time
- 760*time + 4100;
printf("%6.2f %8.2f %7.2f \n",
time,height,velocity/3600);


if (height > max_height)
{
max_height = height;
max_time = time;
}
}

/* Print maximum height and corresponding time. */
printf("\nMaximum balloon height was %8.2f meters \n",
max_height);
printf("and it occurred at %6.2f hours \n",max_time);

/* Exit program. */
return 0;
}
*********
My question is how to modify to program to generate a table showing the weather balloon information for every 10 minutes over 2-hour period, starting at 4 hrs after the balloon was lauched.
Please help. Thank you very much.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform