Question: Do not remove the questions or text from the Template. Mark any additions to the pseudocode by adding lines and showing them in red. Strikeout

Do not remove the questions or text from the Template. Mark any additions to the pseudocode by adding lines and showing them in red. Strikeout any deletions using the strikeout tool. Assume that the pseudocode below for each question is a separate working program in your organization and that it needs modifications as described in the comments (lines that begin with two slashes) at the beginning of the code. Your job is to alter the pseudocode to meet the new specifications as noted above. Please follow directions as specified in the homework assignment instructions file. NOTE: If a function has no changes to be made to it, then it will be in blue font.
// 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
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!