+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Junior Member
    Join Date
    Feb 2009
    Posts
    1

    Pseudocode? I have a problem doing this problem.?

     
    You are the owner of a vegetarian pizzeria and you want to write a program to allow the customer to order only ONE pizza online. You will prompt the customer for his/her name, pizza size being order (small, medium, or large), and pizza type being ordered (veggie or cheese), and then input this data. You are to output the customer name, pizza size, pizza type, and cost of pizza back to the customer. For a veggie pizza, small costs $10, medium costs $12.25, and large costs $14.50. For a cheese pizza, small costs $7, medium costs $8, and large costs $9. Be sure to validate the size and type of pizza, and if the data is invalid, output an appropriate message to the customer.

    I don't understand how to write this as a pseudocode. This is not my homework. This is an extra problem I'm trying to do on my own to understand how to do other kind of pesudocode's problems.

  2. #2
    Not Really a Member
    Join Date
    Oct 2001
    Posts
    27,856
    pseudocode isn't really code, so its really just laying out the problem


    Prompt customer for name, size of pizza, type of pizza
    If pizza = veggie then
    if pizza = large then price = blah
    if pizza = med then price = blah

    etc etc

  3. #3
    Caveat Emptor Rootstonian's Avatar
    Join Date
    Mar 2005
    Location
    Out of my mind
    Posts
    3,326
    Never got much into psuedocode much during my college days even though they tried to teach it. Why? Never liked the idea of "half" writing it it English when I could be writing acutal code...waste of time when you're busy enough already in college.

    Now, flowcharts were my thing But that's just me because I'm a visual-type of person and it really helped we work out program flow before putting fingers to keyboard. Sometimes I would flowchart entire programs in general or specific portions of a program in detail as needed. Worked for me...

  4. #4
    Member
    Join Date
    Mar 2005
    Posts
    93
    Set Size1=small
    Set Size2= medium
    Set Size3 = Large
    Set type1 = Veggie
    Set type2= Cheese
    Set prices1t1=
    set prices2t1=
    Set prices3t1=
    (and so on)
    Receives Name from User
    Prints Size1, Size2, Size3
    Receives Size from User
    Prints Type1, Type2
    Receives Type from User
    Print Name, Size#, Type#, Sum


    This is very very generic, but pseudo code and all.

  5. #5
    Junior Member
    Join Date
    Mar 2009
    Posts
    7
    If you are the only programmer, my suggestion is not to try to force your problem into pseudo code, but instead just to write it down in your way.
    Pseudo code can be nice though if you are several programmers in the same project. But even then, words and flow charts have worked better for me.

  6. #6
    Caveat Emptor Rootstonian's Avatar
    Join Date
    Mar 2005
    Location
    Out of my mind
    Posts
    3,326
    Ok, I'm going to do this as a one-time favor and since it's kind of old.

    Ask customer for name
    Ask customer for pizza size (S)mall, (M)eduim or (Large)
    If pizza size not equal S or M or L
    tell customer to order Small Medium or Large

    Ask customer for pizza type (V)eggie or (C)heese
    If pizza type not equal V or C
    tell customer to select Veggie or Cheese

    If pizza type = Cheese
    If pizza size = large
    pizza cost = 9.00
    tell customer cost
    If pizza size = medium
    blah, blah, blah

    "Thank you for your order" name
    "You ordered one " pizza size pizza type
    "Your bill is " pizza cost

  7. #7
    Junior Member
    Join Date
    Apr 2009
    Posts
    3

    Question Pseudocode for project

    i need a pseudocode for a list of employees and salaries and determine the mean (average) salary as well as the number of salaries above and below the mean

  8. #8
    Super F@D Folder
    Join Date
    Jun 2004
    Posts
    5,091
    have you even given in a shot? As this seems like the type of thing that must be a homework assignment I wouldn't expect to get complete answers. Look at root's post right above yours for a good example of pseudocode.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Computer Problem out of the blue...(long post explaing problem)
    By Aegaeonos in forum General Tech Discussion
    Replies: 3
    Last Post: December 21st, 2006, 05:37 PM
  2. IE Save picture problem/Real player problem
    By smkeller9 in forum Technical Support
    Replies: 3
    Last Post: February 22nd, 2004, 03:42 PM
  3. Pseudocode Algorithm
    By Toasted Onions in forum Webmastering and Programming
    Replies: 1
    Last Post: September 18th, 2003, 03:47 AM
  4. Memory problem after format & partion problem
    By soulja in forum Technical Support
    Replies: 3
    Last Post: June 2nd, 2003, 09:59 PM
  5. Replies: 2
    Last Post: November 15th, 2002, 05:03 PM

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Recommended Sites: ResellerRatings Store Reviews