1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Cerrena [4.2K]
3 years ago
6

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 arraysstartDeclarationsstring statenum poundsstring foundItstring BAD_STATE_MSG = "Sorry, we do not ship to "string FINISH = "XXX"getReady()while state <> FINISHfindPrice()endwhilefinishUp()stopgetReady()output "Enter state or ", FINISH, " to quit"input statereturnfindPrice()foundIt = "N"if state = "IL" thenprice = 0.60foundIt = "Y"elseif state = "IN" thenprice = 0.55foundIt = "Y"elseif state = "MI" thenprice = 0.70foundIt = "Y"elseif state = "OH" thenprice = 0.65foundIt = "Y"elseif state = "WI" thenprice = 0.67foundIt = "Y"endifendifendifendifif foundIt = "N" thenoutput BAD_STATE_MSG, stateelseoutput "Enter pounds "input poundsoutput "Cost per pound to ship to ", state, " is ", priceoutput "Total cost is ", price * poundsendifoutput "Enter next state or ", FINISH, " to quit"input statereturnfinishUp()output "End of job"return
Computers and Technology
1 answer:
Nataliya [291]3 years ago
3 0

Answer:

string state

num pounds

num SIZE = 5

string STATES[SIZE] = [“IL”, “IN”, “OH”, “MI”, “WI”]

num PRICES[SIZE] = [0.60, 0.55, 0.70, 0.65, 0.67]

num temp

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"

temp = 0

index = 0

while temp < SIZE

if state = STATES[temp] then

foundIt = "Y"

index = temp

temp = SIZE

endif

temp = temp + 1

endwhile

if foundIt = "N" then

output BAD_STATE_MSG, state

else

price = PRICES[index]

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

Explanation:

  • Initialize the required variables and arrays.
  • Inside the while loop, call the findPrice() method.
  • Run a while loop until temp is less than Size.
  • If state is found then set the value of foundIt variable to "Y" and assign the value of temp to index variable.
  • Finally call the finishUp method and return.

You might be interested in
Analyze the following code. Number[] numberArray = new Integer[2]; numberArray[0] = new Double(1.5); Question 9 options: A) Sinc
sleet_krkn [62]

Answer:

B) At runtime, new Integer[2] is assigned to numberArray. This makes each element of numberArray an Integer object. So you cannot assign a Double object to it.

Explanation:

The Number class in Java is the superclass for the numbers. Once it is set to the Integer object, the values in <u>numberArray</u> must be all integers, we know that arrays can hold one type of value in Java. Assigning a double value is not allowed in this situation.

7 0
2 years ago
When planning your App what difficulties did come across and why?
RSB [31]

Answer:

1. An engaging app idea

2. Sufficient funds

3. Cross-platform apps

4. Interactive apps

5. Application content management

ETC...

7 0
2 years ago
Read 2 more answers
Which of these is most closely associated with system control? (1 point) (Points : 1.5) boundary
Mademuasel [1]

Answer:C) Feedback

Explanation: System control is the controlling and managing activity of the system by commands ,regulations, management practices etc.It helps in the analyzation of the system and improving the ability of performing the tasks.Feedback is the component of the control system that is obtained as the output after the controlling  technique is applied in the system.

Other options are incorrect because environment is the surrounding of the system ,interface is the connection between the components of the system and boundary is not a technical term of control system.Thus, the correct option is option(C).

3 0
3 years ago
Technician A says that the reserve rating of a battery is the amount of steady current that a fully charged battery can supply f
Andre45 [30]

Answer:

Neither A nor B

Explanation:

<em>Reserve capacity</em> is the number of minutes that a new, fully charged battery can discharge continuously and maintain a terminal voltage equal to or greater than 1.75 volts per cell.

<em>An ampere-hour </em>is an electric charge unit and its abbreviation is Ah.

It measures the amount of electric charge flowing through a battery in the case that amount supplies a current of 1 amp for 1 hour.

5 0
2 years ago
¿por que la toria de lamarck sobre el alargamiento del cuello de las jirafas por el esfuerzo continuado no pasara a sus descendi
Paha777 [63]

Respuesta: Los caracteres adquiridos no se transmiten genéticamente porque no modifican el ADN de los organismos

Explicación:

Jean-Baptiste Lamarck al igual que Charles Darwin, propuso una teoría sobre la evolución que explicaba cambios en los organismos a través del tiempo. La teoría de Lamarck se enfocaba en condiciones en el ambiente que propiciaban cambios en los organismos. Un ejemplo de esto son las jirafas, que de acurdo a Lamarck tenían cuellos largos debido al esfuerzo continuado para comer hojas de árboles altos. Esto significa que la característica de cuello largo era adquirido por las jirafas durante su vida y según Lamarck se transmitiría a sus descendientes.

Sin embargo, se ha comprobado que los caracteres adquiridos no modifican el ADN de los organismos, por ejemplo las cirugías estéticas no cambian el ADN de una persona y por esta razón no son transmitidos a sus descendientes. Por el contrario, en las poblaciones de organismos ciertas características prevalencen en el tiempo debido a la selección natural. Esto significa que el cuello de las jirafas es el resultado que el cuello largo sea una característica beneficiosa que ha prevalecido debido a la selección natural y no de características adquiridas que son transmitidas a descendientes.

7 0
3 years ago
Other questions:
  • Which of the following economic systems leaves production decisions completely up to the producers?
    15·2 answers
  • If you filmed a clip in 120fps, how many frames are in a seconds of video.
    13·1 answer
  • The intellectual property right that gives a creator control of his or her written work is known as what?
    9·1 answer
  • I need help also this counts as my second giveaway and last for today
    12·2 answers
  • Cuzzzzzzzzzzzzzzzz iiiiiiiiiiiiiiiii remember everytimeeeeeeeeee on these days that i feel like you and meeeeeeeeeeeeeee
    15·1 answer
  • What is string literal in Java?
    5·1 answer
  • Identify the correct characteristics of Python tuples. Check all that apply.
    9·1 answer
  • What does advance mean​
    6·1 answer
  • Hello everyone! can anybody help me? i need help with computing.
    10·1 answer
  • Mechanisms that can be used to rescue accident victims
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!