辅导Programming编程、Python程序设计辅导、Python讲解

- 首页 >> Algorithm 算法
Programming guidelines
1.Use Any Python IDE you wish.

Requirements
1.Allow user to input an integer from 0 -> 2,000,000,000.
2.Validate the input. If input is invalid, make them enter a value again.
3.Processing
4.Use the Division method for converting Decimal to Binary, and to Hex.
a.Divide the quotient by 2.
b.Get the remainder after dividing by 2. Save the remainders. They are the answer.
5.Loop and divide the test number by 2. Loop until the quotient is zero.
6.Note: Remember remainders are given in reverse order (LSB first).
7.Output
a.At beginning of the program, display some kind of welcome message, stating to the user what this program does.
b.When printing the results, display both the original integer value and the calculated binary and hex values. Display the output in a nice format.
8.Testing - Extensively test your program. Test with all type of integers values; valid and invalid data.