Page 4 of 5 FirstFirst ... 2345 LastLast
Results 31 to 40 of 49
  1. #31

    Default Re: (Help) Parking Lot C Programming.


    TS: Basta magpraktis gani ka ug programming, dapat naa jud comments imo mga code para makasabot ka sa dagan sa mga panghitabo sa imo program. That's the best approach para dali raka makasabot. Code indention is also a must.

  2. #32

    Default Re: (Help) Parking Lot C Programming.

    Quote Originally Posted by haxors View Post
    Deceleration Syntax Error......... Siya master pag compile nako......
    try daw e save as .cpp ang filename extension bai.

    or better yet download updated compiler probably like bloodshed C++ compiler basin naay missing na library sa imong compiler.

    ako gi gamit bloodshed C++ 4.9 so

  3. #33

    Default Re: (Help) Parking Lot C Programming.

    Quote Originally Posted by haxors View Post
    ang kini nga problem mga master dipindi ra sa estudyante kung unsaon niya pag sulbad ang exercise kamo mga master kung kamo ang pa solvon unsa mga mga coding inyo gamiton.. nga ing ini ang output:

    Type of Vehicle: Car or Bus or Truck

    TIME-IN xxx A/P/N/M (Ang A - am, P - pm, N - Noon ug ang M - Midnight)
    TIME-OUT xxx

    PARKING TIME XX:XX
    ROUNDED TOTAL XX:XX (kung ang minute naay value e round off na niya ngadto sa oras bali e add na siya).


    TOTAL CHARGE Php XX.XX


    Compiler Gamit: DL: TC v2.01.rar
    password: power

    Thanks............

    can be done best by C..much better gani turbo C lng LOL...i would suggest you would go lower down your language from visual to turbo...lesser compilation...daghan ka mdiscover sa lower level lng..

    i used turbo C sa una for interface(softwaare manipulated hardware)..

    but suggestion lng na ako, if mao lng na ang resources sa inyo skul, ok ra sad..

  4. #34

    Default Re: (Help) Parking Lot C Programming.

    Quote Originally Posted by haxors View Post
    Mga master salamat kaayo sa inyong tabang..... Baguhan pa jud ko ini nga programming kay 1st year pako sa UC wala jud koy alamag...ining C programming once again salamat sa inyong presensya....tiguwang nako ni iskwela ug programming.....
    and i congratulate you for that.. that is the key for ur success..ur r newbie n programming but determined..

    another suggestion: dont rely on help mostly..troubleshoot ur prog as far as you could, dats a part of the programmer and 1 thing is the most knowledgeable person sa program is the programmer itself,bsan pa cguro ngkasak2x sinagul na u program, mksabot ghapun ka, bcoz you already had built the algorithm of the program(and i assume gi-intrroduce na ni sa imo teacher/profesor dha sa nu sckul)...

    then f wa na gyud ka mhimo, dghan experts dri sa istorya willing to help as ur last resort..

  5. #35

    Default Re: (Help) Parking Lot C Programming.

    Quote Originally Posted by haxors View Post
    Ok ra master bisan unsa man nga paagi ang pwede gamiton ining among exercise..... Thanks sa imo pangutana...
    I see, if this is the case, pili lang unsa imo gamitong nga solution. I suggest that you use the solutions given by the other posters (ka2 wala nagGamit og pointers) ky simple ra. Pointers are quite difficult to use especially kung nagkatOn paka.

    Anyway, if gusto nimo gamit og pointers see my comment about sa imong first code sa page 2.

  6. #36

    Default Re: (Help) Parking Lot C Programming.



    Dili mao ang out put sa Time in ug Time out..

    coding mao ni

    #include <stdio.h>
    #include <stdlib.h>
    #include <conio.h>
    #include <math.h>

    char vtype;
    int ehour;
    int emin;
    int time_hrs, time_min;
    int xhour;
    int xmin;
    int round;

    void getData(void);

    int calculate_charges(int eh, int em, int xh, int xm);
    int get_parking_rates(char vtype, double total_hrs, double totalmins);

    int main(void){
    getData();

    calculate_charges(ehour, emin, xhour,xmin);
    getch();
    }

    void getData(){
    clrscr();
    printf(" Enter Type of Vehicle \n\n C for car \n B for bus \n T for truck\n\n Enter Here: ");
    scanf("%c", &vtype);

    printf("\n Hour vehicle entered 0-24: ");
    scanf("%d",&ehour);
    printf(" Min vehicle entered: ");
    scanf("%d",&emin);

    printf("\n Hour vehicle left 0-24: ");
    scanf("%d",&xhour);
    printf(" Minuite vehicle left: ");
    scanf("%d",&xmin);


    }

    int calculate_charges(int eh, int em, int xh, int xm) {
    int start, end, totaltime;
    double totalmins, total_hrs;

    start = (eh * 60) + (em);
    end = (xh * 60) + (xm);

    totaltime = (end - start);

    total_hrs = (totaltime / 60);
    totalmins = ( totaltime % 60 );

    if (eh > 24 || xh > 24) {
    printf ("\nYour Automobile has been towed away!");
    } else {
    get_parking_rates(vtype, total_hrs, totalmins);
    }
    }


    int get_parking_rates(char vtype, double total_hrs, double totalmins) {

    double parking_rate, total_parking_fee;


    if (vtype == 'c' || vtype == 'C')
    {

    parking_rate = 0.00;

    }

    else
    {

    parking_rate = 25.50;

    }
    if (vtype == 'b' || vtype == 'B')
    {
    parking_rate = 1.00;
    }
    else
    {
    parking_rate = 35.75;
    }
    if (vtype == 't' || vtype == 'T')
    {
    parking_rate = 25.00;
    }
    else
    {
    parking_rate = 43.40;
    }
    clrscr();
    printf ("\n Vehicle Type: Car or Bus or Truck \n\n TIME-IN: %d:%d \n TIME-OUT: %d:%d \n", vtype, ehour, emin, xhour, xmin);

    time_hrs = xhour - ehour;
    time_min = emin + xmin;

    printf("\n Parking Time: %d:%d",time_hrs,time_min);

    if(time_min > 1)
    {
    printf("\n Rounded Total: %d",round,(time_hrs+1));
    }

    total_parking_fee = total_hrs * parking_rate;

    printf("\n\n\b Total Charge: %.2f",total_parking_fee);
    }
    Ang rounded total mahimo nang 3....rounded na cya...

  7. #37

    Default Re: (Help) Parking Lot C Programming.

    pls refer to my last post TS..my suggestions for you..

    try debug until mkuha nimu..

  8. #38

    Default Re: (Help) Parking Lot C Programming.

    based on the example you gave,

    murag ni time in ka og 98:10
    og ni time out ka og 20:20

    then ang parking time nimo 2:50?


    tip TS: e test imong program og sakto na inputs, para imong ma calculate kung sakto ba ka, then formulate a solution.

  9. #39

    Default Re: (Help) Parking Lot C Programming.

    Quote Originally Posted by emailroy2002 View Post
    based on the example you gave,

    murag ni time in ka og 98:10
    og ni time out ka og 20:20

    then ang parking time nimo 2:50?


    tip TS: e test imong program og sakto na inputs, para imong ma calculate kung sakto ba ka, then formulate a solution.


    sakto man boss ang ako input nga time ug minute. mao jud na iyang output....

  10. #40

    Default Re: (Help) Parking Lot C Programming.

    Unsay paagi ini mga master kung gamitan lang ug simple nga walay pointers nga mga methods....

  11.    Advertisement

Page 4 of 5 FirstFirst ... 2345 LastLast

Similar Threads

 
  1. C/C++ i need help in making a program
    By mE_bytes in forum Programming
    Replies: 54
    Last Post: 07-30-2008, 05:41 PM
  2. Need help in Installing Java programs in my Samsung D880
    By Soj in forum Software & Games (Old)
    Replies: 0
    Last Post: 04-24-2008, 06:34 PM
  3. Replies: 12
    Last Post: 04-17-2008, 04:48 PM
  4. Replies: 10
    Last Post: 03-06-2008, 05:26 AM
  5. NEED HELP ON ACCESS-based programming
    By recanada in forum Programming
    Replies: 1
    Last Post: 04-26-2006, 05:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top