Hey everyone, my group and I have this finals project that we'll have to defend. It involves ASCII characters for the table. We've managed to fix the table and everything but no matter what we do, our program won't compute. Here's the program:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
#include <graphics.h>
main()
{
clrscr ();
{
int x,price=0,qty=0,subtotal=0,total=0;
char item[20];
for(x=8;x<=69;x++)
{gotoxy(x,6);textcolor(5);cprintf("Í");
gotoxy(x,25);textcolor(5);cprintf("Í");
}
for(x=7;x<=25;x++)
{gotoxy(8,x);textcolor(5);cprintf("º");
gotoxy(70,x);textcolor(5);cprintf("º");
}
for(x=10;x<=68;x++)
{gotoxy(x,7);textcolor(5);cprintf("Í");
gotoxy(x,24);textcolor(5);cprintf("Í");
gotoxy(x,9);textcolor(5);cprintf("Í");
gotoxy(x,10);textcolor(5);cprintf("Í");
}
for(x=8;x<=20;x++)
{gotoxy(10,x);textcolor(5);cprintf("º");
gotoxy(68,x);textcolor(5);cprintf("º");
}
for(x=11;x<=24;x++)
{gotoxy(10,x);textcolor(5);cprintf("º");
gotoxy(68,x);textcolor(5);cprintf("º");
}
for(x=11;x<=23;x++)
{gotoxy(20,x);textcolor(5);cprintf("³");
gotoxy(30,x);textcolor(5);cprintf("³");
gotoxy(40,x);textcolor(5);cprintf("³");
gotoxy(50,x);textcolor(5);cprintf("³");
}
gotoxy(25,8);
printf("BSIT-NW I-B");
gotoxy(49,8);
printf("GROUP 2");
{
gotoxy(8,6);textcolor(5);cprintf("É");
gotoxy(70,6);textcolor(5);cprintf("»");
gotoxy(8,25);textcolor(5);cprintf("È");
gotoxy(70,25);textcolor(5);cprintf("¼");
}
{
gotoxy(10,7);textcolor(5);cprintf("É");
gotoxy(68,7);textcolor(5);cprintf("»");
gotoxy(10,9);textcolor(5);cprintf("È");
gotoxy(68,9);textcolor(5);cprintf("¼");
}
{
gotoxy(10,10);textcolor(5);cprintf("É");
gotoxy(68,10);textcolor(5);cprintf("»");
gotoxy(10,24);textcolor(5);cprintf("È");
gotoxy(68,24);textcolor(5);cprintf("¼");
}
{
gotoxy(13,11);
printf("Item");
gotoxy(23,11);
printf("Price");
gotoxy(33,11);
printf("Qty.");
gotoxy(42,11);
printf("Subtotal");
gotoxy(53,11);
printf("Total/Change\n");
gotoxy(13,12);
scanf("%s",&item);
gotoxy(23,12);
scanf("%i",&price);
gotoxy(33,12);
scanf("%i",&qty);
gotoxy(42,12);
scanf("%i",subtotal);
gotoxy(53,12);
scanf("%i",&total);
}
return 0;
}
}
The first formula is subtotal=price*qty. We don't have the formula for the total yet since we first need to make the subtotal work for the total to work in turn. Hope anyone can help us! Thanks! <3