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
Is mmorpg an example of virtual community
Inga [223]
Yes I would say it is.
4 0
3 years ago
Read 2 more answers
Rony works on several confidential files for his company. Ignoring the privacy requirements, Rony places the files in a shared f
kumpel [21]

Answer:

D. ​He should designate all the files in the shared folder as read-only.

Explanation:

The steps Rony should take while using a peer-to-peer (P2P) network to prevent his original files from being overwritten by another P2P user is that He will make the file as read-only.

In making the file read-only, other users who have access to the shared folder can only read the file without modifying it's content.

By default, he is already the owner of the file, so option B is not the correct answer.

Also making the file executable give other users higher privilege, so option A is also not correct.

8 0
3 years ago
CONCEPTO DE ORGANIGRAMA
inysia [295]
Como the amas si mucho gusto
3 0
3 years ago
¿Cuales son los dos estados de una computadora y que significa cada uno?
hjlf

Answer:

En ciencias de la computación, el estado de un circuito lógico digital o programa de computadora es un término técnico para toda la información almacenada a la que un circuito o programa tiene acceso en un momento dado. La información recibida previamente en las entradas se almacena en la memoria de elementos electrónicos, como disparadores, celdas de memoria. El contenido almacenado de estos elementos de memoria, en un momento dado, denominado colectivamente el "estado" del circuito, contiene toda la información sobre el pasado al que tiene acceso el dispositivo. Así, básicamente, una computadora puede tener acceso a dicho estado o no, según se encuentre encendida o apagada.  

4 0
3 years ago
You have a large company, and it is important to your business that your employees' work is backed up regularly. Which network w
valkas [14]
Client server network as it has a powerful server which provides all the networks required on the network. Files are usually backed up regularly.

3 0
3 years ago
Other questions:
  • A word or line of a paragraph at the top of a page hanging indent is called ______
    8·1 answer
  • Is it better to meet online or offline<br> (Please answer QUICK)<br><br> Thanks :')
    5·2 answers
  • What is a set of javascript statements that result in an action?
    15·1 answer
  • How do emotions affect purchasing decisions?
    6·1 answer
  • "________ are used to edit videos to enhance quality and appearance."
    6·1 answer
  • In this assignment, you will design and create an ArrayList-based application that manages a collection of DVDs. Information abo
    15·1 answer
  • This is for being Weird!
    15·2 answers
  • Pls help me<br> first one to answer correctly gets brainly points
    6·2 answers
  • Explain why regular system cleanup is vital to ensuring the operating system runs efficiently. ?
    15·1 answer
  • A natural language processor comes across a sentence that contains the word “weightless.” The morphology component identifies th
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!