Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #28782

Re: assignments

From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: assignments
Date 2014-06-19 20:51 -0400
Organization A noiseless patient Spider
Message-ID <lo00ib$omt$1@dont-email.me> (permalink)
References <6aafa91c-4b8c-4884-a30d-2c4af8b443c2@googlegroups.com>

Show all headers | View raw


On 6/19/2014 8:44 PM, Ruben Ongayo wrote:
> Write a java program that can add,subtract,multiply,and divide binary??
> Please help me.....

public class Ongayo {
   public static void main(String[] unused) {
     int binary_x = 0b11111011110;
     int binary_y = 0b101010;
     int binary_sum = binary_x + binary_y;
     int binary_difference = binary_x - binary_y;
     int binary_product = binary_x * binary_y;
     int binary_quotient = binary_x / binary_y;
     int binary_modulus = binary_x % binary_y;  // extra credit!
   }
}

-- 
Eric Sosman
esosman@comcast-dot-net.invalid

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

assignments Ruben Ongayo <rubzm11@gmail.com> - 2014-06-19 17:44 -0700
  Re: assignments Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-06-19 20:51 -0400
    Re: assignments Ruben Ongayo <rubzm11@gmail.com> - 2014-06-19 18:06 -0700
      Re: assignments Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-06-19 21:33 -0400
        Re: assignments Gordon Levi <gordon@address.invalid> - 2014-06-21 20:51 +1000
          Homework sabotage [Was: Re: assignments] Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-06-21 08:46 -0400
  Re: assignments Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2014-06-19 20:49 -0500
  Re: assignments Roedy Green <see_website@mindprod.com.invalid> - 2014-06-20 08:04 -0700

csiph-web