Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

HALP Prog question

Name: Anonymous 2007-11-12 18:02

Create an interface, "IBendable", with one method, "Bend".  Create two classes, "Spoon" and "Arm", that implement "IBendable". "Spoon" will also have an "Eat" method, and "Arm" will also have a  "Raise" method.  Each of these methods prints a message indicating its function.  Write another class with a "Main" method, declaring two objects of type "IBendable", one a "spoon" and another an "arm".  Call the "Bend" method.

help me pleeeeeeease

Name: Anonymous 2007-11-12 18:21

inb4 read sicp

Name: Anonymous 2007-11-12 18:22

>>1
class IBendable:
    def Bend( self ):
        pass

class Spoon( IBendable ):
    def Bend( self ):
        print( "Spoon bent." )
   
    def Eat( self ):
        print( "Spoon ... eat." )

class Arm( IBendable ):
    def Bend( self ):
        print( "Arm bent." )

    def Raise( self ):
        print( "Arm raised." );

if ( __name__ == "__main__" ):
    spoon = Spoon()
    arm = Arm()
    spoon.Bend()
    arm.Bend()


Also, you're a gigantic faggot. /prog/ doesn't exist to do your homework.

Name: Anonymous 2007-11-12 18:28

Here is my code:

using System;
class Arm : IBendable
{
    public Arm()
    {

    }
    public void Raise()
    {
        Console.WriteLine("Raising arm up.");
    }
    public void Bend()
    {
        this.Raise();
    }
}
class Spoon : IBendable
{
    public Spoon()
    {

    }
    public void Eat()
    {
        Console.WriteLine("Eating from the spoon.");
    }
    public void Bend()
    {
        this.Eat();
    }
}

class Prog6_18
{
    static void Main(string[] args)
    {
       
        Spoon childsSpoon = new Spoon();
        Arm childsArm = new Arm();
        EatFood(childsArm);
        EatFood(childsSpoon);

    }
    public static void EatFood(IBendable a)
    {
        a.Bend();
    }
        public interface IBendable
        {
            void Bend();
        }
    }

Not asking for free help or for someone to make it for me.  Asking for professional assistance.

Name: Anonymous 2007-11-12 19:04

no takers?

Name: Anonymous 2007-11-12 19:26

>>4
Asking for professional assistance.
This is /prog/, not rentacoder.

Name: Anonymous 2007-11-12 19:32

DISCOUNT PROGRAMMER

Name: Anonymous 2007-11-12 19:52

>>3
kill( self )

Name: Anonymous 2007-11-12 19:53

┌───────┐
│lol wut│
└───────┘

Name: Anonymous 2007-11-12 20:33

>>8
ONE WORD: THE FORCED INDENTATION OF CODE.

Name: Anonymous 2007-11-12 22:22

Oh lawd, OP, can't you OOP?

Name: Anonymous 2007-11-12 22:23

>>8
Don't forget your fucking semicolon;

Name: Anonymous 2007-11-13 4:54

Read SICP

Name: Anonymous 2007-11-13 11:22

>>1
1111 1001 1111 1001 1001 1111 1001
1000 1001 1000 1010 1001 1001 1001
1111 1001 1000 1100 1111 1001 1001
1000 1001 1000 1010 0001 1001 1001
1000 1111 1111 1001 1111 1111 1111

Name: Anonymous 2007-11-13 11:43

>>12
You don't use semicolons in Pythong.

Name: Anonymous 2007-11-13 12:01

Name: Anonymous 2007-11-13 12:12

>>16
i fappe'd

Name: Anonymous 2007-11-13 16:43

>>14
F 9 F 9 9 F 9
8 9 8 A 9 9 9
F 9 8 C F 9 9
8 9 8 A 1 9 9
8 F F 9 F F F

Name: Anonymous 2007-11-13 16:50

>>1
Why would I want to eat a spoon?

Name: Anonymous 2007-11-13 17:43

>>19
Maybe the spoon is supposed to eat something.

Name: Anonymous 2007-11-13 17:48

Jesus Christ, /prog/ is only little children asking for homework help these days. Do your own fucking programming homework. If you can't, ask your fellow students or your teacher for help. Or just go study something else.

The point of homework is to learn something from it, not to invest minimal effort to get other people to do it for you.

Name: Anonymous 2007-11-13 18:27

>>21
/prog/ is filled with amatures or s'kiddies anyway, like real professional JAVA ENTERPRISE PROGRAMMERS would visit here, much less 4chan in the first place

Name: Anonymous 2007-11-13 19:39

>>22

I resent that comment.

Name: Anonymous 2007-11-13 19:56

>>21
Jesus Christ, /prog/ is only little children asking for homework help these days.
True, there should be more discussions about SICP. You know, where everybody says SICP SICP SICP but obviously nobody ever read it.

Name: Anonymous 2007-11-13 20:07

>>18
You just didn't get it, did you?

Name: Anonymous 2007-11-13 22:27

>>24
wrong, bitch

Name: Anonymous 2007-11-14 4:01

>>24
How's that related to this thread? Or it's just your way to say "I've read SICP"?

Name: Anonymous 2007-11-14 4:50

Name: Anon 2007-11-15 18:21

while (noob == true)
{
      help = false;
}

Name: Anonymous 2007-11-15 18:30

>>29
You're explicitly comparing a boolean variable to a boolean value in a predicate and you're calling other people noobs?

Name: Anonymous 2007-11-15 19:36

>>30
Java Programmer

Name: Anonymous 2007-11-16 4:23

>>31
Faggot

Name: Anonymous 2007-11-16 4:33

>>31,32

Same person

Name: Anonymous 2007-11-16 9:14

>>31,32
Different persons


>>32,33
Different persons

Name: Anonymous 2007-11-16 18:21

>>31,32,33,34,35

Same persons

Name: Anonymous 2007-11-16 18:31

>>29
OPTIMIZED:
help = !noob;

Now, gb2/g/ and never step a foot in /prog/ again.

Name: Anonymous 2007-11-16 21:50

>>36
CORRECTED:
help &= ~noob;

I believe you mis-interpretted the correct behavior of the original snippet: in the case where the initial state is {help:false,noob:false} your code will give them help when it shouldn't. The corrected version correctly still doesn't help them.

Name: Anonymous 2009-03-06 11:34


The BOARDS ARE ABOUT the whitespace thing   putStr tail fix.

Name: Anonymous 2010-12-17 1:24

Are you GAY?
Are you a NIGGER?
Are you a GAY NIGGER?

If you answered "Yes" to all of the above questions, then GNAA (GAY NIGGER ASSOCIATION OF AMERICA) might be exactly what you've been looking for!

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List