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
The filament of an incandescent lamp has a temperature of 2000k. calculate the fraction of radiation emitted in the visible light band if the filament is approximated as blackbody
Answers: 2
question
Engineering, 04.07.2019 18:20
Atank with constant volume contains 2.27 kg of a mixture of water phases (liquid-vapor). in the initial state the temperature and the quality are 127 °c and 0.6, respectively. the mixture is heated until the temperature of 160 oc is reached. illustrate the process in a t-v diagram. then, determine (1) the mass of the vapor in kg at the initial state, (2) the final pressure in kpa.
Answers: 3
question
Engineering, 04.07.2019 19:10
An external consultant recommends that a plant installs a bank of capacitors for power factor correction. this will reduce the peak electrical demand charges by an average of 93 kw every month. the plant current pays $13 per kw in peak demand charges. the capacitor bank will include 223 kw of fixed capacitors, and 183 of variable capacitors. the fixed capacitors cost $59 per kw, and the variable capacitors will cost $65 per kw. the consultant charges 21% of the equipment costs to install the capacitors. because this project will reduce the demand for the electric utility, they are prepared to provide a one-time rebate of $42 per kw of reduced demand. what is the simple payback period for this project (in years)?
Answers: 2
question
Engineering, 04.07.2019 19:10
A)-explain briefly the importance of standards in engineering design. b)- what is patent? c)-explain the relationship between these standards: b.s. and b.s.en d)- in engineering design concepts, types of loads and how they act are important factors. explain.
Answers: 3
You know the right answer?
Design the below using an array

// Sunrise Freight charges standard
// per-pound s...
Questions
question
Mathematics, 02.12.2020 17:40
question
Spanish, 02.12.2020 17:40
question
Mathematics, 02.12.2020 17:40
question
Mathematics, 02.12.2020 17:40