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


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

assignments

Started byRuben Ongayo <rubzm11@gmail.com>
First post2014-06-19 17:44 -0700
Last post2014-06-20 08:04 -0700
Articles 8 — 5 participants

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


Contents

  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

#28781 — assignments

FromRuben Ongayo <rubzm11@gmail.com>
Date2014-06-19 17:44 -0700
Subjectassignments
Message-ID<6aafa91c-4b8c-4884-a30d-2c4af8b443c2@googlegroups.com>
Write a java program that can add,subtract,multiply,and divide binary?? 
Please help me.....

[toc] | [next] | [standalone]


#28782

FromEric Sosman <esosman@comcast-dot-net.invalid>
Date2014-06-19 20:51 -0400
Message-ID<lo00ib$omt$1@dont-email.me>
In reply to#28781
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

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


#28784

FromRuben Ongayo <rubzm11@gmail.com>
Date2014-06-19 18:06 -0700
Message-ID<8e2976e4-f31f-4363-9797-9e8d9a755708@googlegroups.com>
In reply to#28782
On Friday, June 20, 2014 8:51:19 AM UTC+8, Eric Sosman wrote:
> On 6/19/2014 8:44 PM, Ruben Ongayo wrote:
> esosman@comcast-dot-net.invalid
> it didn't run in my eclipse ...please give me the whole codes Mr.... .. please 

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


#28785

FromEric Sosman <esosman@comcast-dot-net.invalid>
Date2014-06-19 21:33 -0400
Message-ID<lo0311$7p2$1@dont-email.me>
In reply to#28784
On 6/19/2014 9:06 PM, Ruben Ongayo wrote:
> On Friday, June 20, 2014 8:51:19 AM UTC+8, Eric Sosman wrote:
>> On 6/19/2014 8:44 PM, Ruben Ongayo wrote:
>> esosman@comcast-dot-net.invalid
>> it didn't run in my eclipse ...please give me the whole codes Mr.... .. please

     What, exactly, do you mean when you say "it didn't run?"  If it
failed to compile, what error message(s) did the compiler produce?
If it compiled but failed to run, what error message(s) did the
Java Virtual Machine produce?

     ... but all of this is beside the point.  Based on several years
of experience with this and other newsgroups, blatant "do my homework
for me" requests get a mixture of four responses:

     0) Some people ignore them entirely.  A subset of these people
        may also configure their newsreaders to automatically ignore
        all future posts by the homework-shirker.

     1) Some people provide solutions for *precisely* what was asked,
        solutions that are invariably useless as homework.  (That's
        the course I took in this instance.)  A variant on this is to
        answer "Write this program" with "Okay, I wrote it: If you want
        to see what I wrote, send money."

     2) Some people provide solutions that are *almost* right, with
        errors that the homework-shirker is unlikely to detect but
        that will be obvious to the person grading the homework.

     3) Some people provide solutions that are correct but are quite
        obviously not the homework-shirker's work: They'll use Java
        features the beginner cannot possibly have learned yet, for
        example.  One particularly nasty variant is a program that
        does what was asked but also prints "Ruben Ongayo is a lazy
        slimeball" *and* won't do anything at all if the message is
        removed or altered.

     The moral of all this is: Do your own homework.  If you need help,
ask your instructor(s).  If you have made an honest attempt and are
still having trouble, you can seek help here *if* you can show evidence
that you've actually tried: Show what you've written, describe how it
misbehaves, and describe how you wanted it to behave.  That sort of
message gets help; "Do my work for me" doesn't.

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

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


#28806

FromGordon Levi <gordon@address.invalid>
Date2014-06-21 20:51 +1000
Message-ID<6noaq9p5vipknufe8nviilroc2mbp025aq@4ax.com>
In reply to#28785
Eric Sosman <esosman@comcast-dot-net.invalid> wrote:

> One particularly nasty variant is a program that
>        does what was asked but also prints "Ruben Ongayo is a lazy
>        slimeball" *and* won't do anything at all if the message is
>        removed or altered.

I liked this idea so I took it as my homework. I added the condition
that mere obfuscation was not allowed. Even it was, we know the
homework shirker has a single stepping debugger. I have failed to
produce the program. Can you help me with my homework?

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


#28807 — Homework sabotage [Was: Re: assignments]

FromEric Sosman <esosman@comcast-dot-net.invalid>
Date2014-06-21 08:46 -0400
SubjectHomework sabotage [Was: Re: assignments]
Message-ID<lo3us4$v31$1@dont-email.me>
In reply to#28806
On 6/21/2014 6:51 AM, Gordon Levi wrote:
> Eric Sosman <esosman@comcast-dot-net.invalid> wrote:
>
>> One particularly nasty variant is a program that
>>         does what was asked but also prints "Ruben Ongayo is a lazy
>>         slimeball" *and* won't do anything at all if the message is
>>         removed or altered.
>
> I liked this idea so I took it as my homework. I added the condition
> that mere obfuscation was not allowed. Even it was, we know the
> homework shirker has a single stepping debugger. I have failed to
> produce the program. Can you help me with my homework?

     Most of the details have faded from my fading memory, but I
dimly recall somebody posting something along these lines here,
perhaps about a decade ago.  My hazy recollection is that the
code used reflection to extract its own class name (or was it
a method name?), used that name to decrypt a compiled-in byte[]
of gibberish into a byte[] in .class format, then loaded and
instantiated the resulting class -- which produced, naturally,
the asked-for homework solution.  If the containing class name
was changed from SoAndSo_Is_A_Slimeball to something less
damning, decryption would produce garbage and the decrypted
class wouldn't load, much less execute.

     (I repeat: fading memory, foggy details, et cetera.)

     A skilled Java programmer could defeat this pretty easily,
for example by breakpointing just after the decryption and then
decompiling the decrypted class.  But by asking to have his
homework done for him the requestor had already shown that
he was not a skilled Java programmer, so ...

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

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


#28786

FromJoshua Cranmer 🐧 <Pidgeot18@verizon.invalid>
Date2014-06-19 20:49 -0500
Message-ID<lo03uo$c06$1@dont-email.me>
In reply to#28781
On 6/19/2014 7:44 PM, Ruben Ongayo wrote:
> Write a java program that can add,subtract,multiply,and divide binary??
> Please help me.....

Here's a start:
public class IAmIncapableOfDoingMyOwnWork {
   private static long binaryAddition(int lhs, long kabluie) {
     // Your processor is probably using CMOS or some derivative
     // so this is definitely a binary addition at that level.
     return lhs + kabluie;
   }
}


-- 
Beware of bugs in the above code; I have only proved it correct, not 
tried it. -- Donald E. Knuth

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


#28791

FromRoedy Green <see_website@mindprod.com.invalid>
Date2014-06-20 08:04 -0700
Message-ID<uaj8q9567oo65i2dpie52fseb0p7cn7lkl@4ax.com>
In reply to#28781
On Thu, 19 Jun 2014 17:44:22 -0700 (PDT), Ruben Ongayo
<rubzm11@gmail.com> wrote, quoted or indirectly quoted someone who
said :

>Write a java program that can add,subtract,multiply,and divide binary?? 
>Please help me.....
 see http://mindprod.com/jgloss/homework.html
-- 
Roedy Green Canadian Mind Products http://mindprod.com
Software gets slower faster than hardware gets faster. 
~ Niklaus Wirth (born: 1934-02-15 age: 80) Wirth's Law

[toc] | [prev] | [standalone]


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


csiph-web