Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 31st International Conference Dexa 2020 Bratislava Slovakia September 14 17 2020 Proceedings Part 1 Lncs 12391

Authors: Sven Hartmann ,Josef Kung ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

303059002X, 978-3030590024

More Books

Students also viewed these Databases questions