Polymorphism and Classes in Python

I am having trouble completing this assignment for school. This picture is what the output should be when complete. Here is the problem I am tasked with: "In the main.py file creates four objects. (vehicle, sedan, truck, hatchback) The main.py shou...
more »

2017-04-18 22:04 (3) Answers

Are these different types of classes the same?

I know that a class can inherit from another class, but there are lots of different names for these. A child class inherits from a parent class A subclass inherits from a superclass A derived class inherits from a base class Are these all just d...
more »

2017-04-18 16:04 (1) Answers

input check functions in python classes

I want to create a check on inputs of a particular class, I have the following made up example: class NmbPair: def __init__(self, a = None, b = None): self.a = a self.b = b def __eq__(self, other): if self.a == other...
more »

2017-04-18 09:04 (1) Answers

learning c++: error: use of deleted function

I'm doing some exercises from the book "think like a programmer" and everything has been great so far. I started the classes chapter and here I seem to be stuck as I can't wrap my head around the error I'm getting compiling the code. Here is the co...
more »

2017-04-17 20:04 (3) Answers

SDL2 Thread not working inside class

I am trying to create a input handler using multi threading with the SDL2 Library; however, when I try to put a thread in a class it won't compile and gives me this error... error: cannot convert 'inputHandlerClass::getInput' from type 'int (inputHa...
more »

2017-04-17 19:04 (1) Answers

Writing in file with specific format

def sauvegarder_canaux(self, nom_fichier:str) is the method giving me a problem when the file saves it only writes in this format: 5 - TQS (Télévision Quatres-saisons, 0.0 $ extra) I need it to be like this: 5 : TQS : Télévision Quatres-sai...
more »

2017-04-17 19:04 (2) Answers

call a function from an array of vectors

In following code, i get an error on line 33. Why? What is the correct syntax? Surely I made some stupid mistake ... unfortunately I'm trying to better understand the vectors. #include <iostream> #include <vector> class firstClass { ...
more »

2017-04-17 17:04 (1) Answers

Javascript: Objects and Classes

Earlier in js, we were able to do this: var emptyObj = {}; this created an empty object, but this object is an instance of which class or is there something that I'm missing? The concept of classes has been introduced in es6 then how were we able ...
more »

2017-04-17 13:04 (1) Answers

PHP Session in class output null

login.php $yetkili = new YETKILILER(); $yetkili->YETKILI_TC=$YETKILI_TC; $yetkili->YETKILI_SIFRE=$YETKILI_SIFRE; $_void = $yetkili->Giris(); $_SESSION['YETKILI'] = $yetkili; index.php $yet = $_SESSION['YETKILI']; $tc= $yet->YETKILI_T...
more »

2017-04-17 13:04 (5) Answers

Setting up a class with instances

I'm trying to create a class to represent a deck of cards for a blackjack game. So far I have a class to represent the player's bankroll, and one for the deack. I also have a very clumsy attempt at instantiating the cards individually: class Player(...
more »

2017-04-16 17:04 (0) Answers

Properly import a class in BlueJ

I've used JDatePicker for a simple app, but my teacher said that he will accept no precompiled .jar's, and he needs to see how it's able to compile from just sources. So I checkout JDatePicker source code, extract it, and add every .java file from t...
more »

2017-04-16 16:04 (1) Answers