Results 1 to 4 of 4
  1. #1
    arneltroy is offline Member
    Join Date
    Jan 2009
    Posts
    1
    Rep Power
    0

    Default Need help on my project on JAVA BINARY ADDITION

    hi,im arnel.im new to this forum..i need help on my project about BINARY ADDITION. my instructor ask us to make a program about BINARY ADDITION. it goes like this:

    Enter Number of Value: 3
    Enter number of Binary:3
    Enter Binary digit:1
    Enter Binary digit:0
    Enter Binary digit:1
    Enter number of Binary:2
    Enter Binary digit:0
    Enter Binary digit:1
    Enter number of Binary:3
    Enter Binary digit:1
    Enter Binary digit:1
    Enter Binary digit:1

    101
    01
    111

    and then it somes up the result of the binary..i only got so far on User entering how many values of binary he wants to ask,and how many digits he wants to add.
    but my problem is i dont know how to display the ones that i have entered and get the sume of it..will you please help me please?.i have to pass the project 2days from now.please help me please...

    this is my program i got so far:


    import java.util.Scanner;
    public class binaryaddition {

    public static void main(String[] args) {

    Scanner numB= new Scanner(System.in);
    Scanner numA= new Scanner(System.in);
    Integer num1,num2,num3;



    System.out.print("Enter number of value:");
    num1= numA.nextInt();
    for (int j = 0;j < num1;j++){
    System.out.print("Enter digits for binary:");
    num2 = numA.nextInt();


    for (int b = 0;b < num2;b++){
    System.out.print("Enter binary number:");
    num3 = numA.nextInt();
    }


    }




    }}



    please please please please help please....

  2. #2
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    We don't write code for people. Please talk to your instructor...

  3. #3
    emceenugget is offline Senior Member
    Join Date
    Sep 2008
    Posts
    564
    Rep Power
    7

    Default

    if you can do it by hand, then chances are you can make an algorithm to do it. it may not be pretty at first, but it's the necessary steps to take.

    if you can't do it by hand, then i suggest you learn that first.

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. Addition java program
    By tabrez_k81 in forum New To Java
    Replies: 5
    Last Post: 12-15-2008, 11:08 AM
  2. Binary Addition
    By Deo Favente in forum Advanced Java
    Replies: 11
    Last Post: 04-24-2008, 06:34 AM
  3. Binary Tree Implementation in Java
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-16-2008, 11:35 PM
  4. Binary Search in Java
    By Java Tip in forum Algorithms
    Replies: 0
    Last Post: 04-15-2008, 08:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •