Hi, ok... Here's the story- I have been absent from my Pascal programming class for 3 weeks, I came back and now the teacher wants me to try out a few programs for a test tomorrow. I have one that I have no idea how to do...

Here are the directions:
"Mr.Paul has an amusement park. On one ride, there are many different cabins painted different colors. Since the colors evoke different emotions, each cabin is priced individually.
A group of friends want to ride Mr.Paul's cabin ride. They want to sit together, or in cabins right next to each other.
The amount of friends: N
The capacity of one cabin: K
The amount of cabins: M

Now, the program will get these numbers from a file on the desktop (the file should have N,K,M separated by a space, plus the $$ amount each cabin costs), then it should calculate how many cabins are needed, then which combination is the cheapest for the friends.
So, for an example:
Input: 7 2 10
80 70 40 90 100 60 70 80 80 50

Good luck!"

Ok, so I have absolutely no idea.
I wanted to ask you for help- please please please if anyone knows how to make this program, don't hesitate to write at least a little part of it.
Thank you!!!!

8 Years
Discussion Span
Last Post by Duoas

It sounds like you are out of luck.

If you have been absent for valid reasons (medical emergency, death of immediate family member, etc) many Universities will require the professor to give you reasonable accommodations to make-up the work which you have missed.

I would add that your assignment is not very-well defined. You might want to ask your professor for some clarifications.

Good luck.


Yup, I have been out because I was seriously ill, but I'm only 16 and I'm still in high school... :)
Thank you though...
If anyone else has any idea what do with this, please don't hesitate to write!! (Even if it might not make a lot of sense...)
Thank you for your help!


If you are in the USA then I'm pretty sure that your high school is required to accommodate you.

You might want to google around "greedy algorithm". Find the cheapest set of adjacent cars that holds at least as many people in your group.

Good luck!

This article 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.