Help me fix this POS ASAP

August 7, 2011 at 01:45:11
Specs: Windows 7
Please Help me Fix My POS ASAP . . .

This POS has a 3 category options please help me in this. . . I really need this POS fix immidietly.

for the first category:
1. The creators
2. The history of devc
3. To proceed to the program


On the program the categories are:
1. Accessories
2. Cellphones
3. School Supplies

the program will loop until the user decides to exit the program. . .


See More: Help me fix this POS ASAP

Report •


#1
August 7, 2011 at 01:51:12
#include<stdio.h>
#include<time.h>
int main()
{
int page, qty, num, lc, a, b, c, d, e, f, g, h, i, j, k, l, m;
a=0, b=0, c=0, d=0, e=0, f=0, g=0, h=0, i=0, j=0, k=0, l=0, m=0;
int bracelet=40, ring=100, necklace=60, watch=135;
int n90=12000, n91=14000, n3110c=5000;
int pencil=10, sharpener=5, ballpen=20, marker=40, sbp=1, lbp=2;
char page2, order;
float total, change, cash;

printf("\t\t\t===========+*+*+*+*+*+*============\n");
printf("\t\t\tWell Come To The POS(Point of Sale)\n");
printf("\t\t\t+*+*+*+*+*+============+*+*+*+*+*+*\n\n");
printf("\t\t\t[1] To Know The Creators of this POS\n\n");
printf("\t\t\t[2] To Read The History of Devc++\n\n");
printf("\t\t\t[3] To Run the POS program\n\n");
char strDate [9];
char strTime [9];
_strdate( strDate);
printf( "\t\t\tDate: %s \t\t", strDate);
_strtime( strTime);
printf( "Time: %s \n\n", strTime);
printf("\t\t\tEnter Your Choice [ 1 - 3 ]:");
scanf("%d,&page");
switch(page)
{
case 1:
{
printf("\n\n\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n");
printf("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n");
printf("The Group is composed of the following members:\n");
printf("Gian Paolo d. Madarang - Encoded and made the program\n");
printf("Carl Patindol - Made the Change syntax code\n");
printf("Alvin Dilia - Helped Gian Madarang in encoding and debuging the program\n");
printf("Justin Trinidad - Helped Gian Madarang in Encoding and debuging\n\n");
printf("Press any key to proceed to the POS program");
break;
}
case 2:
{
printf("\n\n\n\n\t\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
printf("\t\t\t\tThe History Of Devc ++\n");
printf("\t\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\n");
printf("\tThe C++ programming language was introduced by Bjarne Stroustrup\t ");
printf("\tof the AT&T laboratories in 1985 as an extension of C, with additional\t ");
printf("\tfeatures borrowed from the esoteric language Simula. Since then, C++\t ");
printf("\thas grown rapidly in response to the practical need for a programming\t ");
printf("\tlanguage that is able to efficiently handle composite and diverse data\t ");
printf("\ttypes. The language implementation is pivoted on the ingenious concept\t ");
printf("\tof object oriented programming (OOP). Today, C++ dominates the\t ");
printf("\t\tcommercial market and is favored among system programmers and\t ");
printf("\t\tapplication developers.\n\n\n\n\n\n");
printf("\tPress anything to proceed to the POS program\n\t>>>>>>>");
break;
}
case 3:
{
printf("\n\n\n\t\t\t>>>>>>>>>>>>*************<<<<<<<<<<<<<<\n");
printf("\t\t\tCategories\t keyword\n\n");
printf("\t\t\tAccesories\t [A]\n");
printf("\t\t\tCellphones\t [B]\n");
printf("\t\t\tSchool Suppies\t [C]\n\n");
printf("\t\t\tPlease Input Your Choice of Category:\n>>>>>>>>>> \n\n");
scanf("%c,&page2");
}

if(page2=='A'||page2=='a')
{
printf("\t\t\tAccesories Prices\n\n");
printf("\t\t\tBracelet [1] Php 40 each\n");
printf("\t\t\tRing [2] Php 100 each\n");
printf("\t\t\tNecklace [3] Php 60 each\n");
printf("\t\t\tWatch [4] Php 135 each\n");
printf("\n\nNumber of Orders:");
scanf("%d", &num);


for(lc=1; lc<=num; lc++)
{
printf("\n\n\nOrder #%d: ", lc);
scanf("%s", &order);
printf("\nQuantity: ");
scanf("%d", &qty);

}
if(order=='1')
{
a=a+qty;
total=a*bracelet;
}

else if(order=='2')
{
b=b+qty;
total=b*ring;
}
else if(order='3')
{
c=c+qty;
total=c*necklace;
}
else if(order='4')
{
d=d+qty;
total=d*watch;
}
printf("\n\nYour bill is: Php%.2f", total);
printf("\n\nEnter cash tendered: Php");
scanf("%f", &cash);
change=cash-total;
printf("\n\nYour change is: Php%.2f", change);
}



else if(page2=='B'||page2=='b')
{
printf("\t\t\tCellPhones Prices\n\n");
printf("\t\t\tN90 [1] Php 12000 each unit\n");
printf("\t\t\tN91 [2] Php 14000 each unit\n");
printf("\t\t\tN3110c [3] Php 5000 each unit\n");
printf("\n\nNumber of Orders:");
scanf("%d", &num);


for(lc=1; lc<=num; lc++)
{
printf("\n\n\nOrder #%d: ", lc);
scanf("%s", &order);
printf("\nQuantity: ");
scanf("%d", &qty);
}
if(order=='1')
{
e=e+qty;
total=e*n90;
}

else if(order=='2')
{
f=f+qty;
total=f*n91;
}
else if(order='3')
{
g=g+qty;
total=g*n3110c;
}
else
{
exit(0);
}
printf("\n\nYour bill is: Php%.2f", total);
printf("\n\nEnter cash tendered: Php");
scanf("%f", &cash);
change=cash-total;
printf("\n\nYour change is: Php%.2f", change);
}




else if(page2=='C'||page2=='c')
{
printf("\t\t\tSchool Supplies Prices\n\n");
printf("\t\t\tPencil Php 10 per piece\n");
printf("\t\t\tSharpener Php 5 per piece\n");
printf("\t\t\tBallpen Php 20 per pieces\n");
printf("\t\t\tMarker Php 40 per pieces\n");
printf("\t\t\tBond paper(short) Php 1 per leaf\n");
printf("\t\t\tBond paper(long) Php 2 per leaf\n");
printf("\n\nNumber of Orders:");
scanf("%d", &num);

for(lc=1; lc<=num; lc++)
{
printf("\n\n\nOrder #%d: ", lc);
scanf("%s", &order);
printf("\nQuantity: ");
scanf("%d", &qty);
}
if(order=='1')
{
h=h+qty;
total=h*pencil;
}

else if(order=='2')
{
i=i+qty;
total=i*sharpener;
}
else if(order='3')
{
j=j+qty;
total=j*ballpen;
}
else if(order='4')
{
k=k+qty;
total=k*marker;
}
else if(order='5')
{
l=l+qty;
total=l*sbp;
}
else if(order='6')
{
m=m+qty;
total=m*lbp;
}
printf("\n\nYour bill is: Php%.2f", total);
printf("\n\nEnter cash tendered: Php");
scanf("%f", &cash);
change=cash-total;
printf("\n\nYour change is: Php%.2f", change);
}

else if(page2!='B'||page2!='b'||page2!='A'||page2!='a'||page2!='C'||page2!='c')
{
printf("\t\t\t Invalid Choice");
exit(0);
}
}

getch();
}


Report •

#2
August 7, 2011 at 02:30:45
What you can see is my POS program but its broken or somewhat. . .
Please help fix this program. . . T_T

Report •

#3
August 7, 2011 at 07:31:37
I am not going to look at a 230 unindented line C program, especially when it contains such helpful variable names like "c" and "m". What's broken? What should it do, and what is it doing?

How To Ask Questions The Smart Way


Report •

Related Solutions

#4
August 8, 2011 at 14:18:59
This is not how a real working program functions. The first category is mostly informational. The data is not stored in a database where the items and prices can be easily updated.

Report •


Ask Question