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


Groups > comp.lang.java.programmer > #28783 > unrolled thread

Write a program that can add,subtract,multiply,divide in binary??......

Started byRuben Ongayo <rubzm11@gmail.com>
First post2014-06-19 17:57 -0700
Last post2014-08-15 20:05 -0700
Articles 6 — 6 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Write a program that can add,subtract,multiply,divide in binary??...... Ruben Ongayo <rubzm11@gmail.com> - 2014-06-19 17:57 -0700
    Re: Write a program that can add,subtract,multiply,divide in binary??...... rossum <rossum48@coldmail.com> - 2014-06-20 12:04 +0100
    Re: Write a program that can add,subtract,multiply,divide in binary??...... Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> - 2014-06-22 00:50 +0300
    Re: Write a program that can add,subtract,multiply,divide in binary??...... Roedy Green <see_website@mindprod.com.invalid> - 2014-08-05 11:55 -0700
      Re: Write a program that can add,subtract,multiply,divide in binary??...... Lew <lewbloch@gmail.com> - 2014-08-15 15:32 -0700
    Re: Write a program that can add,subtract,multiply,divide in binary??...... Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2014-08-15 20:05 -0700

#28783 — Write a program that can add,subtract,multiply,divide in binary??......

FromRuben Ongayo <rubzm11@gmail.com>
Date2014-06-19 17:57 -0700
SubjectWrite a program that can add,subtract,multiply,divide in binary??......
Message-ID<7428e654-026d-4059-b2c1-0a5ac2f96c26@googlegroups.com>
Write a program that can add,subtract,multiply,divide in binary??......
please help :'(...........help

[toc] | [next] | [standalone]


#28790

Fromrossum <rossum48@coldmail.com>
Date2014-06-20 12:04 +0100
Message-ID<qe48q9h1eb948m7sgskkf1m4m7pm7iappo@4ax.com>
In reply to#28783
On Thu, 19 Jun 2014 17:57:20 -0700 (PDT), Ruben Ongayo
<rubzm11@gmail.com> wrote:

>Write a program that can add,subtract,multiply,divide in binary??......
>please help :'(...........help
Your program will have at least four sub-programs.  Do not try to
write all four sub-programs at once, write them one at a time.  Only
when you have written all four should you assemble the four
sub-programs into your final program.

1) Write a sub-program to add in binary.  You might need to ask your
instructor exactly what is meant here, I can think of a few different
meanings.

2) Test your sub-program.  You will have made mistkes, and you need to
find and fix them.

3) Fix the mistakes you have found and go back to 2) to look for more
mistakes.  Only when your sub-program passes all your tests should you
proceed.

4) Perform steps 1) to 3) for your sub-program to subtract in binary.

5) Perform steps 1) to 3) for your sub-program to multiply in binary.

6) Perform steps 1) to 3) for your sub-program to divide in binary.

7) If your instructor wants it, perform steps 1) to 3) for your
sub-program to calculate a modulus in binary.

8) Assemble your four, or five, sub-programs into a single program,
conforming to the inut and output specifications supplied by your
instructor.  If you don't know what they are, then ask.

We don't do homework, but we will help you to do your own homework. If
you really do get completely stuck, then post the code you have
written here, and we will look at it.

Seeing your code is useful because it tells us what level you are
working at and how much effort you are putting in.  The more effort
you put in, the more likely we are to help you.

rossum

[toc] | [prev] | [next] | [standalone]


#28809

FromJukka Lahtinen <jtfjdehf@hotmail.com.invalid>
Date2014-06-22 00:50 +0300
Message-ID<lv4mzeszjk.fsf@saunalahti.fi>
In reply to#28783
Ruben Ongayo <rubzm11@gmail.com> writes:

> Write a program that can add,subtract,multiply,divide in binary??......
> please help :'(...........help

How much will you pay?

-- 
Jukka Lahtinen

[toc] | [prev] | [next] | [standalone]


#29570

FromRoedy Green <see_website@mindprod.com.invalid>
Date2014-08-05 11:55 -0700
Message-ID<t2a2u99j8mq5dsp637imf3mlkr48rodtp0@4ax.com>
In reply to#28783
On Thu, 19 Jun 2014 17:57:20 -0700 (PDT), Ruben Ongayo
<rubzm11@gmail.com> wrote, quoted or indirectly quoted someone who
said :

>Write a program that can add,subtract,multiply,divide in binary??......
>please help :'(...........help

see http://mindprod.com/jgloss/homework.html

The goal is not to produce the program, but to improve your coding
skills. If someone wrote it for you, only his skills would be
improved.
-- 
Roedy Green Canadian Mind Products http://mindprod.com
The art of strongly-typed language design is largely arranging 
that errors are automatically detected as soon as possible
in the compose, compile, run cycle.

[toc] | [prev] | [next] | [standalone]


#29678

FromLew <lewbloch@gmail.com>
Date2014-08-15 15:32 -0700
Message-ID<32fa7938-5f03-4a54-9ce8-1f3c9b26a7ce@googlegroups.com>
In reply to#29570
Ruben Ongayo wrote, quoted or indirectly quoted someone who said :
>>Write a program that can add,subtract,multiply,divide in binary??......
>>please help :'(...........help

All Java addition, subtraction, multiplication, and division is done in binary.
JLS 4.2: 
"The integral types are byte, short, int, and long, whose values are 8-bit, 16-bit, 32-bit and 64-bit signed two's-complement integers, respectively, and char, whose values are 16-bit unsigned integers representing UTF-16 code units (ยง3.1).

"The floating-point types are float, whose values include the 32-bit IEEE 754 floating-point numbers, and double, whose values include the 64-bit IEEE 754 floating-point numbers."

-- 
Lew

[toc] | [prev] | [next] | [standalone]


#29685

FromKevin McMurtrie <mcmurtrie@pixelmemory.us>
Date2014-08-15 20:05 -0700
Message-ID<mcmurtrie-89EDA5.20051915082014@news.sonic.net>
In reply to#28783
In article <7428e654-026d-4059-b2c1-0a5ac2f96c26@googlegroups.com>,
 Ruben Ongayo <rubzm11@gmail.com> wrote:

> Write a program that can add,subtract,multiply,divide in binary??......
> please help :'(...........help

Do tell us how math in binary is different from normal math.

-- 
Astraweb posts are filtered as spam

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web