Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Binary To Decimal(i am trying to code a binary to decimal program that could take numbers llike 11.111. this is what i have for now. if anyone could look at it for me, i would be glad)
Binary To Decimal [message #945771] Mon, 15 October 2012 16:23
oti agyei is currently offline oti agyeiFriend
Messages: 1
Registered: October 2012
Junior Member
import acm.program.*;

public class BinaryToDecimal extends ConsoleProgram {
public void run(){

private int leftBinary(){
int q;
int sum=0;
int count=0;
int a=readInt("how long is your binary number on the left: ");
for(int j=0;j<a;j++){
int n=readInt("Enter number: ");
q= (int) (n *Math.pow(2,j));
return sum;

private double rightBinary(){
double total=0;
double z;
int counter=0;
double b= readInt("how long is your binary number on the right: ");

for(int d=1;d<=b;d++){

int e=readInt("Enter number: ");
for(int p=1;p<3;p++){
z=(double) (e*Math.pow(2,-p));

return total;
private double BinToDin(){
double U;

return U ;


Previous Topic:Ran into a JDK error
Next Topic:in eclipse juno the window's size can not be set by configurer.setInitialSize
Goto Forum:

Current Time: Sat Jun 23 09:53:26 GMT 2018

Powered by FUDForum. Page generated in 0.25041 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top