Question

Please help and answer in a PSEUDO Code format in assembly language! Thanks

PROJECT (a) write a program that will convert the number 23567 => n, where (b) Write an algorithm that will convert a number n, to ne where b , c < 10.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

a) 23567=>nb; b=9

     Begin:

               Input: 2356

               Output: nb

               Convert Decimal:

                        initialise i=0, sum=0

                        while input not equal 0

                                sum=sum+(input%10)*7i

                                input=input/10

                                increment i by 1

                         end while

                  return sum

            Convert Base 9:

                            initialise val=0

                            initialise i=0

                            while sum not equal 0

                                    val=(sum%9)*10i +val

                                    sum=sum/9

                                    increment i by 1

                              end while

              return val

      End

     Answer is 23567=11719

b) nb=nc   b,c<10

     Begin:

               Input: nb

               Output: nc

               Convert Decimal:

                        initialise i=0, sum=0

                        while input not equal 0

                                sum=sum+(input%10)*bi

                                input=input/10

                                increment i by 1

                         end while

                  return sum

            Convert Base c:

                            initialise val=0

                            initialise i=0

                            while sum not equal 0

                                    val=(sum%c)*10i +val

                                    sum=sum/c

                                    increment i by 1

                              end while

              return val

      End

Add a comment
Know the answer?
Add Answer to:
Please help and answer in a PSEUDO Code format in assembly language! Thanks PROJECT (a) write...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT