Skip to main content
I think you mean "Dinner" the meal, not "Diner" the restaurant.
Source Link
ItamarG3
  • 6.3k
  • 2
  • 25
  • 60

I would give them labs that can later be reused for polymorphism. For example, introduce class signatures for Apple,Banana,Cake,Dinner. Then you say that they need to implement a system of a DinnerDinner`. Then you say that they need to implement a system of a Dinner:

public class Dinner{
    //store the banana objects and apple objects 
    //        (you can say that an array is useful here, as the dinner can't contain 20,000 apples.
    //and also a collection of cake objects

    ...
}

And ask them to implement a system which allows the creation (which means they would have to write a constructor) of a Dinner. Then they should write methods for the Dinner object, so that one can add apples, bananas and cakes to the diner (this can be tricky; they'd need to keep an index for the arrays) and methods for when a customer orders a cake etc.

This assignment covers objects, including composition (no pun intended) and methods etc.

I would give them labs that can later be reused for polymorphism. For example, introduce class signatures for Apple,Banana,Cake,Dinner. Then you say that they need to implement a system of a Dinner`:

public class Dinner{
    //store the banana objects and apple objects 
    //        (you can say that an array is useful here, as the dinner can't contain 20,000 apples.
    //and also a collection of cake objects

    ...
}

And ask them to implement a system which allows the creation (which means they would have to write a constructor) of a Dinner. Then they should write methods for the Dinner object, so that one can add apples, bananas and cakes to the diner (this can be tricky; they'd need to keep an index for the arrays) and methods for when a customer orders a cake etc.

This assignment covers objects, including composition (no pun intended) and methods etc.

I would give them labs that can later be reused for polymorphism. For example, introduce class signatures for Apple,Banana,Cake,Dinner. Then you say that they need to implement a system of a Dinner:

public class Dinner{
    //store the banana objects and apple objects 
    //        (you can say that an array is useful here, as the dinner can't contain 20,000 apples.
    //and also a collection of cake objects

    ...
}

And ask them to implement a system which allows the creation (which means they would have to write a constructor) of a Dinner. Then they should write methods for the Dinner object, so that one can add apples, bananas and cakes to the diner (this can be tricky; they'd need to keep an index for the arrays) and methods for when a customer orders a cake etc.

This assignment covers objects, including composition (no pun intended) and methods etc.

I think you mean "Dinner" the meal, not "Diner" the restaurant.
Source Link

I would give them labs that can later be reused for polymorphism. For example, introduce class signatures for Apple,Banana,Cake,DinerDinner. Then you say that they need to implement a system of a Diner`Dinner`:

public class DinerDinner{
    //store the banana objects and apple objects 
    //        (you can say that an array is useful here, as the dinerdinner can't contain 20,000 apples.
    //and also a collection of cake objects

    ...
}

And ask them to implement a system which allows the creation (which means they would have to write a constructor) of a DinerDinner. Then they should write methods for the DinerDinner object, so that one can add apples, bananas and cakes to the diner (this can be tricky; they'd need to keep an index for the arrays) and methods for when a customer orders a cake etc.

This assignment covers objects, including composition (no pun intended) and methods etc.

I would give them labs that can later be reused for polymorphism. For example, introduce class signatures for Apple,Banana,Cake,Diner. Then you say that they need to implement a system of a Diner`:

public class Diner{
    //store the banana objects and apple objects 
    //        (you can say that an array is useful here, as the diner can't contain 20,000 apples.
    //and also a collection of cake objects

    ...
}

And ask them to implement a system which allows the creation (which means they would have to write a constructor) of a Diner. Then they should write methods for the Diner object, so that one can add apples, bananas and cakes to the diner (this can be tricky; they'd need to keep an index for the arrays) and methods for when a customer orders a cake etc.

This assignment covers objects, including composition (no pun intended) and methods etc.

I would give them labs that can later be reused for polymorphism. For example, introduce class signatures for Apple,Banana,Cake,Dinner. Then you say that they need to implement a system of a Dinner`:

public class Dinner{
    //store the banana objects and apple objects 
    //        (you can say that an array is useful here, as the dinner can't contain 20,000 apples.
    //and also a collection of cake objects

    ...
}

And ask them to implement a system which allows the creation (which means they would have to write a constructor) of a Dinner. Then they should write methods for the Dinner object, so that one can add apples, bananas and cakes to the diner (this can be tricky; they'd need to keep an index for the arrays) and methods for when a customer orders a cake etc.

This assignment covers objects, including composition (no pun intended) and methods etc.

Source Link
ItamarG3
  • 6.3k
  • 2
  • 25
  • 60

I would give them labs that can later be reused for polymorphism. For example, introduce class signatures for Apple,Banana,Cake,Diner. Then you say that they need to implement a system of a Diner`:

public class Diner{
    //store the banana objects and apple objects 
    //        (you can say that an array is useful here, as the diner can't contain 20,000 apples.
    //and also a collection of cake objects

    ...
}

And ask them to implement a system which allows the creation (which means they would have to write a constructor) of a Diner. Then they should write methods for the Diner object, so that one can add apples, bananas and cakes to the diner (this can be tricky; they'd need to keep an index for the arrays) and methods for when a customer orders a cake etc.

This assignment covers objects, including composition (no pun intended) and methods etc.