
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
thumb_up100%
please see attatched image, thank you

Transcribed Image Text:This assignment involves the use of a dictionary, functions, and
Hexadecimal Binary
'O'
Hexadecimal Binary
"0000'
'8'
'1000'
exception handling.
'1'
"0001'
'9'
'1001'
Write a program that converts a number input in hexadecimal
'2'
'0010'
'A'
'1010'
into binary. The program should use a Python dictionary to
hold the conversion pairs from hexadecimal to binary. For your
reference, here is a table showing the conversions from
hexadecimal to binary .
'3'
'0011'
'B'
'1011'
'4"
'0100'
'C'
'1100'
'5'
'0101'
'D'
'1101'
'6'
'0110'
'E'
'1110'
'7'
'0111'
'F'
'1111'
You should have two functions .. main() and convert(). The main() function should simply ask the user to enter a
hexadecimal number, then pass the hex number to the convert() function. The convert() function should accept the hex
number, then use the dictionary to determine the binary equivalent. The complete binary number should be returned
to main(). The main() function should then print the binary number. Note that the hex number may have only one digit
or it may have multiple digits. See the examples below.
RESTART: C:\Users\dbatts00
Enter a hexadecimal number: B
The binary equivalent is 1011
RESTART: C:\Users\dbattso0
Enter a hexadecimal number: 2A
The binary equivalent is 00101010
>>>
RESTART: C:\Users\dbatts0d
Enter a hexadecimal number: B6F
The binary equivalent is 101101101111
Make sure to check for a KeyError. (Remember that hexadecimal numbers must be 0 through F. Lowercase letters
should not be recognized as a valid hexadecimal number. See below .
Enter a hexadecimal number: b6f
The binary equivalent is not found. Invalid hexadecimal number.
Make sure to include header and step comments in your program.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images

Knowledge Booster
Similar questions
- Table Layout Open the mi_tables.css and go to the Table Styles section and add a style rule for the table element that: sets the background color to a linear gradient that goes to the bottom of the table background starting from rgb(190, 215, 255) and ending in black and adds a 5-pixels solid gray border. Table Elements For every th and td element in the table, create a style rule that: adds a 3-pixel solid gray border, sets the line height to 1.4em, and sets the padding space to 8 pixels. For every th element, create a style rule that: sets the background color to black, sets the font color to rgb(130, 210, 255), and sets the font weight to normal. For every td element, create a style rule that: sets the font color to white, sets the font size to 0.9em, and aligns the cell text with the top of the cell.arrow_forwardJason Chang is creating photos of his restaurant for a new website. Some of the staff photos have red eyes; others are poorly lit so that the restaurant looks dark, and some of the food photos have little contrast or are poorly composed. He asks for your advice about ways to enhance his photos to make them look better for the website. What suggestions might you give? Do you think it is okay to modify photos digitally to improve their appearance, or is that deceiving his customers? Why or why not?arrow_forwardHTML TRUE/FALSE Text can be centered inside a div element by using the selector command text-align:center or otherwise placing the text inside another div element with the same background color and applying margin-left command. (TRUR OR FASLE) A paragraph, div element, and h element will assume the vertical size needed to accommodate all its internal content, if you do not assign a height to these elements( TRUR OR FASLE)arrow_forward
- The moveVertical and slowMoveVertical strategies should be practiced first. Use the moveHorizontal command to 70 pixels to the left of the current position of the circle in your document.arrow_forwardJohn Deakin Gardens is a landscaping business for homes and small commercial properties. The owner has approached you for some new custom built PC's that his employees will use for day to day tasks. Using the uploaded image, explain and make it compatible for one another; relate it to the following A potential client may email or call to ask for some work to be done. The designers sets up a meeting over Zoom. The designer uses special softwares to mock up designs to show the client. The special software is quite complex, and requires a lot of processing. The choose the best and specialized software between Revit and Rhino and relate it to the PCU compartments NO AI PLEASEarrow_forwardComplete the following webpage assignment. Assignment Instructions: Design a webpage to simulate a Blog. The website must have a banner image and a featured image with multiple resolutions to be active at different resolution breakpoints just as discussed in this lesson. Include a jQuery script in your project to further enhance the user experience. Use one of the CDN libraries. The script is up to your discretion though you must be able to justify its use. The blog page must be aesthetically pleasing and follow a traditional blog structure. It may help to look at the many WordPress templates available on the net.arrow_forward
- By using Java Swing Make a progarmme the does Recrusive Multiplicationarrow_forwardCriteria to include on page: A div that is centered at the top of each page for the title of the site (mine below is “ResumeMohammed Alazawi”) A div that is centered and visible (acts as a buffer) and contains within it three divs that arecentered and horizontally next to each other (for me, it is the pink, green, and yellow divs).o Tip: to center the three divs, put them in another centered div (below the red div iscentered and there is another div centered in that which you cannot see, but it is justacting as a container for the pink, green, and yellow divs) Link to all of your other pages. These links should have pseudo classes assigned so that the colorof the link varies depending on if the user is hovering, it is active, visited, or if it is just a link. Inaddition, place the “title” attribute in the anchor tag and see what happens (Google titleattribute HTML if you are having trouble. The first result should be a w3 schools site, which wehave all seen before. This will have…arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON

Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY