Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1 #include<stdio.h>
- 2
- 3 int main(void) {
- 4
- 5 float launchHeight;
- 6 int launchAngle;
- 7 float launchVelocity;
- 8 int test = 1;
- 9
- 10 printf("Hello and welcome to the Ballistic Calculator v0.0.2! This program is licensed under the GPL V3.0 a nd was written by TuxFuk\n\n");
- 11
- 12 printf("Changelog\n");
- 13 printf("Spelling fixes\n\n");
- 14
- 15 while (test == 1) {
- 16 /* Launch Height Section */
- 17 printf("Please enter a height above the ground in meters.\n");
- 18
- 19 scanf("%f", &launchHeight); /* takes user input and stores it in launchHeight's memory address */
- 20 if (launchHeight < 0) {
- 21 printf("Input Error: Expected a positive number\n");
- 22
- 23 }
- 24 printf("you did it!\n");
- 25 }
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33 printf("\n You entered: %f meters\n", launchHeight);
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43 /* Launch Angle Section */
- 44 printf("Please enter a launch angle in degrees \n");
- 45
- 46 scanf("%d", &launchAngle); /* takes user input and stores it in launchAngle's memory address * /
- 47
- 48 printf("\n You entered: %d degrees\n", launchAngle);
- 49
- 50 /* error code: printf("Input Error: Expected an angle between 90 and -90 degrees\n"); */
- 51
- 52
- 53
- 54 /* Launch Velocity Section */
- 55 printf("Please enter an initial launch velocity in m/s\n");
- 56
- 57 scanf("%f", &launchVelocity); /* takes user input and stores it in launchVelocity's memory addres s */
- 58
- 59 printf("\n You entered: %f m/s\n", launchVelocity);
- 60
- 61 /* error code: printf("Input Error: Expected a positive number\n"); */
- 62
- 63
- 64
- 65
- 66
- 67 return 0;
- 68 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement