Question: You have been assigned to write a software to convert between decimal and binary number. The software should fulfill the following criteria: i. Receive either

 You have been assigned to write a software to convert betweendecimal and binary number. The software should fulfill the following criteria: i.

You have been assigned to write a software to convert between decimal and binary number. The software should fulfill the following criteria: i. Receive either decimal or binary number and leave 0 for the other. Exit program if both input are 0 and print out error message if both input are non-zero. ii. A function called dec_to_bin() to convert decimal number to binary and function called bin_to_dec () to convert binary number to decimal. An example of the output is as illustrated in Figure Q3: Enter decimal or binary and leave 0 for the other, both o to exit. Enter decimal:14 Enter binary: 0 14 in decimal = 1110 in binary. Enter decimal or binary and leave 0 for the other, both o to exit. Enter decimal: 0 Enter binary:1010 1010 in binary 10 in decimal. Enter decimal or binary and leave 0 for the other, both 0 to exit. Enter decimal:1 Enter binary: 1 Please enter either decimal or binary. Enter decimal or binary and leave O for the other, both o to exit. Enter decimal: 0 Enter binary: 0 . Program finished with exit code 0 R. Based on the following requirement, you have to: (a) Identify input variable(s) and output variable(s) for this problem. [2 marks] (b) Draw the flowchart for the program. [9 marks] (c) Write the complete program. [14 marks]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!