[mod-- If you want people to help, then you'll have to clean
up the source, or be more careful with your copy/pasting. --mod PN]

This is the program that I created but for some reason I could not
get it to run. Where did I go wrong?


'#include <stdio.h> Main ()'' ''char firstinit=''\0'',
lastinit=''\0'' ''float item1=14.99 item2=5.25 item3=1.85 item4=1.75
item5=14.88 tax=4.30 subtotal=53.72,total=58.02; ''float
taxrate=0.08; ''("\nPlease type the first letter of your first name,
then press enter.") ''scanf("%c",&firstinit)''getchar()'' printf
("\nPlease type the first letter of your last name, then press
enter.")'' scanf("%c",&lastinit)'' getchar()'' printf("\nPlease type
the cost of the first item, then press enter.")'' scanf("%.2f",
&item1)'' getchar()'' printf("\nPlease type the cost of the second
item, then press enter.")'' scanf("%.2f", &item2)'' getchar()'' printf
("\nPlease type the cost of the third item, then press enter.")''
scanf("%.2f", &item3)'' getchar()'' printf("\nPlease type the cost of
the fourth item, then press enter.")'' scanf("%.2f", &item4)'' getchar
()'' printf("\nPlease type the cost of the fifth item, then press
enter.")''  scanf("%.2f", &item5)'' getchar()''
subtotal=item1+item2+item3+item4+item5; tax=subtotal*taxrate;
total=subtotal+tax; printf("\n%c",firstinit,".")'' printf("\n%
c",lastinit,".")'' printf("Your total cost is $%.2f",total)'' getchar
()




--- In [email protected], "Brett W. McCoy" <[EMAIL PROTECTED]>
wrote:
>
> On 5/21/07, mkaylad99 <[EMAIL PROTECTED]> wrote:
>
> > Just curious, how would you create a cash register program in
> > comparison to a calculator program?
>
> A basic calculator only does arithmetic operations.
>
> A cash register will start a "shift" with a certain amount
of "cash",
> and then running totals must be kept for cash that goes in and cash
> that goes out. Then the cash register handles transactions as
> purchases are made, money is taken in, and then change is made, if
> necessary. At the end of a shift, the actual amount of money inside
> the cash register must reconcile against the amounts brought in and
> the amounts taken out. If the amounts don't reconcile, then the
> cashier is dishonest and must be fired.
>
> Is this for a homework problem?
>
> -- Brett
> ------------------------------------------------------------
> "In the rhythm of music a secret is hidden;
>     If I were to divulge it, it would overturn the world."
>                -- Jelaleddin Rumi
>


Reply via email to