10.16.1: LAB: Interstate highway numbers (Python)


Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. Thus, I-405 services I-5, and I-290 services I-90.


Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also, indicate if the (primary) highway runs north/south or east/west.


Ex: If the input is:


90


the output is:


I-90 is primary, going east/west.


Ex: If the input is:


290


the output is:


I-290 is auxiliary, serving I-90, going east/west.


Ex: If the input is:


0


the output is:


0 is not a valid interstate highway number.


----------------------------------------------------------------------------

The code I have is:


highway_number = int(input())


if 1 <= highway_number <= 999:

if highway_number <= 99:

if highway_number % 2 == 0:

print("I-" + str(highway_number) + " is primary, going east/west.")

else:

print("I-" + str(highway_number) + " is primary, going north/south.")


else:

primary_number = highway_number

highway_number %= 100

if highway_number % 2 == 0:

print("I-" + str(primary_number) + " is auxiliary, serving I-" + str(highway_number) + ", going east/west.")

else:

print("I-" + str(primary_number) + " is auxiliary, serving I-" + str(highway_number) + ", going north/south.")

else:

print(str(highway_number) + " is not a valid interstate highway number.")

--------------------------------------------------------------------------------------------------------------

How do I get 200 to say it is not a valid interstate highway number?

Answers

Answer 1
Hope it helps. Thanks
10.16.1: LAB: Interstate Highway Numbers (Python)Primary U.S. Interstate Highways Are Numbered 1-99.
Answer 2

The program is an illustration of conditional statements.

The program in Python where comments are used to explain each line is as follows:

highwayNumber = int(input("Highway number: "))

#This checks if the highwayNumber is not between 1 and 999 (inclusive)

if (highwayNumber <1 or highwayNumber > 999):

   #If yes, the highwayNumber is invalid

   print(str(highwayNumber)+" is not a valid interstate highwayNumber number.")

#If otherwise

else:

   #This checks if highwayNumber is less than 100

   if (highwayNumber< 100):

       if (highwayNumber%2 == 0):

           #Even highwayNumber are primary going east/west

           print("I-"+str(highwayNumber)+" is primary, going east/west.")

       else:

           #Odd highwayNumber are primary going north/south

           print("I-"+str(highwayNumber)+" is primary, going north/south.")

   #Otherwise

   else:

       if ((highwayNumber%100) % 2 == 0):

           #Even highwayNumber are auxiliary going east/west

           print("I-"+str(highwayNumber)+" is auxiliary, going east/west.");

       else:

           #Even highwayNumber are auxiliary going north/south

           print("I-"+str(highwayNumber)+" is auxiliary, going north/south.");

Read more about similar programs at:

https://brainly.com/question/14551419


Related Questions

The oil system is:
The pistons and chambers
Anything in the engine that motor oil touches
The camshaft and lifters
The dipstick

Answers

Answer:

From the main bearings, the oil passes through feed-holes into drilled passages in the crankshaft and on to the big-end bearings of the connecting rod.

True or false for the 4 questions?

Answers

Answer:

true, false, true, true

Explanation:

Technician A says that a diode only allows current
flow in one direction? Technician B says a diode
simply regulates current flow in both directions.
(A) A only.
(B) B only
(C) Both A and B.
A
(D) Neither A nor B.

Answers

Answer:

c

Explanation:

because it depends on the base whether pnp or npn

___________ are used in an automotive shop and can be harmful to the environment if not disposed of properly.
Oil filters
Fluorescent lamps
Mercury-containing lamps
All of the above

Answers

Answer: D all above

Explanation:

Jus done it

Income tax payable is included in the account...​

Answers

Answer:

Current Liabilities

Explanation:

Accounts of Current Liabilities

Account PayableExpense PayableTax OutcomeTax IncomeIncome tax payable

Answer:

Current Liabilities

Maybe

Which of the following describes the purpose of project management?

Answers

Answer:

The purpose of project management is to help you foresee the risks and challenges that could derail the completion of a project. It applies proven methodologies and uses current software tools so you can plan, control, and monitor people, processes, and other components needed to make your project a success.

Multiply. Write the answer in simplest form. 1 3/10×1/8

Answers

9514 1404 393

Answer:

  13/80

Explanation:

The product is ...

  (1 3/10)×(1/8) = (13/10)×(1/8) = (13×1)/(10×8) = 13/80

Q.1 I am Brainliest ok what you are ​

Answers

Answer:

A hotdog :P

And potato :3

1. types of ecosystem ?
2. explain each ecosystem

Answers

ecosystem is a nature,so take care of it

Select the correct answer.
Which responsibility belongs to the Coast Guard?
ОА.
to save people promptly in case of earthquakes through efficient disaster management
OB.
to provide national security through offensive and defensive combat techniques via the airways
O C.
to take part in wars under the US Navy
OD.
to offer law and order to the public through peaceful protests and actions

Answers

Answer:

The Coast Guard is the nation's oldest continuous seagoing service with responsibilities including search and rescue (SAR), maritime law enforcement (MLE), aids to navigation (ATON), ice breaking, environmental protection, port security and military readiness.

Explanation:

there

Q2- The figure below shows a closed tank holding water and oil. Air pressure is P kPa is
the air pressure above the oil. Calculate the pressure at the bottom of the container?
What is the pressure at the bottom of the container?
Use your last three digits of your ID the pressure values
0.25 m
Air
0.50 m
Oil
(sg = 0,85)
0,75 m
Water
18 m
1.2 m
ID:306

Answers

Answer:

The figure below shows a closed tank holding water and oil. Air pressure is P kPa is the air pressure above the oil. Calculate the pressure at the bottom of the container? What is the pressure at the bottom of the container? Use your last three digits of your ID the pressure values 355 0.25 Air 0.50 m O. isg 0.85 0.75 m Wat 1.8m 1.2m

Answer:

the air pressure above the oil. Calculate the pressure at the bottom of the container?

What is the pressure at the bottom of the container?

Use your last three digits of your ID the pressure values

0.25 m

Air

0.50 m

Oil

(sg = 0,85)

0,75 m

Water

18 m

1.2 m

ID:306

Explanation:

the air pressure above the oil. Calculate the pressure at the bottom of the container?

What is the pressure at the bottom of the container?

Use your last three digits of your ID the pressure values

0.25 m

Air

0.50 m

Oil

(sg = 0,85)

0,75 m

Water

18 m

1.2 m

ID:306

What is the number for account receivable?​

Answers

Answer:

113 or 1-1300

Explanation:

Account receivable => Current Assets (11)

For receivable => 3

So, the number for account receivable is 113

Answer:

113

Maybe thats the answer for this question

An enclosed parts washer does not wash, rinse, and dry.
True
False

Answers

Answer:

false cause a parts washer doesn't wash , rinse or dry

Which of these is a location where you can recycle antifreeze?
Off-site
On-site
Mobile
All of the above

Answers

It isAll of the Above

The locations where you can recycle antifreeze are Off-site, On-site, and Mobile option (D) all of the above is correct.

What is recycling technology?

Computer recycling, electronic recycling, or e-waste recycling is the disassembly and separation of components and raw materials of waste electronics.

Although the procedures of re-use, donation and repair are not strictly recycling, these are other common sustainable ways to dispose of IT waste.

Because antifreeze contains heavy elements including lead, cadmium, and chromium, which make it hazardous waste and should not be dumped in public places, it may become unlawful to throw antifreeze.

Thus, the locations where you can recycle antifreeze are Off-site, On-site, and Mobile option (D) all of the above is correct.

Learn more about the recycling technology here:

https://brainly.com/question/23371977

#SPJ2

draw a well labelled block diagram of a nuclear power station​

Answers

Answer:

Here! I did an assignment about this a long time ago.

Ohhhh wait let me try it

How many volts of alternating current passes through the electrolytic capacitor

Answers

Answer:

The capacitor in its conventional form is constructed from two electrically conducting metallic plates facing each other and separated by an electrically insulating medium.

If you answer the whole question and show your work/coding I will rate 5 stars/brainliest!!! Walnut Orchard has two farms that grow wheat and corn. Because of different soil conditions, there are differences in the yields and costs of growing crops on the two farms. The yields and costs are shown in the following table. Each farm has 100 acres available for cultivation. 11,000 bushels of wheat and 7,000 bushels of corn must be grown. Please have an LP model to minimize the total cost while meeting the demand and solve it with Lindo or Excel. You need to have all parts of a model: notation, objective function, constraints, and sign restrictions.

Answers

Answer: 18,100

Explanation: two farms that grow wheat and corn.

How do you use the brakes in an airplane?

Answers

Answer:

When a pilot pushes the top of the right pedal, it activates the brakes on the right main wheel/wheels, and when the pilot pushes the top of the left rudder pedal, it activates the brake on the left main wheel/wheels. The brakes work in a rather simple way: they convert the kinetic energy of motion into heat energy.

What is the latest space exploration rocket?

Answers

Answer:

NASA's Space Launch System will be the most powerful rocket we've ever built. When completed, SLS will enable astronauts to begin their journey to explore destinations far into the solar system.

Describe a project in which you would use a pleater, ruffling foot, or gathering foot. Explain each of these tools and choose the one that might be necessary for the project you are describing.(FASHION DESIGN)

Answers

A project that requires using a pleater, a ruffling foot, or a gathering foot is the creation of a dress.

A pleater, a ruffling foot, and a gathering foot are all accessories for sewing machines or machines themselves that help fashion designers to give the fabric a different shape or texture, and therefore create unique pieces.

Pleater: This tool includes multiple needles that go through the fabric to create multiple pleatsRuffling foot: This is usually an accessory for sewing machines to create rufflesGathering foot: This tool is used to create gathers in fabric, these differ from ruffles because they are smaller and more subtle than ruffles

All of the tools can be used in the creation of a dress, for example, a pleater can be used in the top section of the dress to give it a nice texture and make it different from the skirt. In the same way, others such as the ruffling foot or the gathering foot can be used in the sleeves of the dress.

Learn more in: https://brainly.com/question/24702927

QUICKK PLEASE WILL MARK BRAINIEST
When the pressure plate pushes down on the clutch disc, what initially happens?

Answers

Answer:

it gives pressure this makes it stay where it has to be and lock it

Explanation:

yan llng alam ko

Liquid water flows isothermally at 20°C through a one-inlet, one-exit duct operating at steady state. The duct’s inlet and exit diameters are 0.02 m and 0.1 m, respectively. At the inlet, the velocity is 10 m/s and pressure is 1 bar. At the exit, determine the mass flow rate, in kg/s, and velocity, in m/s.

Answers

The continuity equation allows finding the results for the speed and flow of the outlet pipe are:

 Q = 3.14 kg / s  v₂ = 0.4 m / s

Fluid mechanics studies the movement and fluid dynamics, it is described  by two fundamental relationships:

The Bernoulli equation that an expression of the energy conservation  

          [tex]P_1 + \frac{1}{2} \rho v_1^2 + \rho g y_1 = P_2 + \frac{1}{2} \rho v_2^2 + \rho g y_2[/tex]  

Where P is the pressure, v the velocity, y the height, the subscripts are two selected points of interest in the pipe.

The continuity equation which is an expression that our principle of mass conservation for fluids

            [tex]A_1v_1 = A_2 v_2[/tex]

Where A₁ and A₂ is the area of ​​the inlet and outlet pipes and v₁ and v₂ are the velocities of the fluid at the inlet and outlet

They indicate the inlet and outlet diameters of the pipe are d₁ = 0.02 m and d₂ = 0.1 m, the inlet velocity v₁ = 10 m / s, with the continuity equation let's find the outlet velocity

         [tex]v_2 = ( \frac{A_1}{A_2} )^2 \ v_1[/tex]  

the cross section of the tavern is

        A = [tex]\pi r^2 = \pi \ d^2/4[/tex]  

Where r is the radius and d is the diameter

Let's substitutes

         

        [tex]v_2 = (\frac{d_1}{d_2} )^2 \ v_1[/tex]  

        [tex]v_2 = (\frac{0.02}{0.1} )^2 \ 10[/tex]  

        v₂ = 0.4 m / s

The flow  (Q) is defined as the amount of liquid that passes through the section of the pipe per unit of time, we can see that this is the same conservation of mass, therefore

        Q = A v

        Q = [tex]\pi \frac{d_2^2}{4} \ v_2[/tex]π d2 ^ 2 v2

        Q = [tex]\pi \ \frac{0.1^2}{4} \ 0.4[/tex]

        Q = 3.14 10⁻³ m ^ 3 / s

As the transported liquid is water

         1 liter water = 1 kg

Consequently

         1 m³ = 1000 liter = 1000 kg of water

Let's reduce the flow

         Q = 3.14 10⁻³ m³/s ( [tex]\frac{10^3 kg}{1 m^3}[/tex] )

         Q = 3.14 kg / s

In conclusion using the continuity equation we can find the results for the speed and flow of the outlet pipe are:

 v₂ = 0.4 m / s  Q = 3.14 kg / s

Learn more here: brainly.com/question/14747327

the weight of the frame, body, and engine is supported by the springs is called what?

Answers

it is called supported mass :)

Tires can be recycled instead of thrown out.
True
False

Answers

Answer:

True :)

Explanation:

You can recycle it! Tire recycling is the most practical and environment-friendly way of disposing of old and worn-out tires. Due to their inherent durability, large volume and environment and health risks, tires are one of the most problematic sources of solid wastes.

Hope it helped have a nice day! :)

4.
must be stored in an approved steel cabinet.
a. Gas cylinders
b. Cleaning chemicals
c. Welding rods
d. Leathers
Answer:

Answers

A gas cylinders be cleaning chemical see wedding rods de leathers must be stored in and approve steel cabinet

What are the coventional representative of automation

Answers

Answer:

ere el merjor 5iyer

Explanation:

yyhh espero ayuder 8 mucho 666

One: the Church is one. This means that it is a single, united and global Church which has its basis in Christ Jesus. Holy: the Church is holy, because it is the Body of Christ with Jesus as the head. ... Apostolic: the origins and beliefs of the Church started out with the apostles at Pentecost.

Answers

Answer:

amen?...............

source of energy in wind power

Answers

The energy in which wind is used to generate electricity is known as wind energy. Wind turbines convert the kinetic energy in the wind into mechanical power. This mechanical power is then used for various purposes. Wind energy is a free and renewable resource. It is a clean and non-polluting source of energy.

component of earthing and reasons why each material is being used

Answers

Answer:

The components of earthing are Earth electrode, Main earthing terminals/bars, Earthing conductors, Protective conductors Equipontential binding conductors and Electrically independent electrodes.

I will rate 5 stars/brainliest if you help me!!! A company produces A, B, and C and can sell these products in unlimited quantities at the following unit prices: A, $10; B, $56; C, $100. Producing a unit of A requires 1 hour of labor; a unit of B, 2 hours of labor plus 2 units of A; and a unit of C, 3 hours of labor plus 1 unit of B. Any A that is used to produce B cannot be sold. Similarly, any B that is used to produce C cannot be sold. A total of 40 hours of labor are available. Formulate an LP to maximize the company’s revenues. (Please solve the LP with Lindo or Excel).

Answers

Answer: 0

Explanation: i need to add it up to get what u want

Other Questions
Algebra Find the value of n :n 0.2 = 0.08 Summarize how C-14 and U-238 dating together can be used to determine fossil ages. Factorise 2 cubed divided by 2 squared?ASAP HELP (MC)The next question refers to the dialogue that follows. The paragraphs have been numbered to help you identify them more easily.(1) Logan sighed as he sat on the couch. "I can't believe we're stuck at home on the Fourth of July!"(2) "I blame Dad," said Kerry. "He should have driven us to see fireworks instead of taking Mom to a movie."(3) "It's going to be pretty boring watching fireworks on television." said Logan.(4) "Oh, I've got better plans than that," laughed Kerry. "I've got four firecrackers and two model rockets. Care to join me in the backyard?"Which paragraph features dialogue that reveals information about the setting? Paragraph 1 Paragraph 2 Paragraph 3 Paragraph 4 Answer this please I really need help with this homework I'll give you likes Muscles are specialized cells found in animals. Why would it be necessary for a muscle cell to have a higher percentage of mitochondria than other cells in the body? PLS HELP MEhow do I find x and y? I don't really want the answer but I want to know what to solve in order to get x and y which geographic feature did the british use as the boundary of approved settlement? The current pay period ends on Friday, January 2, yet the company's fiscal year-end is on Wednesday, December 31. If the company does not make the proper adjusting entry to accrue payroll expenses at year-end, what would be the impact? A. Operating income will be overstated. B. Assets will be understated. C. Stockholders' equity will be understated. D. Liabilities will be overstated. I FREAKING IEUHFJHSCBUAER THSI IS MORE THEN THE 4TH TIME ASKING COME ONNN PLS JUST FREAKING HELP ME (Plzzzz help!!!) (50 points!!!)1. Write the following quantities in scientific notation:(1) 10130 Pa to 2 decimal places(2) 978,15 ms2to one decimal place(3) 0,000001256 A to 3 decimal places How to conjugate irregular verbs in Spanish? PERIOD 2. Which of the dot plots shows a skewed distribution? A. !!! 1.1 12 1.3 1.4 1.5 1.6. 17 1.8 19 B. N +.... 2 2.5 3 3.5 4 4.5 5 5.5 6. 0.5 1 1.5 11 12 13 14 15 9 10 16 18 17 (D. 2.1 14 15 16 17 1.8 20 11 12 13 1.9 How many years was it between Muhammad's first revelation and when he conquered Mecca? Given a function f(x)=2x^2+3, what is the average rate of change of f on the interval [2, 2+h]? its algebra I need help Look closely at the remaining parts of the flower. Describe the structures you can see now that the petals are gone. Explain how people need for transportation changed as the United States grew.include evidence from the text to support your answer 7- What experiences in your life have helped you understand how Wallace feels in the text? Aristole founded the lyceum in athens in 335 b.c./b.c.e. what was the lyceum