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
Which unknown factor affects prices in the financial markets?
telo118 [61]

Answer:

There are four major factors that cause both long-term trends and short-term fluctuations. These factors are government, international transactions, speculation and expectation and supply and demand.

Explanation:

5 0
3 years ago
The CIBER network provides a link between the human resource and technology needs of a company with the research capacities and
Elan Coil [88]

The CIBER network provides a link between the human resource and technology needs of a company with the research capacities and language training found at universities.

What is CIBER network?

The Omnibus Trade and Competitiveness Act of 1988 established the Centers for International Business Education and Research (CIBERs) to increase and promote the nation's capacity for international understanding and competitiveness.

The United States administers it. The CIBER network, established by the Department of Education under Title VI, Part B of the Higher Education Act of 1965, connects the manpower and technological needs of the US business community with the international education, language training, and research capacities of universities across the country.

The thirty-one Centers provide regional and national resources to businesspeople, students, and educators at all levels.

To know more about network, visit: brainly.com/question/1326000

#SPJ4

3 0
1 year ago
"when a dynamic web page is requested, the web server passes the request to"
nalin [4]
System operations of the website u are  asking to access
7 0
4 years ago
A flat panel detector’s detector element size determines what?
Nastasia [14]

Answer:

A flat panel detector’s detector element size determines Spatial resolution.

7 0
3 years ago
You're a teacher and you've created a form letter in word that you send to the parents of the students in your class at the begi
Daniel [21]

Answer:

The letter pulls parents' names and addresses, along with the children's names, from an Excel file you get from the main office. To make your form letter word with the updated Excel file, Create a new form letter in Word and use the mail merge feature to link it to the updated Excel file.

Explanation:

7 0
2 years ago
Other questions:
  • .In Linux what command sequence do we enter to stop a program?
    11·1 answer
  • Where can information on metalworking occupations be found?
    14·2 answers
  • Quinton is having trouble learning Spanish because he keeps reverting back to the grammatical structures of his native English l
    6·1 answer
  • What is considered to be the core of the Unix operating system ?
    14·1 answer
  • Who is Mr.Anonymous?
    5·2 answers
  • Define- Emerging technology
    14·1 answer
  • Reesa works for a large real estate company. She is responsible for installing and supporting the company's internet systems, in
    5·1 answer
  • How to hack a I'd Indian brainly bot​
    7·1 answer
  • 2.Some artists look for ways to extend copyright for longer than the laws normally allow. Why do they do this?
    15·1 answer
  • A(n) Blank______ database model stores data in the form of logically related two-dimensional tables. Multiple choice question. w
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!