Thread: train code

  1. #1
    Registered User
    Join Date
    Mar 2014
    Posts
    5

    train code

    A train is good if the following conditions are met.

    1. Number of words in the name should be greater than 1 and last word must be "Mail" or "Express".
    2. Average speed should be greater than 70 kmph.
    3. Total journey distance should be greater than 700km.
    4. (Total distance)/(no. of stations) should be greater than 50 if the train is "Mail". If it is an "Express" train, this ratio must be atleast 100.
    5. Passenger should be happy.
    6. There should be a "3AC" Coach if the distance is greater than 1000 km. Additionally, it must also have a "2AC" coach if the distance is more than 1500 km.

  2. #2
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    Very interesting. Did you have a question?

  3. #3
    Registered User
    Join Date
    Mar 2014
    Posts
    5
    plzz send me the code with in one hour..its very urgent...

  4. #4
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,738
    Nope.
    Devoted my life to programming...

  5. #5
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    Waited until the last minute, eh?

    Well, we are not a free code writing service - we are here to answer questions and help people learn. Also note that this forum has a homework policy. You need to attempt this problem yourself, and if you get stuck, come back and ask specific questions about what you're having problems with.

  6. #6
    Registered User
    Join Date
    Mar 2014
    Posts
    5
    ths is the question and i want code in C program...can u help me?

  7. #7
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    Note I said "specific questions". Also, "Do it for me" is not a question. Show us your best attempt, or at least even a start, and perhaps we can help guide you to a working solution. When you post code, be sure to post it in code tags.

  8. #8
    Registered User
    Join Date
    Nov 2012
    Posts
    157
    i started to write, but then i got as lazy as you...this is all i could do with little to no effort applied

    Code:
    /*nothing*/

  9. #9
    Registered User
    Join Date
    Mar 2014
    Posts
    5
    hello i got the mail today at 8.00pm about ths program and i have to write ths code with in 2hours and i have to submitt it..

  10. #10
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    So start writing it!

    Look, I've already explained about the rules and what kind of help you can expect here. You have to do the work yourself, and ask questions when you get stuck.

    If you persist in trying to get someone to give you a full solution, then I will simply ignore this thread.

  11. #11
    Registered User
    Join Date
    Mar 2014
    Posts
    5
    thanq....i compltd the task...its done..

  12. #12
    Kiss the monkey. CodeMonkey's Avatar
    Join Date
    Sep 2001
    Posts
    937
    You are wise and resourceful.
    "If you tell the truth, you don't have to remember anything"
    -Mark Twain

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Train simulation
    By mikel360 in forum C Programming
    Replies: 4
    Last Post: 02-24-2011, 12:46 PM
  2. Replies: 14
    Last Post: 04-01-2008, 02:23 AM
  3. Mouse Train in OpenGL
    By Ti22 in forum C Programming
    Replies: 2
    Last Post: 11-07-2004, 12:58 PM
  4. Having trouble translating psudeo-code to real-code.
    By Lithorien in forum C++ Programming
    Replies: 13
    Last Post: 10-05-2004, 07:51 PM
  5. If train A leaves the station at 9:30 with a speed of 90mph, and train B...
    By -KEN- in forum A Brief History of Cprogramming.com
    Replies: 31
    Last Post: 05-10-2003, 12:35 AM