subject
Engineering, 07.04.2020 18:49 tanashaw16

Design the below using an array

// Sunrise Freight charges standard
// per-pound shipping prices to the five states they serve
// –- IL IN OH MI WI
// -- 0.60 0.55 0.70 0.65 0.67
// Modify this program to reduce its size
// by using arrays
start
Declarations
string state
num pounds
string foundIt
string BAD_STATE_MSG = "Sorry, we do not ship to "
string FINISH = "XXX"

getReady()
while state <> FINISH
findPrice()
endwhile
finishUp()
stop

getReady()
output "Enter state or ", FINISH, " to quit"
input state
return

findPrice()
foundIt = "N"
if state = "IL" then
price = 0.60
foundIt = "Y"
else
if state = "IN" then
price = 0.55
foundIt = "Y"
else
if state = "MI" then
price = 0.70
foundIt = "Y"
else
if state = "OH" then
price = 0.65
foundIt = "Y"
else
if state = "WI" then
price = 0.67
foundIt = "Y"
endif
endif
endif
endif
if foundIt = "N" then
output BAD_STATE_MSG, state
else
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"
input state
return

finishUp()
output "End of job"
return

ansver
Answers: 1

Other questions on the subject: Engineering

image
Engineering, 04.07.2019 18:10, ijohnh14
Shafts are machine elements that are used to a) carry axial loads b) direct shear loads c) transmit power d) rotate at constant speed e) none of the above circular and square shafts subjected to the same torque under the same circum behave a) the same way b) almost the same way
Answers: 2
image
Engineering, 04.07.2019 18:10, tobyhollingsworth178
Which from the following instrument is commonly used to detect the high pitch butzing sound in bearings? [clo4] a)-digital ultrasonic meter b)-infrared camera c)-spectroscopic d)-vibrometer
Answers: 2
image
Engineering, 04.07.2019 18:10, jesuslovesusall3
Courses that are developed by subject matter experts, internal or extemal to the college or university. these programs are marketed by the school (clo2) marks a)-vocational schools b)-vendor training c)-colleges & universities d)-continuing education programs
Answers: 2
image
Engineering, 04.07.2019 18:20, kodyclancy
Aquick transition of the operating speed of a shaft from its critical speed will whirl amplitude. (a) increase (b) limit (c) not affect (d) zero
Answers: 2
You know the right answer?
Design the below using an array

// Sunrise Freight charges standard
// per-pound s...

Questions in other subjects:

Konu
Mathematics, 06.05.2020 04:43
Konu
English, 06.05.2020 04:43