Thread: Guys I need Help with this assignment. Its due in 4 hours.

  1. #1
    Registered User
    Join Date
    Apr 2020
    Posts
    1

    Guys I need Help with this assignment. Its due in 4 hours.

    It should be written in C and loops must be used.
    Thanks slot

    Cargo Ship
    --------------------------------------------------------


    You have to transport a maximum of 15 different loads from one port to another. Carrying capacity of a cargo ship, which will transport those loads, is 50 tons. Loads are enumerated and the information about the weight of every load is given as input.


    Suppose that the weight of every load is smaller than or equal to 50 tons and greater than 0.


    You will read the weight of every load from the input in a single line. Your input will end with a -1. You will print the number of trips necessary.


    Sample Runs
    ----------------------------------------------------------


    Input:
    50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 -1


    Output:
    15


    Input:
    20 25 25 36 37 25 20 10 50 9 16 45 32 10 25 -1


    Output:
    11


    Input:
    14 16 50 10 10 19 45 40 32 24 25 47 10 12 25 -1


    Output:
    9


    Input:
    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 -1


    Output:
    3

  2. #2
    Registered User
    Join Date
    Aug 2019
    Location
    inside a singularity
    Posts
    299
    > Guys I need Help with this assignment. Its due in 4 hours.

    This is not the place to get your homework done. The problem is pretty easy and can be done in less that 4 hours. If you don't know the language and how to code, well, 4 hours seems like a good investment of time. Good luck, either way.
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook, The Wizardry Compiled

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,968
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 6
    Last Post: 06-15-2013, 10:54 PM
  2. help with automobile gallery assignment! i have 2 hours!
    By Ergys Ura in forum C Programming
    Replies: 12
    Last Post: 03-23-2012, 05:39 AM
  3. 7 hours?
    By Jeffery in forum C Programming
    Replies: 1
    Last Post: 10-10-2010, 02:49 AM
  4. Replies: 3
    Last Post: 08-25-2008, 12:39 PM
  5. 46 hours to assignment submission
    By technoXavage in forum Game Programming
    Replies: 9
    Last Post: 12-23-2003, 03:15 PM

Tags for this Thread