Engineering
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

answer
Answers: 1

Other questions on the subject: Engineering

image
Engineering, 03.07.2019 14:10, aliceohern
The y form of iron is known as: a) ferrite b) cementite c) perlite d) austenite
Answers: 3
image
Engineering, 04.07.2019 19:10, gabrielaperezcz
Air inially occupying a volume of 1 m2 at 100 kpa, 27 c undergoes three internally reversible processes in series. process 1-2 compression to 500 kpa during which pv constant process 2-3 adiabatic expanslon to 100 kpa process 3-1: constant-pressure expansion to 100 kpa (a) calculate the change of entropy for each of the three processes. (b) calculate the heat and work involved in each process. (c) is this cycle a power cycle or refrigeration cycle?
Answers: 3
image
Engineering, 06.07.2019 04:20, Okeh4001
An insulated tank truck containing 50,000 pounds of double-distilled, deionized water at 30 °c is pumped into a closed, refrigerated storage tank maintained at 5 °c in a facility located on top of mount mitchell, north carolina (elevation 6,684 feet & average july temperature of 84 °f). a)-determine the volume of the storage tank required to hold the purified water. b)- determine the initial and final pressure differences that must be overcome by a liquid pump assuming the storage tank initially contains air at 5 °c. assume the air is slowly bled out of the storage tank during the water transfer c.) during a routine operation today, the tank is slightly ruptured by a stainless steel pipe and a water acrosol of droplets begins to spray out of the storage tank. state all assumptions and determine the internal pressure within the water droplets produced
Answers: 1
image
Engineering, 06.07.2019 05:10, cedricevans41p4j3kx
It has been stated that the quality of the sheared edges can influence the formability of sheet metals. explain why
Answers: 3
Do you know the correct answer?
Design the below using an array

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

Questions in other subjects:

Konu
Mathematics, 11.03.2021 01:50
Konu
Physics, 11.03.2021 01:50