Skip to main content

All Questions

Filter by
Sorted by
Tagged with
4 votes
2 answers
138 views

Human Jug and Glass

I am a beginner in Java. I have created this small project in Java with the inheritance concept. Here the Human will fill, pour and drink water. There are three classes: Glass, Jug and Human. Let me ...
Jency's user avatar
  • 143
5 votes
1 answer
124 views

Page-by model of data output and search results with values for UI

This is my first experience of designing classes with inheritance. I would like to get feedback on the interaction between the presented classes. It is unlikely that this code will seem complicated. ...
Owl's user avatar
  • 204
3 votes
1 answer
163 views

Vehicle inheritance exercise

I'm learning about using inheritance and super in Ruby. This is a continuation of one of the exercises that is in a book I am reading. I set up my Vehicle class to be the superclass. From there, <...
Nathan's user avatar
  • 175
9 votes
1 answer
3k views

OOP modeling of a boat rental system

I have some question about this exercise, did I model the problem correctly (the code works)?. If I did it correctly, Is there anything that can improve the code?. For example, how could I avoid the ...
I likeThatMeow's user avatar
4 votes
3 answers
118 views

Viewing the final state of an Object

As a beginner I was writing a code which asks the burger buyer what they want in their burger. I did this by creating a burger object and modify its attributes by the user using a switch case method. ...
Huzo's user avatar
  • 287
3 votes
1 answer
111 views

Emulating super() in Python 3.x using Python 2.7

Depending on the name of the first argument, self.__sup or cls.__sup behaves like super() in ...
nalzok's user avatar
  • 503
8 votes
1 answer
801 views

Creating Inheritance hierarchy using function constructor

Problem statement You need to create the Animal base class having four fields: a. name b. ...
overexchange's user avatar
  • 3,401
8 votes
1 answer
444 views

Polymorphic animals speak their name and make a noise

I'm new to GNU Smalltalk. I'd like to port a script I've written in Ruby, Scala, CoffeeScript, and several others. It's the one I use to try to learn the classic OOP concepts of abstract classes, ...
Ray Toal's user avatar
  • 765
23 votes
5 answers
7k views

Modelling a Call Center

This is the requirement I have (from the book: Cracking the Coding Interview) Imagine you have a call center with three levels of employees: fresher, technical lead (TL), and product manager (PM). ...
Koray Tugay's user avatar
  • 1,557