CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Deploying Windows Server 2008 with System Center
  • Remote Desktop Protocol Performance Improvements in Windows Server 2008 R2 and Windows 7
  • The Microsoft Dynamics CRM Security Model
  • SQL Server Modeling Services with Microsoft Visual Studio 2010 Beta 2

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > General Discussion > Algorithms & Data Structures
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Algorithms & Data Structures Discuss algorithms & data structures. Topics are not specific to any programming language.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old September 19th, 2009, 02:48 PM
    Mothergoose729's Avatar
    Mothergoose729 Mothergoose729 is offline
    Junior Member
     
    Join Date: Sep 2009
    Posts: 3
    Mothergoose729 is an unknown quantity at this point (<10)
    Help with flow chart and Pseudo code (visio)

    Hi, first time posting here. I am in a beginning algorithms class and we have to create a flow chart for a problem and then code a solution in VB. Anyway, the program premise consists of this:

    Calculate the cost for painting a picture. The cost is dependent on the number of people and time of day.

    1 Person= 100
    2 people= 130
    3 People= 150
    4 people=165
    More then 4 people= random number between 200-300

    If saturday or sunday add 20%
    If 3 people on monday deduct 10%
    If 4 people on thursday deduct 15%

    I have written it out in pseudo code, if this isn't right let me know. We are only allowed to use if/else statements (no case or anything like that) and simple boolean expressions.

    Quote:
    Start
    Input NumberPeople
    If NumberPeople=1 then
    BasePrice = 100
    Elseif NumberPeople = 2
    Then Price = 130
    Elseif NumbePeople= 3
    Then Price= 150
    Elseif NumberPeople=4
    Then Price=165
    Elseif NumberPeople< 1
    Then Print “We don’t do landscapes”
    Elseif NumberPeople > 4
    Then Price=Random2-300
    Endif
    Endif
    Endif
    Endif
    Endif
    Endif
    Input Day

    If Day = Sunday
    Then Price = Price + (Price(.2))
    Elseif Day = Monday AND NumberPeople = 3
    Then Price = Price – (Price(.1))
    Elseif Day = Thursday AND NumberPeople = 4
    Then Price = Price – (Price(.15))
    Print Price
    My only question is, does that logic look right?

    Also, in Visio, to represent a flow chart, I represent those complicated if/else statements? I think what I do is have a diamond with every "if- ifelse" line, and a then a rectangle for each "then" statement. Normally, in class, we had to options and each branching line was labeled "yes" or "no". Would I lable the lines "=3, =1, <4, ect?"

    Any help would be very, very much appreciated.
    Reply With Quote
      #2    
    Old September 19th, 2009, 10:45 PM
    Mothergoose729's Avatar
    Mothergoose729 Mothergoose729 is offline
    Junior Member
     
    Join Date: Sep 2009
    Posts: 3
    Mothergoose729 is an unknown quantity at this point (<10)
    Re: Help with flow chart and Pseudo code (visio)

    Quote:
    Originally Posted by Yueliang View Post
    Why not if it works ?
    Are you making a guessing program to show how "rightous" you are ? The reason I am HERE AND ALWAYS COMING IS TO URGE FOR RECOUPING WHAT I LOST!
    I WILL ALWAYS COMING BACK FOR MORE! GETTING ALL BACK IS A MUST. whenever I like
    It is an assignment for my class. I don't mean to be rude, but I don't understand a thing you said or how it has anything to do with what I am working.
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > General Discussion > Algorithms & Data Structures


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 02:44 PM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.