I need help fixing a python code so that it can output the displayed image below
:
highway_number = int(input())
if (highway_number == 0) or (highway_number % 100 == 0) or (highway_number > 999):
print('{} is not a valid interstate highway number.'.format(highway_number))
if highway_number > 0 and highway_number < 100:
if (highway_number % 2) == 0:
print('I-{} is primary, going east/west.'.format(highway_number))
else:
print('I-{} is primary, going north/south.'.format(highway_number))
if highway_number > 99 and highway_number < 1000:
if highway_number % 100 == 0:
print()
else:
if (highway_number % 2) == 0:
if_aux = highway_number % 100
print('I-{} is auxiliary, serving I-{}, going east/west.'.format(highway_number, if_aux))
else:
if_aux = highway_number % 100
print('I-{} is auxiliary, serving I-{}, going north/south.'.format(highway_number, if_aux))
Step by stepSolved in 4 steps with 3 images
- Write a C++ program that will input temperatures for consecutive days. The program will store these values into an array and call a function that will return the average of the temperatures. It will also call a function that will return the highest temperature and a function that will return the lowest temperature. The user will input the number of temperatures to be read. There will be no more than 25 temperatures. For Full Credit You must have a comment block header at the top of your program. See the Standards document in Course Content You must use a constant to represent the maximum number of temperature readings You must use the correct data types for your constants and variables You must use an array of the correct data type You must validate your input. Check for number of invalid number of readings (> max, < 1, etc) and display appropriate error message. You must use one or more if/else branches for your decisions You must use a loop to read in the temperatures…arrow_forwardIn C# code: Write a program that will help an elementary schoolstudent learn multiplication. Use a Random object to produce two positive one-digitintegers. The program should then prompt the user with a question, such asHow much is 6 times 7 The student then inputs the answer. Next, the program checks the student’s answer. Ifit’s correct, display the message "Very good!" and ask another multiplication question.If the answer is wrong, display the message "No. Please try again." and let the studenttry the same question repeatedly until the student gets it right. A separate methodshould be used to generate each new question. This method should be called oncewhen the app begins execution and each time the user answers the question correctly.Program will stop any time students enter -1. One problem in CAI environments is student fatigue. This can be reduced by varyingthe computer’s responses to hold the student’s attention. The program should usevarious comments to be displayed for each…arrow_forwardSee the sample outputs for more clarification. Project Specifications Input for this project: Values of the grid (row by row) Output for this project: Whether or not the grid is magic square Programmer's full name Project number Project due date Processing Requirements Use the following template to start your project: #include using namespace std; // Global constants // The number of rows in the array // The number of columns in the array // The value of the smallest number // The value of the largest number const int ROWS = 3; const int COLS = 3; const int MIN = 1; const int MAX = 9; // Function prototypes bool isMagicsquare(int arrayRow1[], int arrayRow2 [], int arrayRow3[], int size); bool checkRange (int arrayRow1[], int arrayRow2[], int arrayRow3[], int size, int min, int max); bool checkUnique(int arrayRow1[], int arrayRow2[], int arrayRow3[], int size); bool checkRowSum (int arrayrow1[], int arrayrow2[], int arrayrow3[], int size); bool checkColiSum(int arrayrow1[], int…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education