|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|||
|
Anyone know anything about pseudocode
just starting and having a problem figuring this out how would i write a program to have the price per unit in pseudocode i am just clueless on this.
|
|
|||
|
here is the problem
here is the first of 10 problems i am trying to figure out..
The manager of the Super Supermarket would like to be able to compute the unit price for products sold there. To do this, the program should input the name and price of an item and its weight in pounds and ounces. It should then determine and display the unit price (the price per ounce) of the item. |
|
|||
|
hmmm
so if i understand correctly.....
Prompt for item name , item price , item weight input item name, item, item price , item weight set unit price = price / weight display "price per unit" |
|
|||
|
// calculate price per unit
prompt for item name , item price , item weight by " lbs,oz" input item name , item price , item weight " lbs,oz" divide weight in lbs x 16oz = total units divide price x total units = price per unit display item name , price per unit thats whats i got so far i am looking at a few examples .... just wondering no were the term declare comes into this or if i am missing something . |
|
||||
|
Quote:
Prize per ounce = item price divided by ((item weight lbs X 16) + Item weight ozs) Display item name, price per ounce If you are following some reference for the pseudo code then it should be in that style, but strictly speaking anything that defines the steps and calculations correctly would be correct pseudo code. |
|
|||
|
so from what i gather this is just s simple set of instructions to guide you through the development of the program.. is that about right...? But if its so flexible and there is no real set of commans to follow then wouldn't writing be more a waste of time wouldn't it be easier just to make a quick diagram or flow chart?
|
|
|||
|
ya it is one of 10 don't want the answer just wanted to know what the text didn't explain..
|