I got some problem here,my ascii arts are not allign properly when i run the program and there is some error in ascii art.Anyone can help me?
"I copy this directly from my dev c++"
#include<stdio.h>
#include<stdlib.h>
int main()
{
int hour,car,ch;
float fhp,chp,price1,price2,total;
printf(" _._ ");
printf(" _.-="_- _ ");
printf(" _.-=" _- | ||"""""""---._______ __.. ");
printf(" ___.===""""-.______-,,,,,,,,,,,,`-''----" """"" """"" __' ");
printf(" __.--"" __ ,' o \ __ [__| ");
printf(" __-""=======.--"" ""--.=================================.--"" ""--.=======: ");
printf(" ] [w] : / \ : |========================| : / \ : [w] : ");
printf(" V___________:| |: |========================| :| |: _-" ");
printf(" V__________: \ / :_|=======================/_____: \ / :__-" ");
printf(" -----------' ""____"" `-------------------------------' ""____"" ");
printf("----------------------------------------------\n");
printf(" CAR INFO \n");
printf("----------------------------------------------\n");
printf("1. BMW 518i\n");
printf("1. Hummer H3\n");
printf("1. Mercedes Benz SLK\n");
printf("----------------------------------------------\n");
printf("Enter car :");
scanf("%d",&car);
printf("Enter car hours :");
scanf("%d",&hour);
switch(car)
{
case 1:
fhp=5;
ch=hour-5;
chp=2;
break;
case 2:
fhp=4;
ch=hour-5;
chp=1;
break;
case 3:
fhp=6;
ch=hour-5;
chp=3;
break;
default:
printf("INVALID CODE\n");
break;
}
if(hour<=5)
{
price1=fhp*hour;
price2=0;
}
else if(hour>5)
{
price1=5*fhp;
price2=ch*chp;
}
total=price1+price2;
printf("----------------------------------------------\n");
printf(" BILL \n");
printf("----------------------------------------------\n");
printf("car\t\t:%d\n",car);
printf("total hours\t:%d\n",hour);
printf("price (first hour)\t:RM%.2f\n",price1);
printf("price (consequent hour)\t:RM%.2f\n",price2);
printf("payment\t\t:RM%.2f\n",total);
system("pause");
}

New Topic/Question
Reply




MultiQuote





|