Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

You are doing your practice teaching in a seventh grade math class and they are

ID: 3657657 • Letter: Y

Question

You are doing your practice teaching in a seventh grade math class and they are learning how to convert from base ten or decimal to base 2 or binary.You want to show them how to do this and allow them to play with converting from decimal to binary.Thus, you decide to develop a computer program that will perform the conversion and display the results.

You decide to have the user enter the number at one time, i.e., 23.45.The program will separate the number into the integral and fractional parts before converting and then put them together again after converting.

Flowchart:

Requirement:

Write a Python program that request a decimal real number from the user and converts the number to a binary real number.

Explanation / Answer

>>> bin(88) '0b1011000' >>> int('0b1011000',2) 88 >>> >>> a=int('01100000',2) >>> b=int('00100110',2) >>> bin(a&b) '0b100000' >>> bin(a|b) '0b1100110' >>> bin(a^b) '0b1000110'

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote