Educational
09/08/2015
My sample Logo,, waray mahimo... :)
C++ Program
(All Program using Main Menu)
# include
# define Pi 3.1416
# define q 12
# define ifc 3
# define pw 1
# define pwd 1
# define pc 2
# define SIZE 10
int area,length,width;
int ht,w,l,wdk,pntcost,flrcost,totcost,flr;
int n[SIZE] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 12};
int i, k;
int as,answer,sum;
int r,volume;
int fr;
int m;
int a;
int b;
void menu()
{
do
{
float john,smith,abs,totv,y,z,i;
float ar,mb,mp,r,interest,bal;
float fah,cel;
printf("\n\t***************************************************************");
printf("\n\t* *********************************************************** *");
printf("\n\t* *---------------------------------------------* *");
printf("\n\t* *********************************************************** *");
printf("\n\t* * [0] EXIT * *");
printf("\n\t* *********************************************************** *");
printf("\n\t* * || * *");
printf("\n\t* * [1] ELECTION COUNT || [6] INTER ACTIVE LOOP * *");
printf("\n\t* * [2] VOLUME OF SPHERE || [7] FARENHIET TO CENTEGRAM * *");
printf("\n\t* * [3] MORTAGE || [8] AREA OF A RECTANGLE * *");
printf("\n\t* * [4] HISTOGRAM || [9] ROOM COST ESTIMATE * *");
printf("\n\t* * [5] TURBO C BOX || [10] QUESTION & ANSWER * *");
printf("\n\t* * || * *");
printf("\n\t* *********************************************************** *");
printf("\n\t***************************************************************");
printf("\n");
printf("\n\t ENTER THE NUMBER DO YOU WANT:\t");
scanf("%d", &a);
printf("\n");
switch (a)
{
case 0: printf("\n\t GOOD BYE FOR NOW !!! ");
printf("\n\t HAVE A NICE DAY ");
break;
case 1:
printf("\n\t ENTER THE NUMBER OF VOTE FOR JOHN:\t");
scanf("%f",&john);
printf("\n\t ENTER THE NUMBER OF VOTE FOR SMITH:\t");
scanf("%f",&smith);
printf("\n\t ENTER THE NUMBER OF ABSTENSION:\t");
scanf("%f",&abs);
printf("\n\n\n\n\t NUNMBER WHO VOTE JOHN: %.2f",john);
printf("\n\t NUMBER WHO VOTE SMITH: %.2f",smith);
printf("\n\t NUMBER OF ABSTAIN VOTER: %.2f\n\n",abs);
totv=john+smith+abs;
y=(john/totv)*100;
z=(smith/totv)*100;
i=(abs/totv)*100;
printf("\n\t Total voters: %.2f voters.",totv);
printf("\n\n\t The percent who vote john: %.2f percent.",y);
printf("\n\t The percent who vote smith: %.2f percent.",z);
printf("\n\t Percent of abstention: %.2f percent.\n\n",i);
if (john>smith) {
printf("\n\t The winner is JOHN !!!! \n\n\n\n\n ",john);
}
else if (smith>john){
printf("\n\t The winner is SMITH !!!!\n\n\n\n ",smith);
}
else if (john==smith){
printf("\n\t NOBODY WIN !!!!\n\n\n\n\n");
}
printf("\n\t ENTER TO GO BACK TO MAIN MENU\n\n");
break;
case 2: /* obtain input data */
printf("\n\n\t Enter the radius of a sphere:\t ");
scanf("%d",&r);
/* calculate the volume of a sphere */
volume=Pi*r*r*r;
/* output data */
printf("\n\n\t The volume of a sphere is %d.\n\n\n\n\t",volume);
printf("\n\t ENTER TO GO BACK TO MAIN MENU\n\n");
break;
case 3: /*clrscr();*/
printf("\n\t Enter Mortgage Balance:\t");
scanf("%f",&mb);
printf("\n\t Enter Monthly Payment:\t\t");
scanf("%f",&mp);
printf("\n\t Enter Annual Rate:\t\t");
scanf("%f",&ar);
r=ar/100/q;
printf("\n\tMonth\t\tInterest\tBalance\n");
for(m=1;m
Click here to claim your Sponsored Listing.
Category
Telephone
Website
Address
Sitio Sto Nino Purok 2
Catbalogan
6700