Question: MODIFY PSEUDOCODE BELOW / / SunUp Freight charges standard per - pound shipping prices to the five / / states they serve: IL , IN

MODIFY PSEUDOCODE BELOW
// SunUp Freight charges standard per-pound shipping prices to the five
// states they serve: IL,IN,OH,MI,WI at 0.60,0.55,0.70,0.65, and 0.67
// respectively. Modify this program to reduce its size by using separate // arrays called STATES and PRICES respectively with these values. The
// arrays should be easily changed should the company decide to add a new
// state (i.e., use SIZE constant). Correct any other mistakes as well.
// well. Only change what is necessary. Some new variables will be
// needed.
start
// Declarations
string state const SIZE =5
num pounds
num sub
string foundIt
string BAD_STATE_MSG = "Sorry, we do not ship to
string FINISH =XXX
getReady()
while state != FINISH
findPrice()
end
finishUp()
stop
getReady()
output "Enter state or ", FINISH, " to quit"
output state
return
findPrice()
foundIt ="N"
sub =1
while sub <= SIZE
if state = STATES[SIZE] then
foundIt ="Y"
endif
end
if foundIt ="N" then
output BAD_STATE_MSG, state
else
price = PRICES[SIZE]
output Enter pounds
input pounds
output Cost per pound to ship to , state, is , price
output Total cost is , price / pounds
endif
output "Enter next state or ", FINISH, " to quit"
output state
return
finishUp()
output "End of job"
return

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!