-1

Hi There PLease i Need Help>>>> :)

can any one Write me a program to do the following..?PLzzz


It costs 1.500$ for each 20 minutes traveled by taxi. Enter the rate at which the driver is driving along with the distance that is to be traveled then calculate the amount that must be paid and print the result on the screen. use the formula: Distance = rate * time..


That's It I know that it's simple but am new at programing so i need help thanxx..

by the way * means times (multiplication)

4
Contributors
5
Replies
9
Views
6 Years
Discussion Span
Last Post by nory22
-1
#include<stdio.h>
 int main () 
 {
     float rate=0;
     float distance=0;
     
     printf("Enter The Rate at which the driver is driving: ");
     scanf("%f", &rate );
     
     printf("Enter The Distance that have been traveled: ");
     scanf("%f", &distance);
     
     float time;
     time=distance/rate;
     
     float amount;
     
     amount=time*0.075;
     
     printf("Total Amount: ", amount);
     
     getchar();
     return 0;
 }
0

you miss the %f sign shauzi

printf("Total Amount: %f", amount);

Edited by slygoth: n/a

2

You shouldn't do peoples homework for them. They learn nothing from it and someday they might be your coworker and you don't want to be doing all their work for them and yours.

Votes + Comments
Mor than right!
0

thank u all for your help Thnxxxx shauzi158 for your help.......

and thank you Momerath you are so right

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.