Thread: assistance in function

  1. #1
    Registered User
    Join Date
    Feb 2008

    assistance in function

    i am supposed to build a system which will produce output axactly d same as below:

    car hours charges
    1 1.5 2.00
    2 4.0 2.50
    3 24.0 10.00
    TOTAL 29.5 14.50

    user have to enter the value of hour and the counting is as follows:
    within 3 hours, parkers are charged $2.00;
    exceed 3 hours, parkers are charged $0.50 per hour and part thereof in excess of 3 hours;
    maximum is 24 hours and are charged $10.00;

    i wonder how to print and save the value of hour entered by user as i can't showed it as below:

    Enter the hour: __

    please help..

    my code is as follow:
    float enter_hours(float w);
    float calculateCharges(float x,float y);
    int main ()
    	float r,p,q;
     for (int count=0;count<2;count++);
    return (0);
    float enter_hours(float w)
     float x;
     printf(" ");
    float calculateCharges(float n,float x)
      if (x<=3){
      return 2.00;
      if (x>3 && x<24){
      return 2.00+0.50*n;
      if (x==24){
      return 10.00;
    Last edited by patron; 03-16-2008 at 05:38 AM.

  2. #2
    Registered User
    Join Date
    Feb 2008

    urgently awaits assistance

    are there any wrong wif my code...?
    I no it isn't perfect..

    please anyone..
    help me to correct it as i'm really blurred with the concept of function...


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 02:07 AM
  2. Seg Fault in Compare Function
    By tytelizgal in forum C Programming
    Replies: 1
    Last Post: 10-25-2008, 03:06 PM
  3. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  4. Troubleshooting Input Function
    By SiliconHobo in forum C Programming
    Replies: 14
    Last Post: 12-05-2007, 06:18 AM
  5. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 01:28 PM
Website Security Test