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
kipiarov [429]
3 years ago
8

Write a program named CheckZips that is used by a package delivery service to check delivery areas. The program contains an arra

y that holds the 10 zip codes of areas to which the company makes deliveries. Prompt a user to enter a zip code, and display a message indicating whether the zip code is in the company’s delivery area.
Engineering
1 answer:
LekaFEV [45]3 years ago
4 0

Answer:

# list of 10 zip codes assigned to zip

zips = ["12789", "54012", "54481", "54982", "60007", "60103", "60187", "60188", "71244", "90210"]

# user is prompt to enter zip code and assigned to user_zip

user_zip = input("Enter your zip code: ")

# if else statement to check if user input is available for delivery

# if statement check if user zip is in zip, if it is, it display

# delivery is okay to specified zip

if user_zip in zips:

   print("Delivery to {} ok.".format(user_zip))

# else it display no delivery to such zip code

else:

   print("Sorry - no delivery to {}.".format(user_zip))

Explanation:

The question doesn't specify programming language to use. Since no programming language was stated, the problem was solved using Python3. List structure is the equivalent of array in Python.

Assumption was also made on the array holding 10 zip codes of areas to which the company make deliveries.

The program first initialized a list of 10 zip codes and assigned it to zips. Then it prompt the user to enter a zip code which is assigned to user_zip.

Then if-else statement is used to check if user inputted zip is available with the zips variable.

If it is available, "Delivery ok" is displayed to the user else "no delivery" is displayed to the user.

You might be interested in
What should be your strongest tool be for gulding your ethical decisions making process
valkas [14]

Answer:

Recognize that there is a moral dilemma.

Determine the actor. ...

Gather the relevant facts. ...

Test for right versus wrong issues. ...

Test for right versus right paradigms. ...

Apply the resolution principles. ...

Investigate the trilemma options. ...

Make the decision.

7 0
3 years ago
Create two arrays with 5 elements each: one will hold Strings and the second will hold integers. Write a program to ask the user
MrMuchimi

Answer:

#include <iostream>

#include <iomanip>

#include <string>

using namespace std;

int main() {

   string name[5];  

   int age[5];  

   int i,j;  

   for ( i = 0; i<=4; i++ ) {  

       cout << "Please enter student's name:";  

       cin >> name[i];  

       cout << "Please enter student's age:";  

       cin >> age[i];          

   }  

for (i=0;i<=4;i++){

   cout<<"Age of  "<< name[i]<<"  is  "<<age[i]<<endl;  

}

}

Output of above program is displayed in figure attached.

5 0
3 years ago
In poor weather, you should _______ your following distance.
jasenka [17]

In poor weather, you should <u>double</u> your following distance.

6 0
3 years ago
Explain how use of EGR is effective in reducing NOx emissions 4. In most locations throughout the U.S., the octane number of reg
TiliK225 [7]

Answer:please see attached file

Explanation:

3 0
4 years ago
A person walks into a refrigerated warehouse with head uncovered. Model the head as a 25- cm diameter sphere at 35°C with a surf
galina1969 [7]

Answer:

Hello some parts of your question is missing below is the missing part

Convection coefficient = 11 w/m^2. °c

answer : 44.83 watts

Explanation:

Given data :

surface emissivity ( ε )= 0.95

head ( sphere) diameter( D )  = 0.25 m

Temperature of sphere( T )  = 35° C

Temperature of surrounding ( T∞ )  = 25°C

Temperature of surrounding surface ( Ts ) = 15°C

б  = ( 5.67 * 10^-8 )

Determine the total rate of heat loss

First we calculate the surface area of the sphere

As = \pi D^{2}  

= \pi * 0.25^2 =  0.2 m^2

next we calculate heat loss due to radiation

Qrad = ε * б * As( T^{4} - T^{4} _{s} )  ---- ( 1 )

where ;

ε = 0.95

б = ( 5.67 * 10^-8 )

As = 0.2 m^2

T = 35 + 273 = 308 k

Ts = 15 + 273 = 288 k

input values into equation 1

Qrad = 0.95 * ( 5.67 * 10^-8 ) * 0.2 ( (308)^4 - ( 288)^4 )

         = 22.83  watts

Qrad ( heat loss due to radiation ) = 22.83 watts

calculate the heat loss due to convection

Qconv = h* As ( ΔT )

           = 11*0.2 ( 35 -25 )  = 22 watts

Hence total rate of heat loss

=  22 + 22.83

= 44.83 watts

5 0
3 years ago
Other questions:
  • Consider a circular grill whose diameter is 0.3 m. The bottom of the grill is covered with hot coal bricks at 961 K, while the w
    10·1 answer
  • Pine Valley Furniture wants to use Internet systems to provide value to its customers and staff. There are many software technol
    5·1 answer
  • Which of the following describes what occurs when energy is lost in efficient transformation?
    14·1 answer
  • A satellite is launched 600 km from the surface of the earth, with an initial velocity of 8333.3 m./s, acting parallel to the ta
    14·1 answer
  • WHAT IS A TOROID IN HYDRAULUCS?
    11·2 answers
  • Which investigative process is most helpful for learning about past societies?
    10·1 answer
  • C programming fundamentals for everyone​
    13·1 answer
  • A pinion and gear pair is used to transmit a power of 5000 W. The teeth numbers of pinion
    8·1 answer
  • A machine raises 20kg of water through a height of 50m in 10secs. What is the power of the machine.​
    5·1 answer
  • True or false? if i were to hook up an ac voltage source to a resistor, the voltage drop across the resistor would be in phase w
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!