Ask your own question, for FREE!
Computer Science 20 Online
OpenStudy (sheraz12345):

Can someone help me with my code... Reply me ASAP

OpenStudy (bibby):

You need to be way more specific. Language? What are you trying to do? Post your code

OpenStudy (sheraz12345):

It is a java code.. I need to convert octal to decimal. The question is as follows Write a program in JAVA that can handle Octal to Decimal conversions. The number is taken as user input at runtime. Your program should validate that the number typed is a valid octal number. You cannot use Integer or any of the class from the util package except for the Scanner class.

OpenStudy (sheraz12345):

There are no errors while compiling but the answer is not coming right... Suppose octal number 1336 . Its decimal equivalent is 734... But my program is giving answer 222.0

OpenStudy (sheraz12345):

@hba

OpenStudy (hba):

please wait.

OpenStudy (sheraz12345):

ok .. i am here waiting for u reply

OpenStudy (sheraz12345):

.............

OpenStudy (rbx):

for(int i=0;i<temp;i++) This seems to be the problem. Why is the test condition i<temp? It should be for(int i=0;temp>0;i++)

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!