Stack Exchange Network

Stack Exchange network consists of 175 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.

0
votes
0answers
54 views

Forgot password / Reset password

I have a working example of 2 methods: Forgot password: A user inserts an account number and an email => An email is sent to the user right after it creates a token in the database. Validate Reset ...
5
votes
2answers
230 views

OOP bank account program in Python 3

Python beginner here. Building an OOP bank account program with SQLite and starting to struggle a bit with its design. From a design standpoint I have a file (bank) which calls ATM. ATM simulates an ...
0
votes
2answers
84 views

Binary Search Tree implementation with unique pointers

I have implemented a binary search tree using templates and unique_ptr in C++ 11. At present, only insertion and deletion are implemented. Please provide your feedback for improvements. ...
3
votes
2answers
74 views

Constructing a cumulative distribution function from a histogram

During some running process, a histogram of values shall be build up. When done, the CDF shall be derived from it and used to get the quantiles for some values. My current implementation looks as ...
0
votes
1answer
130 views

Enhanced C# Enumeration / `enum`

I am developing my own kind of Enumeration like SmartEnum but trying to prevent the user to provide a recursive-ish type definition like below: ...
2
votes
2answers
51 views

Getting Record entries

I have a class Record which keeps entries of strings(implemented using vector of strings). I want to keep the data member private to the class. To get entries, I have defined a member function ...
5
votes
2answers
556 views

Predict mars robot position

Description A robot lands on Mars, which happens to be a cartesian grid; assuming that we hand the robot these instructions, such as LFFFRFFFRRFFF, where "L" is a "turn 90 degrees left", "R" is a "...
1
vote
2answers
90 views

Formatting a price in Swift using an extension vs. a class

I have a price as a Double, which I should format it as a String. Should I use an extension instead of classical class to ...
0
votes
0answers
21 views

Generate HTML file from Handlebars template and data object

I have a class called HtmlFile which has a method called generate. The generate() method is ...
4
votes
0answers
43 views

Tkinter application to manage school tasks

I'm a beginner in OOP programming and I'm wondering what is the best way to put all the windows and functions of a window application in the code. My biggest questions are: Am I using classes and ...
1
vote
1answer
35 views

Playing card class, written using enums

I wrote a card class a while back in this post here: Previous Question I know it has been a long time but I recently came back to the project and wrote it using an enum as suggested in the answer to ...
0
votes
1answer
47 views

Temperature and speed unit converter class in JS

This is what I came up with, but I'm not sure if: putting it in Class is the best approach multiple repeats (this.val etc.) are acceptable there is a better ...
1
vote
0answers
57 views

Further dive into filtering using IPredicate

Preface This is a follow up to my previous post from not long time ago about containers and filtering. This post can be found here. Now, I will attempt to expand what I have learnt from the answer ...
3
votes
2answers
460 views

Simple text-based tic-tac-toe

I am learning C++ and I need help to review my first code and see how I could improve it in any way. Any suggestions are welcome. It was tested and it is free of bug. The code is a game called ...
0
votes
1answer
49 views

FollowUp CommandLineInterpreter (CommandLineInteraction)

I wrote an command line interpreter (CLI) in Java and got some real helpful hints on how to improve. The cli is responsible to pick up the users input (via keyboard aka command line) into any app ...
4
votes
2answers
158 views

Tic Tac Toe program that includes reports

I'm working to use everything I'm learning in my reading and former code reviews to keep making this program better. I'm getting stuck on the following issue: the ...
6
votes
1answer
110 views

Class containers, filtering and coding practices

Context Usually, when I have to deal with a collection of items (especially objects) I tent to create a container class for that collection (wrapper?). What I mean by that is: when I have to handle ...
7
votes
1answer
173 views

Extending the extended Stable Marriage Problem using a Python class

As soon as I saw this open source paper, I thought that the best way to replicate their code would be using a python class. After having replicated and extended the ...
1
vote
1answer
97 views

Java CommandLine Interface implementation

I write a lot of mini apps. Each app has its own InputHandler for input from the keyboard. It's time to make a lib for that purpose - a ...
2
votes
1answer
51 views

Dynamically Generating XML Deserialization Classes / Code: Part I, Reading

I'm building an IntelliJ Plugin which will allow a person to select an XML file (and even a snippet of XML in the file, if they like) and, using a really brief GUI, generate classes / code in one of a ...
3
votes
1answer
94 views

Map, which contains biomes, which contain landforms, which contain tiles

I am trying to model this: a Map can have multiple child of type Biomes and no parent a Biome can have multiple child of type Landforms and a Map as its parent a Landform can have multiple child of ...
-1
votes
3answers
81 views

A Java Calculator that could perform basic Mathematical Operations [closed]

I've been working for few days to develop a basic Java Swing Calculator that could Add, Subtract, Multiply or Divide two numbers and also has other options like inverse(1/x) and square root. But I am ...
3
votes
2answers
50 views

Listing the playlists on which each song appears

I created a way to export my Google Play playlists to a text file and also a way to export all of my songs in Google Play to a text file. Now I have both the song list (in an array format) and ...
4
votes
1answer
111 views

Object-Oriented Breadth-First Search Implementation

My goal is to write a GUI application where a user can create a maze and select an algorithm. The passage of the algorithm from a selected start and end point should be visualized. The following ...
3
votes
2answers
180 views

Battleship Game in Java

I wanted to make a very simply Battleship game in Java, any feedback is welcome. Nevermind the getters / setters. Just assume they are there. ...
7
votes
0answers
94 views

Free body diagram generator using MVP for VBA

Based on my understanding of Model View Presenter (MVP) I have it generate a diagram. Is this a correct implementation of MVP? What deficiencies are there in my implementation? UI Generated diagram ...
2
votes
1answer
61 views

Query builder with OOP design

I am designing a query builder, where the user can just add conditions or groups, and each group can, in turn, have conditions in it. I came up wit the below class design. Can this design be improved? ...
3
votes
0answers
49 views

Metaclass to run a __first__ method for the first instantiation of a class

I had an idea for a __first__ special method for a class. It would be run after __new__ and before ...
2
votes
0answers
85 views

Feels like I have no clue what I'm doing in my “project” - “GAME” [closed]

Never had any programming course. Am not programmer. Does not plan to be. If anyone has a lot a time to lose, I feel like I have no clue what I'm doing / that a lot of my code is very badly ...
5
votes
3answers
238 views

Student grade calculator using classes/ structs in C++

I am trying to teach myself C++ and using Problem Solving in C++ by Walter Savitch. This is a program project from the book that I used to practice using classes/ structs and would like some feedback, ...
4
votes
1answer
134 views

Word Chain Implementation

The idea originaes from the CodeKata19, find a word chain for two words of a wordlist example 1 turning lead into gold: ...
3
votes
1answer
88 views

Design of a Tic Tac Toe program in Python

Here is a program I wrote to reproduce the known win proportions for random Tic Tac Toe games (X always moving first). It takes about a minute to play the one million random games that will be played ...
4
votes
2answers
102 views

Follow up Implementation on Monty Hall Simulation

I have taken your inputs on my original question and formed a new implementation of the Monty Hall Simulation: Again keep an eye on CleanCode and OOP The Price to be won: ...
2
votes
0answers
58 views

PHP project with Google Calendar API

I'm playing with a simple (for now) project in PHP with Google Calendar API. I have posted the code here in order to improve my programming style about whatever you think it's worth suggesting. Thank ...
2
votes
0answers
85 views

Simple Flappy Bird Clone using Kivy (with very minimum physics)

This is a very simple clone of Flappy Bird using Kivy, to be used for programming class for teens. The game consists of 3 classes: Bird, ...
3
votes
1answer
47 views

Reproducing the known results for random tic tac toe play using Python

I'm reading "Code Complete" by McConnel and I'm practicing using object oriented programming to "reduce complexity". (By that McConnel means, among other things, that it should be very easy to read ...
3
votes
0answers
37 views

Generic router in Rust

I am trying to make a router in Rust using Rocket.rs. I'd like to devise a way to use a default router for my more simple db tables that don't require different logic, to prevent rewriting the same ...
6
votes
1answer
106 views

First OOP in Python 3: Pygame Pong

I have been studying Python for a few months and just recently decided to stop avoiding OOP and reworked a Pong game to a more object oriented style. Please tell me how I should improve my code. Some ...
3
votes
1answer
129 views

Clean Code / OOP on Monty Hall Simulation Implementation

can you review the this code for the Monty Hall simulation, mainly on the aspects of OOP and CleanCode ...
0
votes
1answer
53 views

Polymorphism and inheritance in C99

In the following code I have created the something like the behavior of inheritance and methods in C99 (without vtable). The code compiles without any warnings even with ...
7
votes
3answers
176 views

Standardized and automated Class block generation for VBA

I recently developed a tool which automaticaly generates VBA code in order to smoothly create class templates. I wanted to share this tool with the community, hopefully this is the right place. The ...
1
vote
2answers
128 views

Item class/system for RPG/DND type game

Thanks for the enormous response on my last question! I've returned with another question, hoping for more insight. I'm developing an Item class and system, and I ...
2
votes
1answer
74 views

Stopwatch utility class in Java

Looking for input on my code for a Stopwatch utility written in Java. ...
2
votes
0answers
41 views

Database code for Python-based URL shortener

I had implemented a URL shortener with Python and a database. Please review the database part of the code. The idea is to create an MD5 hash of the URL in question and then store it in a database. The ...
3
votes
2answers
57 views

Chip8 emulator memory map

I am making a Chip8 emulator and I started out with making a class for handling the memory map. So main the execution will read from this memory object and write to it. /include/Chip8.h ...
8
votes
3answers
1k views

Binary Search Tree implementation using smart pointers

I have implemented below code for binary search tree implementation using shared pointer. At present, I have considered only integers. It supports insertion and deletion of values. Also, a print ...
1
vote
3answers
76 views

Password generator class and CLI

I made a password generator class in C++. I am not as familiar with C++ as I am with C, so I am looking for ways to move to a C++ mindset. I am also trying to use embedded practices like avoiding ...
9
votes
2answers
507 views

Hunt the Wumpus game in C++

I have created a simple version of the classic game Hunt the Wumpus in C++. The rules for the game can be found on Code Golf SE. The rules of the game are (from PPCG): The player starts in a ...
3
votes
2answers
308 views

Implementing different types of light sources in a Graphics project

Edit: I got asked a lot why I need to have the LightSource base class or why do I keep one vector of all the light sources, so here's my explanation: In many ...
2
votes
0answers
41 views

Python logging setup for a package

I'm running a package that downloads data from the internet. This package makes logging calls from different modules. Suppose I have a package 'demopackage'. Here is how my logging is currently set ...