subject

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 1-90, going cast/west.
Ex: If the input is:
0
the output is
0 is not a valid interstate highway number.
1 nighway_number - int(input)
2
3 *** Type your code here. "
4 if highway_number - 0:
5 print(highway_number, 'is not a valid interstate highway number.')
6 if highway_number in range(1, 99-1):
7 if highway..number % 2 - :
8 print('I-' highway number, "is primary, going east/west.")
9 else
10 print("I-' highway_number, "is primary, going north/south."
11 else:
12 served - highway_number % 100
13 if highway number - 1000: print highway_number, 'is not a valid Interstate highway number.') 15 if highway number in range(99, 999.1):
16 if highway_number 2 - 0 print('I..highway_number, 'is auxiliary, serving I.', 'x. f.' Xserved, 'going eastwest.)
17
18 else:
19 print('1', highway_number, 'is auxiliary, rving I-','%.f.' Xserved, 'going north/south.)
19 Develop mode Submit mode
Input 90
Your output I- 90 is primary, going east/west.
Expected output I-90 is primary, going east/west. 0
2: Auxiliary (290)
Output is nearly correct; but whitespace differs. See highlights below.
Input 290
Your output 1- 290 is auxiliary, serving I- 90, going east/west. I-290 is auxiliary, serving 1-90, going east/west.
Expected output
3 Invalid (0) 1/1
Input 0
Your output is not a valid interstate highway number.
4. Compare output 0/2 Output is nearly correct; but whitespace differs.
Input
Your output

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 22:30
Lakendra finished working on her monthly report. in looking it over, she saw that it had large blocks of white space. what steps could lakendra take to reduce the amount of white space?
Answers: 3
question
Computers and Technology, 24.06.2019 05:30
Why is hard disk space important to an audio engineer? why are usb ports and firewire ports useful for an audio engineer? explain in 2-3 sentences. (3.0 points) here's a list of different audio software: ableton live apple inc.'s garageband apple inc.'s logic studio digidesign's pro tools propellerhead sofware's reason sony creative software's acid pro steinberg cubase steinberg nuendo choose one of the software programs listed above, and then go to that software program's web site. read about what the software program is used for, and then write 4-5 sentences about what you learned. (10.0 points) which type of software license is the most limiting? why? explain in 2-3 sentences. (3.0 points) when sending a midi channel voice message, how can you control the volume of the sound? explain in 2-3 sentences. (4.0 points)
Answers: 1
question
Computers and Technology, 24.06.2019 21:30
Computer security/cybersecurity1) each of the following code fragments contains a number of security vulnerabilities. for each fragment, identify these security vulnerabilities and, for each vulnerability, discuss at least one way that it could be improved. note that in your discussion of how each vulnerability could be improved, you do not need to re-write a new version of the program in c; simply discuss your solution, either in pseudocode or in 1-2 sentences.a) /* file descriptor leak */#include #include int main(int argc, char *argv[]){ char *filepath = argv[0]; char *shellpath = argv[1]; file *passwords; passwords = fopen(filepath, "r"); /* read the password and do something with it */ /* . . */ /* fork and execute alternative shell */ execl(shellpath, "shell", null); }b)#include /* assume the following function is written for an electronic storefront. the user will enter the id of the item to be ordered, as well as the quantity of units that they would like to purchase. the program will then lookup the price for the price for the item using a predefined function, and return the total cost of the order.*/int gettotalcost(){ char itemid[9]; int price, unitsordered, cost; printf(" enter the 9-digit id of the item to be ordered: "); scanf("%s", & itemid); /* lookup the price according to the itemid */ price = getpricebyid(itemid); printf(" enter the quantity of units to be ordered: "); scanf("%d", & unitsordered); cost = price * unitsordered; return cost; }c)#include /* the following function is intended to return a user's full name by concatenating the user's first and last name into a single string and then returning that string. */char *getfullname(char *firstname, char *lastname, int max_len){ char fullname[max_len]; strcpy(fullname, firstname); strcat(fullname, " "); strcat(fullname, lastname); return fullname; }d)#include /* the following code snippet runs through the list of cli arguments entered and displays them to the console. */int main(int argc, char *argv[]){ int i; printf("you've entered the following arguments: "); for(i = 0; i < argc; i++){ print(argv[i]); printf("\n"); } /* */}
Answers: 2
question
Computers and Technology, 25.06.2019 02:30
What group of plants produce fruit? question 2 options: gymnosperms nonvascular plants seedless vascular plants angiosperms
Answers: 1
You know the right answer?
Primary U. S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south,...
Questions
question
Mathematics, 04.03.2021 21:00
question
Mathematics, 04.03.2021 21:00
Questions on the website: 13722359