Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [object-oriented]

Object-oriented programming is a programming paradigm using "objects": data structures consisting of data fields and methods together with their interactions.

5
votes
3answers
437 views

Length units converter

I am creating a very small application to demonstrate solid principles and also a brief implementation of a builder pattern, does anyone have any feedback as to how this could be improved or how it ...
1
vote
1answer
37 views

Class with predefined ellipsoids

I am creating an Ellipsoid class and I then want to instantiate a few constants (pre-defined Ellipsoids). Below is my current implementation. I am not really ...
1
vote
0answers
19 views

Encapsulating simple license backup to a disk

I am enapsulating my license backup to disk, using an interface ILicenseProvider and the implementation is DiskLicenseProvider. Also i am throwing an unchecked exception LicenseProviderException which ...
2
votes
2answers
94 views

Four-function calculator with buttons for digits and operators

I would like make this calculator program more Object Oriented but I'm struggling with how to do it. The calculator works perfectly but I would like to have another class that does the calculations ...
2
votes
1answer
106 views

Object-oriented student library 2

Follow up of Object-oriented student library Question: How do you refactor this code so that it is pythonic, follows OOP, reads better and is manageable? How can I write name functions and classes ...
1
vote
0answers
38 views

Design a system for renting digital movies/books

During an interview I was asked to do an OO design for a digital renting system for books/movies. This is the design that I came up with. My assumptions: When the customer has downloaded a list of ...
4
votes
3answers
62 views

Print the first, last, and in-between integers of a range

Given our spec from Code Golf: Given two integers, output the two integers, and then the range between them. The order of the range must be the same as the input. Examples: ...
4
votes
1answer
69 views

Implementation of Singly Linked List

I'm a data scientist attempting to build stronger CS fundamentals, particularly in Data Structures & Algorithms. Below is my attempt at implementing a Singly Linked List. Looking for advice ...
1
vote
0answers
35 views

Mixed Duo String Generator Part 2

Mixed Duo String Generator Hello again; Previously my code was critique and I applied this feedback to form my new revised code for the Mixed Duo String Generator. In the code below I revised it to ...
0
votes
0answers
28 views

License Manager PHP Class

I'm workin on this code that will be a licensing class integrated with an electron app. For now it's a simple object who will generate and check for a licence stored inside the electron app folder. I ...
1
vote
3answers
66 views

Mixed Duo String Generator 2 [duplicate]

I've create a program that finds mixed duo within a string. It removes characters from a string that do not form the first mixed duo. It does not rearrange the order of the string, it ony remove ...
3
votes
2answers
80 views

Mixed Duo String Generator

I've create a program that finds mixed duo within a string. It removes characters from a string that do not form the first mixed duo. It does not rearrange the order of the string, it ony remove ...
5
votes
1answer
113 views

Linked List implementation in Python

I'm a data scientist attempting to build stronger CS fundamentals, particularly in Data Structures & Algorithms. Below is my attempt at implementing a Singly Linked List. Looking for advice ...
7
votes
2answers
168 views

Object-oriented student library

This library management program can do following functions: Add a book to the library Display all available books Lend books to students Return books to the library Display students who have ...
1
vote
1answer
81 views

Template matrix class, second version

This is my first matrix class which I updated after already asking here already. The updated code is below. Are there any suggestions regarding member function parameters? Is there a convenient ...
2
votes
1answer
144 views

Little Address Book coded in Python 3

this program seems to be working well so far, but I know it can be cleaner and more efficients with certain functions/methods. As I'm still beginning to code any feedback would be very welcome. <...
5
votes
1answer
85 views

Service for generating faked objects

I'm using the Bogus library to mock up some data for testing. This is my main method demonstrating how the faking service should be used: ...
1
vote
2answers
80 views

Counter object in Python with public and private methods

I am trying to implement an open source desktop application with python. I want to provide both a gui and an API. I know there is no private methods in python but i am trying to find the most elegant ...
6
votes
2answers
115 views

First template class - Matrix functions

This post has been answered and updated. This was the first time I've ever written a template class. I've spent probably a bunch of times re-writing matrix code for different types, different ...
0
votes
2answers
124 views

Design a system for creating a coffeeshop menu

During an interview I was asked to design the menu for a coffee shop employee so that the employee would go and add different items to the menu. This is the design that I came up with. I just want ...
2
votes
2answers
64 views

Simple console based car array

I have recently started coding in Java and I had to do this assignment in college. Develop a menu driven application called TestCarPartc that allows the user to ...
2
votes
0answers
73 views

Object-oriented model of a machine gun using Pygame

I just started to use classes in Python, so I don't know all concepts, rules and conventions about it. I made a little program of a machine gun, which simulates firing by user's action. Here it is: <...
0
votes
0answers
39 views

Deferred Iteration in TypeScript

I've published a new TypeScript library currently in beta, and was hoping to get feedback on certain aspects of it, particularly implementation details for improving the performance of deferred ...
2
votes
1answer
71 views

PHP User management class

Here is my code for a class that is responsible for managing some common users task like registration, login and logout. It implements also a sub class that can be used to check the session of a ...
2
votes
1answer
145 views

Simple Hand Cricket Game in Object Oriented Way

The rules of the game are pretty simple. I'll put it here in case people don't know them It's a two player game hand game where they alternate being a batsman and a bowler. Who decides to do what ...
2
votes
1answer
384 views

Basic Connect Four game

Here is a simple text-based version of connect four I made. I have been building this in an attempt to improve my Java skills (and possibly mention on my resume). My goals with this project are as ...
1
vote
1answer
271 views

Flip coin Game in an Object oriented way

I started out creating a simple game in an Object Oriented way to practice. The rules are pretty simple There are two players You let one player choose if they want Heads or Tails. You assign the ...
1
vote
1answer
190 views

C++ wrapper for GLFW window object

I'm creating a window class in C++ to provide a bit of abstraction for a GLFW window. window.h ...
-1
votes
1answer
50 views

Control the input of the user according to a sample string and get some info from it

I made this Python code that prints a sample string and ensures that the input of the user agrees with the sample, and then do an action with this inputted string, in this case a multiplication table. ...
3
votes
0answers
50 views

Amateur Python Sudoku Solver

I'm self-taught in Python and would have a lot of room for improvement. I made this basic Sudoku Solver mainly in order to practice the use of Class creation. I would greatly appreciate any feedback ...
2
votes
1answer
46 views

C++ - Astar search algorithm using user defined class

The objective of the post is to improve design and improve command on C++. Given a map, start point and end point, the shortest path to end point from the start point has to be found out using Astar (...
1
vote
0answers
75 views

Kotlin DAO with Exposed: How to reduce redundancy in classes?

I'm writing a Kotlin app that uses Exposed (https://github.com/JetBrains/Exposed) as a SQL wrapper to write and read objects from databases. The problem I'm facing is that I end up with 3 classes ...
4
votes
0answers
80 views

So what if the “View” in an MVC isn't a Userform, but is the Worksheet?

So I've been following the discussions around VBA as an OOP language and the applicability of various design patterns, such as MVP or MVC. Excellent postings on these topics are extremely informative ...
1
vote
0answers
58 views

PHP OOP front controller pattern

I've started a course about the MVC pattern applied to the web. I want to improve my PHP programming skills so I've decided to write a simple boilerplate for my webapps that use the front controller ...
1
vote
1answer
122 views

Tic tac toe game using C++

I wrote this C++ code for Tic-tac-toe for an interview (The basic skeleton was pre-provided) and got rejected because the code was too complex and inefficient. I'm not an expert programmer so I'd like ...
2
votes
1answer
132 views

C++ Breakout game using SDL

I did a big mistake to create procedural C++ breakout game on start and now im having trouble converting it into OOP. As far as I can see I need classes: Loptica (eng. Ball), Splav (eng. Paddle), ...
1
vote
1answer
47 views

Function that performs a test of whether a number is greater or less than some expected result

The program that contains the function I'm asking (handle_non_exact_answer) about has several instances of a class Test, with ...
2
votes
3answers
261 views

Get collection of objects from CSV string and vise-versa

A generic class to get object collection from csv string. I would like to know if there's any better way? Converter class ...
0
votes
4answers
412 views

Simple OOP Blackjack game in Java

I've created a relatively simple Blackjack game in java. The reason why I decided to do this specific project was to improve my object orientated programming in java. I will post my code so feel ...
4
votes
3answers
130 views

Finite State Machine in C++

I made a state machine. You can press 0 and 1 to switch between the hypothetical menu and playing state. I hope you can help me improve it further. StateManager.h ...
7
votes
0answers
134 views

Web Battleship -The Unofficial Battleship UI

I've written my own UI for Mathieu Guindon's VBA Battleship (Battleship UI: GameSheet) which uses a webpage in a WebBrowser control for the View. Webform: Userform ...
4
votes
2answers
152 views

Space Invader Style Game - Model / Presenter Decoupled From View - Functional Again Too

Thank you for your patience. The game is fully functional again! I have tried to incorporate all the advice I have received so far. Thank you for taking the time to review and comment. I have now ...
1
vote
0answers
37 views

Ruby - Create a bitmap editor that accepts user input to plot a matrix grid, points and lines

I recently didn't pass a take-home code test for a job interview - and one of the reasons for this was that the code was not as idiomatic as it could be. The premise is in the title - but below ...
2
votes
1answer
44 views

Check values in datatables, with validation rules that vary according to the data source

Background I receive dataframes from several sources (below I call these sources s1, s2 and ...
2
votes
1answer
171 views

Python tkinter Snake

I have made a little Snake game with Python tkinter. It's my first Python program with one GUI. What can I improve? ...
2
votes
0answers
54 views

Dependency Inversion in constructor

Currently I'm learning OOP and meanwhile I'm trying to keep the SOLID principles. Is it right to inject dependency (GenName - generate file name) on File ...
4
votes
1answer
197 views

Hangman Game in C++

This is my version of Hangman Game, written in C++. How could it be improved? what should I avoid using/doing in future projects? ...
1
vote
1answer
57 views

Space Invader game written In VBA, 3rd iteration [closed]

Here is a link to the workbook, classes, modules and forms: https://github.com/Evanml2030/SpaceInvader/tree/master Positive: I have decoupled the view from the control / presenter. I have ...
2
votes
1answer
273 views

C++ - Object Oriented File System Design using Composite Design Pattern

I am trying to come up with a good File System Design using C++ / OOP. This is being done to gain an understanding of System Design and Design Patterns. I have some basic functionality, like reading ...
2
votes
0answers
105 views

AVL Tree with delete method in Python 3

Just a general code review. I'm looking for my first developer job so anything constructive is awesome. Please, and thank you very much. I've written this implementation as an exercise and to add to ...