Answer to Question #261351 in Java | JSP | JSF for Lauren

Question #261351
  • Write pseudocode to plan the logic for an application for a furniture company. The program needs to determine the price of a table depending on the user’s input.
  • Prompt the user to choose 1 for pine, 2 for oak, or 3 for mahogany.
  • The output is the name of the wood chosen, as well as the price of the table made of that wood. Pine tables cost $120, oak tables cost $325, and mahogany tables cost $420.
  • If the user enters an invalid wood code, set the price to 0, and inform the user what the error is.
  • Include a prompt in the application to ask the user to specify a (1) large table or a (2) small table but only if the wood selection is valid. Add $50 to the price of any large table, and add nothing to the price for a small table. Display an appropriate message if the size value is invalid, and assume the price is for a small table.
  • Include an explanation of your reasoning for writing the pseudocode the way you did.
1
Expert's answer
2021-11-05T00:34:13-0400

Start

print("1 - Pine, 2 - Oak, 3 - Mahogany")

Integer choice = readValue()

Integer price

IF choice => 1 AND choice <=3 THEN

   IF choice == 1 THEN

   print("Pine table cost 120$")

   price = 120

   ELSE IF choice == 2 THEN

   print("Oak table cost 325$")

   price = 325

   ELSE

   print("Mahogany table cost 420$")

   price = 420

   END IF


   print("1 - Large Table, 2 - Small Table")

   choice = readValue()

   IF choice == 1 THEN

   price = price + 50

   ELSE IF choice != 2 THEN

   print("The size is invalid")

   END IF

ELSE

print("Invalid input")

price = 0

END IF

End

I did as indicated in the instruction.


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS