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

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Apump is used to circulate hot water in a home heating system. water enters the well-insulated pump operating at steady state at a rate of 0.42 gal/min. the inlet pressure and temperature are 14.7 lbf/in.2, and 180°f, respectively; at the exit the pressure is 60 lbf/in.2 the pump requires 1/15 hp of power input. water can be modeled as an incompressible substance with constant density of 60.58 lb/ft3 and constant specific heat of 1 btu/lb or. neglecting kinetic and potential energy effects, determine the temperature change, in °r, as the water flows through the pump.
Answers: 1
question
Engineering, 04.07.2019 18:10
An air conditioning system consist of a 5 cm diameter pipe, operating at a pressure of 200 kpa. the air initially enters the pipe at 15°c with a velocity of 20 m/s and relative humidity of 80%. if the heat supply throughout the process is 960 w, determine the relative humidity and the temperature at the outlet
Answers: 3
question
Engineering, 04.07.2019 18:10
The higher the astm grain-size number, the coarser the grain is. a)-true b)-false
Answers: 3
question
Engineering, 04.07.2019 18:10
An ideal otto cycle with air as the working fluid has a compression ratio of 8. the minimum and maximum temperatures in the cycle are 300 k and 1340 k. use constant specific heats at room temperature to determine (a) the amount of heat transferred to the air during the heat- addition kj/kg, (b) the thermal efficiency, and (c) the thermal efficiency of a carnot cycle ope limits. process, in rating between the same temperature
Answers: 2
You know the right answer?
Design the below using an array

// Sunrise Freight charges standard
// per-pound s...
Questions
question
Mathematics, 05.01.2022 03:20
question
Mathematics, 05.01.2022 03:20
question
Social Studies, 05.01.2022 03:20
question
Social Studies, 05.01.2022 03:20
Questions on the website: 13722362