Question: . mod.resource%2Fcontent%2F2%2Fa 1.pdf Parpose: This assignment is intended to give you practice with translating pseudo-code into C code and exercise your problem solving skills and

 . mod.resource%2Fcontent%2F2%2Fa 1.pdf Parpose: This assignment is intended to give you

.

mod.resource%2Fcontent%2F2%2Fa 1.pdf Parpose: This assignment is intended to give you practice with translating pseudo-code into C code and exercise your problem solving skills and your grasp of the concept of an algorithm. Part I: Translate the following pseudo-code into C code and make your translated programs working correetly Problem 1: Consider the following problem description, input/output specification, and high level pseudo-code algorithm: Problem Deseription: Convert a binary (base 2) number into decimal (base 10). Note that you do not know how many digits there are in the binary number, and you should only examine one digit at a time, starting with the left-most digit. Input: A series of binary digits (0's & I's) followed by any other character. Output: The decimal value equivalent to the binary number entered. Error Handling: In parts a) and b), output 0 if no valid digits were entered High-level pseudo-code algorithm (start by convincing yourself that this algorithm works): Step 1: Prompt the user to enter a binary number, followed by the Enter key Step 2: Assign decimal Value 0 Step 3: Get the first binary digit and Assign nextDigit , the value of the digit Step 4: While ( the nextDigit is 0 or 1 ) 4.1 Assign decimal Value

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!