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
stiks02 [169]
3 years ago
9

Write a program called DeliveryCharges for the package delivery service in Exercise 4. The program should again use an array tha

t holds the 10 zip codes of areas to which the company makes deliveries. Create a parallel array containing 10 delivery charges that differ for each zip code. Prompt a user to enter a zip code, and then display either a message indicating the price of delivery to that zip code or a message indicating that the company does not deliver to the requested zip code.
Computers and Technology
1 answer:
lukranit [14]3 years ago
6 0

Answer:

zip_codes = ["11111", "22222", "33333", "44444", "55555", "66666", "77777", "88888", "99999", "00000"]

charges = [3.2, 4, 1.95, 5.7, 4.3, 2.5, 3.8, 5.1, 6.6, 7.3]

deliver = False

index = -1

zip_code = input("Enter the zip code: ")

for i in range(len(zip_codes)):

   if zip_code == zip_codes[i]:

       deliver = True

       index = i

       break

if deliver:

       print("The charge of delivery to " + zip_codes[index] + " is $" + str(charges[index]))

else:

   print("There is no delivery to " + zip_code)

Explanation:

*The code is in Python.

Initialize the zip_codes array with 10 zip codes

Initialize the charges array with 10 corresponding values

Initialize the deliver as False, this will be used to check if the zip code is in the zip_codes

Initialize the index, this will be used if the zip code is a valid one, we will store its index

Ask the user to enter the zip_code

Create a for loop that iterates the length of the zip_codes array. Inside the loop:

Check if the zip_code is equal to the any of the items in the zip_codes. If it is, set the deliver as True, set the index as i, and break

When the loop is done, check the deliver. If it is True, then print the charge of the delivery. Otherwise, print that there is no delivery to that zip code

You might be interested in
Which of the following is the BEST reason to use cash for making purchases? everfi
alexgriva [62]

Answer: knowing what you spend".

Explanation:

The reason to use cash for making purchases is to know how much one has spent.

When we use cash rather than using credit card, it's easier for one to know how much that has been spent. Also, one can easily know when he or she need to stop spending. Therefore, the correct answer is "knowing what you spend".

8 0
3 years ago
A coworker is concerned about the veracity of a claim because the sender of an email denies sending it. The coworker wants a way
Aleks04 [339]

<u>Some recommend way to prove the authenticity of an email:</u>

  • The coworker as truthful to the company or organization he or she has to check where the same mail is sent long back to the same sender.
  • If search on emails sent item if he sends it will be well and good. Some time backup the mail will be help to proven authenticity of an email.
  • Sometimes once mail is downloaded into ms-outlook or lotus domino some time mail persists in the mail server.
  • He or she can coordinate with the mail server administrator to possible get a log file of sending mail and he can proceed as a record to management.
5 0
3 years ago
Please help on both of these questions will give brainliest<br> !!
Alja [10]

I think the first one is All of the above

3 0
2 years ago
Read 2 more answers
The range of an area where users can access the Internet via high-frequency radio signals transmitting an Internet signal from a
Rama09 [41]

Answer:

A hot spot

Explanation:

Q:

The range of an area where users can access the Internet via high frequency radio signals transmitting an Internet signal from a wireless router is known as a _____. A) HotspotB) PAN…

A:

A) hotspot Bluetooth is for short distance and pan is Personal area networks (PANs) connect an individual's personal devices

4 0
1 year ago
Debevec mentions using the technology he described to animate entire human bodies. Discuss why you think this is or is not a goo
snow_tiger [21]

Answer:

Debevec is using the light of his team because this and that and because it’s manipulated

Explanation:

8 0
2 years ago
Other questions:
  • you are a software engineering consultant and have been called in by the vice president of finance of a corporation that manufac
    10·1 answer
  • Marisol manages the online advertising campaigns for a chain of toy stores with both a physical and an online presence. Which Go
    7·1 answer
  • 10.Find the first ICMP Echo Request message that was sent by your computer after you changed the Packet Size in pingplotter to b
    8·1 answer
  • In mathematics, the factorial of a positive integer n, denoted as n! , is the product of all positive integers less than or equa
    10·2 answers
  • PowerPoint provides a wide variety of predefined shapes that can add visual insert to a slide true or false
    10·2 answers
  • Danielle, a help desk technician, receives a call from a client. In a panic, he explains that he was using the Internet to resea
    9·1 answer
  • Practice problems on functions. Write C function(s) to carry out the specified tasks. For each problem, also write the suggested
    15·1 answer
  • Grace is the editor of her school newspaper. Which feature of a word processing program would she use to make her changes visibl
    7·2 answers
  • Who found the first computer bug in 1947, and invented the concept of a compiler in 1952
    6·1 answer
  • Why does a crane need to rotate/swivel​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!