here is another update. no more for today from me.
#include <stdio.h> #include <math.h> int main (void) { float diameter, area, radius, circumference, choice; float number1, number2, number3, answer, choice2; char function; printf("SUPER CALCULATOR\n"); printf("------------------------------------\n \n"); printf(" 1 = Cricumference of a Circle\n 2 = Area of a Circle\n 3 = Area of a Rectangle or Rectangular Prism\n 4 = Perimeter of a Rectangle\n 5 = Cube Surface Area\n 6 = Triangle Area\n 7 = Pyramid Area\n \n \t - "); scanf("%f", &choice); if (choice == (float)1) { printf("What is the diameter of the circle?\n \n \t - "); scanf("%f", &diameter); circumference = diameter * 3.14; printf("\n \n \t Circumference = %f units\n \n", circumference); } if (choice == (float)2) { printf("What is the radius of the circle???\n \n \t - "); scanf("%f", &radius); area = (radius * radius) * 3.14; printf("\n \t Area = %f units^2\n \n", area); } if (choice == (float)3) { printf("What is the width of the rectangle?\n \n \t - "); scanf("%f", &number1); printf("What is the height of the rectangle?\n \n \t - "); scanf("%f", &number2); printf("Is the figure a rectangular prism? 1 = yes, 2 = no\n \n \t - "); scanf("%f", &choice2); if (choice2 == (float)1) { printf("What is the length of the rectangular prism?\n \n \t - "); scanf("%f", &number3); answer = number1 * number2 * number3; printf("\n \n \t Area = %f units^3\n \n", answer); } if (choice2 == (float)2) { answer = number1 * number2; printf("\n \n \t Area = %f units^2\n \n", answer); } } if (choice == (float)4) { printf("what is the width of the rectangle???\n \n \t - "); scanf("%f", &number1); printf("what is the height of the rectangle???\n \n \t - "); scanf("%f", &number2); answer = (number1 * 2) + (number2 * 2); printf("\n \n \t Perimeter = %f units\n \n", answer); }; if (choice == (float)5) { printf("what is the width of the rectangular prism???\n \n \t - "); scanf("%f", &number1); printf("what is the height of the rectangular prism???\n \n \t - "); scanf("%f", &number2); printf("what is the length of the rectangular prism???\n \n \t - "); scanf("%f", &number3); answer = ((number1 * number2) * 2) + ((number2 * number3) * 2) + ((number3 * number1) * 2); printf("\n %f units^2\n \n", answer); } if (choice == (float)6) { printf("What is the height of the triangle???\n \n \t - "); scanf("%f", &number1); printf("what is the width of the triangle???\n \n \t - "); scanf("%f", &number2); answer = (number1 * number2) / 2; printf("\n %f units^2\n \n", answer); } if (choice == (float)7) { printf("pyramid width\n \n \t - "); scanf("%f", &number1); printf("pyramid length\n \n \t - "); scanf("%f", &number2); printf("pyramid height\n \n \t - "); scanf("%f", &number3); answer = (number1 * number2 * number3) / 2; printf("\n %f units^3\n \n", answer); } system("PAUSE"); return 0; }
this includes surface area of a cube and area of a pyramid. it also has area of a tryangle.
sorry for all the posts lately. nobody has been posting lately. normally people post more, and i, for some reason, am a little excited about this. sorry.
matt wuz here
|