You are asking to develop a Converting decimal to Binary or hexadecimal program in Python. The...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
You are asking to develop a "Converting decimal to Binary or hexadecimal" program in Python. The program tell user it can convert any decimal number range 0 to 15 to corresponding binary number or hexadecimal number. 1. Use a function to get an integer between 0 to 15 (assume O is an integer) from the user. For any incorrect input, display a reminding message and let user re-enter. 2. Use a function to get the user's choice, "a" or "b", from a menu: a: Converting to Binary b: Converting to hexadecimal 3. Convert and display the number according user's choice in function main(). 4. Ask user if want to convert another decimal number. If "Yes", repeat steps 1 to 4 above. If "No", terminates the program. How to get higher score for this assignment: 1. The program must have at least 3 functions including function main(). 2. For any wrong input, tell the player what is wrong and asking to re-enter. 3. Allow a user to play multiple times. For example, using a while Remind the player what input to stop the game. 4. Formatting your outputs and developing your program a user-friendly one. 5. Document your program by adding comments: 1. Introduce/describe the program including the author, date, goal/purpose of the program at the very beginning. 2. Document every variable/function used at the program even the name is meaningful 3. Explain/comment operation/activity/logic of your code. For example, "Checking whether the input is integer from 0 to 15". 6. Testing your program for all possible inputs. Make sure it runs right and will not get syntax/running error. You are asking to develop a "Converting decimal to Binary or hexadecimal" program in Python. The program tell user it can convert any decimal number range 0 to 15 to corresponding binary number or hexadecimal number. 1. Use a function to get an integer between 0 to 15 (assume O is an integer) from the user. For any incorrect input, display a reminding message and let user re-enter. 2. Use a function to get the user's choice, "a" or "b", from a menu: a: Converting to Binary b: Converting to hexadecimal 3. Convert and display the number according user's choice in function main(). 4. Ask user if want to convert another decimal number. If "Yes", repeat steps 1 to 4 above. If "No", terminates the program. How to get higher score for this assignment: 1. The program must have at least 3 functions including function main(). 2. For any wrong input, tell the player what is wrong and asking to re-enter. 3. Allow a user to play multiple times. For example, using a while Remind the player what input to stop the game. 4. Formatting your outputs and developing your program a user-friendly one. 5. Document your program by adding comments: 1. Introduce/describe the program including the author, date, goal/purpose of the program at the very beginning. 2. Document every variable/function used at the program even the name is meaningful 3. Explain/comment operation/activity/logic of your code. For example, "Checking whether the input is integer from 0 to 15". 6. Testing your program for all possible inputs. Make sure it runs right and will not get syntax/running error.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
1. What is a bootable USB flash drive used to reset passwords on a device? A. Password vault B. Dynamic knowledge-based authentication (KBA) C. Static knowledge-based authentication (KBA)...
-
In this project, we will write a program that controls a quiz show, much like the many popular TV shows. The program will read in a group of questions and their multiple choice answers, storing them...
-
You purchased 10 ASD June 45 puts and the company declares a 10% stock dividend. How are the terms of the option contract then changed?
-
In Exercises determine which of the integrals can be found using the basic integration formulas you have studied so far in the text. (a) (b) (c) S x - 1 dx
-
How can the hold-and-wait condition be prevented?
-
What is the cause of thrashing? How does the system detect thrashing? Once it detects thrashing, what can the system do to eliminate this problem?
-
Where does this second rigid-body mode appear due to an equivalent support stiffness of 300,000 lb/inch?
-
Give the Circular 230 position concerning each of the following situations sometimes encountered in the tax profession. a. Taking an aggressive pro-taxpayer position on a tax return. b. Not having a...
-
Let C' be the curve of intersection of the cylinder 25x + y = 25 and the plane x + y + z = 4. (a) Using t as the parameter where 0
-
Assume it is Monday, May 1, 2020, the first business day of the month, and you have just been hired as the accountant for Alpine Company, which operates with monthly accounting periods. All of the...
-
Examine the real options approach in capital budgeting and its relevance in valuing flexibility in investment decisions. How does this technique capture the value of managerial choices in uncertain...
-
Summarize the three stages of behaviorism discussed in your textbook. How do Bandura's and Rotter's views on cognitive factors differ from Skinner's views? What are some criticisms of and...
-
A researcher would like to test the effect of Drug A as a treatment for anxiety. 10 subjects receive Drug A (the trial/test drug). 10 subjects receive Drug B (placebo pill, with no known effect on...
-
A credit union's Rate-Climber GIC pays rates of 3%, 3.5%, and 4% compounded semiannually in successive years of a three-year term How much interest will be earned in the second year, if $13,000 is...
-
There are values (social, environmental, health etc.) that you are passionate about. When making financial and other business decisions, those values are also reflected in your decisions. To this...
-
You are a Human Resources Manager at Fly Eagles Fly, Inc., a company that makes custom sports jerseys for domesticated parrots. Write a memo to the CEO of the company addressing the following: 1....
-
Find the Fourier series for f(x), if f(x)= Deduce that 3 5 -x
-
The purpose of this case is to come up with a contingency plan[s] in order to sustain the program Move With Me, a program that serves thousands of community members throughout Lower Manhattan. The...
-
Add the above two assignment statements to your cipher.html page so that it properly encodes messages containing both uppercase and lowercase letters. As before, any non-letters (including spaces and...
-
Enter the roll.html text from Figure 13.1 into a new Web page. After loading this page, click the button to verify that the code repeatedly simulates and displays dice rolls until doubles are...
-
Consider the following tasks: (1) adding 100 numbers stored in main memory, and (2) adding a number to itself 100 times. Although both tasks require 100 additions, the second would be executed much...
-
When managers use offers of rewards and threats of punishments to try to get others to do what they want them to do, they are using which type of power? (a) formal authority (b) position (c) referent...
-
In the research on leader behaviors, which style of leadership describes the preferred high-high combination? (a) transformational (b) transactional (c) laissez-faire (d) democratic
-
How is a person with an authoritarian personality expected to act? (a) Strong tendency to obey orders. (b) Challenges the authority of others. (c) Tries to play down status differences. (d) Always...
Study smarter with the SolutionInn App