Results 1 to 15 of 15

Thread: [RESOLVED] Can anyone please write this program?

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2011
    Posts
    3

    Resolved [RESOLVED] Can anyone please write this program?

    Can anyone tell me the Visual Studio 2008 code to run a simple program that will do the following:

    A friend of mine is a carpet layer. He needs a way to calculate how much carpet he needs to carpet floors in various rooms.
    The carpet he has is supplied in rolls that are 5 meters wide and 30 metres long. Any excess width is discarded. This means that rooms that are wider than 5 meters need several strips of carpet. The smallest space that he will carpet is 1m x1m, the biggest is 20m x 20m. At the moment , he has to draw diagrams to work out how much carpet he needs. I told him that I could get a computer program to work this out for him. So I need to make a program that will tell him:

    1) How many metres of carpet he will need to cover a room.
    2) How many rolls of carpet that will be.
    3) How much full-width carpet he will have left on the last roll.

    He charges for his carpet by the metre, so he only works in the whole metre lengths. In other words even if he only needed 1.6 meters of carpet for the room, he would charge the customer for 2 meters because he has to discard the unused part of the metre.

    Must include: The program must be simple and something like a form that can be filled in. Keyboard input. Screen output. Looping. Iteration. Decisions/selection. Arithmetic and data validation.

    Example:
    Imagine that he has to carpet a room that is 11 meters wide and 15 meters long.Each roll of carpet is 5 meters wide by 30 metres long when it is unrolled.
    Therefore, this room will need 3 strips of carpet. Each strip will be 15 metres long. The first two strips will be the fill 5 metres wide, but the final strip will have to be cut so that it is only 1 metre wide.

    Your help is GREATLY appreciated

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Can anyone please write this program?

    You might have better luck if you admitted that this was a class assignment and asked us for our help rather than trying to con us into thinking that you're doing this for a friend. Why on earth would your friend the carpet layer require you to include things like looping/iteration? Why would he care or even know that that's what programs contain? Maybe I'm wrong and, if so, I apologise, but I very much doubt it. If this is how you get your homework done then I'm afraid that you don't deserve to pass. Show us what effort you've made and tell us where you're stuck and you'll find lots of people eager to help. Try to trick us into doing your work for you and see how many friends you make.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Can anyone please write this program?

    Even worse is a carpet layer who happens to know in advance the largest size room he will ever carpet.

    I should also point out that if this were a real problem, you are pretty much trying to solve a type of problem for which there is no perfect solution, so only non-linnear options would work to any extent. Fortunately for you, it isn't a real problem, and you are allowed to simplify it to make it tractable.
    My usual boring signature: Nothing

  4. #4
    Member fixo's Avatar
    Join Date
    Aug 2011
    Location
    SPb, Russia
    Posts
    45

    Re: Can anyone please write this program?

    Think your friend have a got a floor plans which was drawn
    in AutoCAD or ArchiCAD
    If so you better go to www.theswamp.org and ask in there about
    this task on .ARX or .NET section

  5. #5
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780

    Re: Can anyone please write this program?

    Quote Originally Posted by jmcilhinney View Post
    You might have better luck if you admitted that this was a class assignment and asked us for our help rather than trying to con us into thinking that you're doing this for a friend.
    I actually think it was just a copy/paste from the assignment, all the OP did was add a hello and thanks line. Defo class assignment.

  6. #6
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    Re: Can anyone please write this program?

    Quote Originally Posted by Grimfort View Post
    I actually think it was just a copy/paste from the assignment, all the OP did was add a hello and thanks line. Defo class assignment.
    Just about, but in the assignment (177K .Doc) it's "Bob is a carpet layer...", maybe the OP knows Bob personally!

  7. #7
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Can anyone please write this program?

    Quote Originally Posted by Edgemeal View Post
    Just about, but in the assignment (177K .Doc) it's "Bob is a carpet layer...", maybe the OP knows Bob personally!
    Totally classic
    My usual boring signature: Nothing

  8. #8
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Can anyone please write this program?

    Ever notice how school projects never actually equate to real world projects? You can spot them a mile away.

  9. #9
    Hyperactive Member Grunt's Avatar
    Join Date
    Oct 2004
    Location
    Las Vegas
    Posts
    499

    Re: Can anyone please write this program?

    Sure I'll write it. $100 to my paypal account. Everyone deserves to get paid for doing other peoples work.
    My Mobile Software Development Company - http://www.mbpsoftllc.com

  10. #10
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,397

    Re: Can anyone please write this program?

    I agree with Grunt. Plus he's thinking in real life senario's. I need someone to program this for me:

    I have a friend that is a professor at the university I go to, DOU(Drop Out University). He needs a simple calculator that calculates how many of his students are going to join his class and vbforums.com to do his assignments for free. He will only have a max of 10 students in his class per period, but he buys students in 11x1 per period.

    Must include: The program must be simple and something like a form that can be filled in. Keyboard input. Screen output. Looping. Iteration. Decisions/selection. Arithmetic and data validation

    Example: If he has 3 periods, and 10 students in each one, he would need to kill 3 students.

    Thanks y'all :]
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

  11. #11
    Hyperactive Member Max Peck's Avatar
    Join Date
    Oct 2007
    Posts
    384

    Re: Can anyone please write this program?

    Quote Originally Posted by Grunt View Post
    Sure I'll write it. $100 to my paypal account. Everyone deserves to get paid for doing other peoples work.
    Boy, you work CHEAP!

    -Max
    The name's "Peck" .... "Max Peck"

    "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." - Red Adair

  12. #12
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Can anyone please write this program?

    I was going to say that, too, but then I considered the problem a bit more. If it were anything other than a simplistic homework assignment, the problem is actually quite difficult. After all, figuring the minimal amount needed for any given room up to 20x20 for a real business would mean figuring out the minimum amount needed, and whether or not existing scraps could be used. Since the shape of real rooms is not necessarily rectangular, this becomes an NP-complete problem, for which no good solution exists, but some solutions can be 'pretty good'.

    However, since this is an academic exercise, writing some kind of nonlinnear search program is certainly not what is intended. After all, the problem states that Bob will charge for the meter, and doesn't ask what happens to the unused portion (in fact, it suggests that he will throw away any partial roll, since he will throw away any partial meter scrap). Once you simplify it in that way, you can also assume that all rooms are rectangular in shape, which makes the problem so trivial that $100 isn't really that cheap.

    Had I the time, I would have modified a genetic algorithm program I wrote that solves a similar NP-complete problem (it's in the codebank). Frankly, if the OP submitted that, they would deserve whatever they had coming to them. If they could explain what it did, then they would deserve a good grade. Otherwise....well, they would deserve whatever happened. Fortunately, I don't have the time.
    My usual boring signature: Nothing

  13. #13
    Junior Member
    Join Date
    Aug 2011
    Posts
    21

    Re: [RESOLVED] Can anyone please write this program?

    Looks like this is a popular question.

  14. #14
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: [RESOLVED] Can anyone please write this program?

    hahaha... looks like the same poster... nice.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  15. #15
    Fanatic Member
    Join Date
    Nov 2007
    Posts
    520

    Re: [RESOLVED] Can anyone please write this program?

    Oh how I remember seeing posts like this on vWorker, and people paying "top dollar"(aka $5)...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width