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
Match the following.
bija089 [108]

Answer:

#4 is quick access tool bar #7 is zoom bar #2ribbon #5 scroll bars #6 title bar #1contextual bars #3 ruler

6 0
3 years ago
Read 2 more answers
Problem 1 (Authentication): Consider the following authentication protocol, which uses a classical cryptosystem. Alice generates
Elis [28]

Answer:

Check the explanation

Explanation:

Yes, going by the question above, the protocol validates Bob to Alice for the reason that the key is only shared between Bob and Alice as well as the number which is being sent randomly. Therefore the invader won’t be able to predict and response to that number. Because of the authentication protocol, that makes use of a classical cryptosystem thereby resulting into the possibility of an argument such that key finding is attainable via invader.

5 0
3 years ago
The coordinates for the section element need not be defined as long as its position is set to
scoray [572]
<h2><u>Answer:</u></h2>

relative.

<h2><u>Explanation:</u></h2>

The coordinates for the section element need not be defined as long as its position is set to relative.

If the position is set as relative, then it will have no effect on the positioning attributes, it will consider as static position. If positioning is mentioned explicitly like top: 20px; then it will position 10 pixels down from where it is located. An ability for positional shifts is extremely helpful.

Two things happen when an element is set as relative, one is it introduces the ability to use z-index on that element, second is it limits the scope of absolutely positioned child elements.  

5 0
2 years ago
Explain how Steve Jobs created and introduced the iPhone and iPad.
Natali5045456 [20]

Answer:Today, we're introducing three revolutionary products. The first one is a widescreen iPod with touch controls. The second is a revolutionary mobile phone. And the third is a breakthrough Internet communications device. So, three things: a widescreen iPod with touch controls, a revolutionary mobile phone, and a breakthrough Internet communications device. An iPod, a phone, and an Internet communicator. An iPod, a phone...are you getting it? These are not three separate devices. This is one device. And we are calling it iPhone. Today, Apple is going to reinvent the phone.

Late last year, former Apple engineer Andy Grignon, who was in charge of the radios on the original iPhone, gave behind-the-scenes look at how Apple patched together demos for the introduction, with Steve Jobs showing off developmental devices full of buggy software and hardware issues. The iPhone team knew that everything had to go just right for the live iPhone demos to succeed, and they did, turning the smartphone industry on its head even as Apple continue to scramble to finish work on the iPhone.

Apple had actually been interested first in developing a tablet known as "Safari Pad", but as noted by a number of sources including Steve Jobs himself, the company shifted gears once it became clear how revolutionary the multi-touch interface developed for the tablet could be for a smartphone. Apple's tablet wouldn't surface until the launch of the iPad in 2010, three years after the introduction of the iPhone.

Seven years after the famous Macworld 2007 keynote, the iPhone has seen significant enhancements in every area, but the original iPhone remains recognizable as Apple has maintained the overall look of a sleek design with a larger touchscreen and a single round home button on the face of the device.

Explanation:

8 0
3 years ago
Computers process information consistently for all transactions. This creates a risk that:______
Anna007 [38]

Answer:

b. erroneous processing can result in the accumulation of a great number of misstatements in a short period of time.

Explanation:

Because of the consistent nature of processing in computers, this is capable of creating certain kinds of risk. From the option, one of the probable risk that can result from consistent information processing for multiple transactions at the same time is erroneous processing. This can therefore lead to a pile of misstatements in only a short period of time.

6 0
3 years ago
Other questions:
  • Need Help !!! Please
    8·1 answer
  • What is one problem you should keep in mind when researching information on the Internet?
    6·2 answers
  • CNG and gasoline-powered vehicles use the same internal combustion engine, but different fuel types. A) True B) False
    8·2 answers
  • Does anybody know if that apple watch is actually worth what it costs?
    9·2 answers
  • 2) Search the Web for two or more sites that discuss the ongoing responsibilities of the security manager. What other components
    15·1 answer
  • Write a program that receives an character and displays its Unicode. Here is a sample run: Enter an character: E The Unicode for
    8·1 answer
  • What is the first priority when building or using vex robots
    10·2 answers
  • Is there any difference beetween the old version of spyro released on the origional and the newer ones??? or is it only change i
    8·1 answer
  • A student is browsing a website. While browsing, he click on a link that takes him to another website. Which code gives the corr
    14·1 answer
  • Explain why computer professionals are engaged in technical services
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!