Help me figure out this pseudocode!!

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.


  • Doesn't sound very pseudocodable! Pseudocode is intended for describing algorithms, not really form-filling. Especially not html. But I guess you could write something like :

    name <- prompt('Your name : ')
    size <- prompt('Size (s/m/l) : ')
    type <- prompt('Type (v/c) : ')

    if (size equals 's') then
    if (type equals 'v') then cost <- 10
    else cost <- 7
    if (size equals 'm') then
    if (type equals 'v') then cost <- 12.25
    else cost <- 8
    if (size equals 'l') then
    if (type equals 'v') then cost <- 14.50
    else cost <- 9


    ok <- prompt('is this okay (y/n)?')
    if (ok equals 'y') validate(size, type)

    This is without handling invalid data. But again, it's not a very pseudocode like program.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion