462 Topics

Member Avatar for
Member Avatar for bimoweemo

this is a piece of my header file that is a template and my implementtion file that is using it.I keep getting errors and dont know why,any help would be appreciated. [CODE]template<class T> class List { public: private: T *list; int size; int numElements; bool isValid(int location) const; }; [/CODE] …

Member Avatar for mike_2000_17
0
202
Member Avatar for kishanillur

I am writing some application for Android. Here my app receives sms and as soon as it receives, it launches another activity,say a browser with some url supplied. So here, I need two classes, broadcastReceiver( to receive sms) and Activity. But in java i can inherit only 2 classes. Since …

Member Avatar for JamesCherrill
0
242
Member Avatar for stow19

hey all, I know this might seem like a basic question but we haven't really been taught it at university and I was getting curious. Once you've created your program and have all your relevant java classes/package and it has been compiled where do you find the .exe and how …

Member Avatar for stow19
0
196
Member Avatar for TheLittleEngine

So i haven't figured out what the point of constructors are i am just learning C++ and am seriously having trouble with it, i do not get why...well i kind of get default constructors because it initializes the variables but what about a constructor with arguments and the member function

Member Avatar for Stefano Mtangoo
0
210
Member Avatar for nocloud

I am experiencing unexpected performance degradation when using vectors with classes. I have a csv_File class that reads in a csv file and stores the contents in a 2D vector. There's a member function that allows access, e.g. [CODE] csv_File file("file.csv"); file.access(2,2);[/CODE] To access the 2,2 element. Then, I have …

Member Avatar for mike_2000_17
0
193
Member Avatar for jackmaverick1

Hi! I've been making a rather large (but not huge, by any means) program and it needs, or so I think, a couple of classes and I want them to use inheritance to make my life easier. However, when I try to include all of my files in the main …

Member Avatar for jackmaverick1
0
217
Member Avatar for milan2011

Hi, I am trying to make a bank application that has two interfaces.One is the employee interface that lets employees to create an account and assign a IDnumber to each account(lets say the bank only accepts 100 accounts) and a balance for each account. The employee can also close an …

Member Avatar for pseudorandom21
0
524
Member Avatar for nocloud

I've been scratching my head for quite some time with the following compilation error and I was hoping somebody could shed some light... I have the following in my header (.h) file: [CODE] //the mem_data class======================================// class mem_data : public reader, public date { //multiple inheritance public: mem_data(int,int,std::string); ~mem_data(); private: …

Member Avatar for caut_baia
0
381
Member Avatar for vTr

Hey there, I was wondering if anyone had the time to look over my code and give me some tips or tweaks to help me get it running. The program is all about inheritance, where i have the derived class using the base class clockType (with using strings) to add …

Member Avatar for mrnutty
0
620
Member Avatar for jamie-pu

Hello, Im trying to make a simple equation solver with tkinter. Originally i built it without using classes and it worked fine however I am now trying to use a class. [CODE]from tkinter import * import math class RootFinder(Frame): def __init__(self, master=None): Frame.__init__(self, master) self.grid() self.create_widgets() def create_widgets(self): self.root1lbl=Label(self.outputframe, text='') …

Member Avatar for TrustyTony
0
167
Member Avatar for Ephexeve

I am reading a Python book for Pyton 2.5 (But I am doing Python 3). I am at the chapter classes and I got this part; "You can check whenever the function attribute was callable." [CODE]callable(tc,'talk',None)[/CODE] In Python3 we do not have callable anymore, so I checked on the internet, …

Member Avatar for TrustyTony
0
268
Member Avatar for mklein

Dear all I am making a program which adds lots of jlabels to a frame (the idea, eventually, is that each jlabel will link to a different program on my dekstop) The trimmed down code below shows that I have a script which creates an array of multiple jlabels which …

Member Avatar for JamesCherrill
0
297
Member Avatar for daianahoney

Hello forum. I cant figure out how to overload the '+' operator or maybe theres another error? Im posting from phone so excuse the slopyness. Thanks! [CODE]#include <iostream> #include <string.h> #include <ctype.h> using namespace std; class Ferma { public: static int nr_rate; static int nr_gaini; static int nr_porci; static int …

Member Avatar for daianahoney
0
234
Member Avatar for ghost_from_sa

Hey guys I've been asked to create an array of objects on the heap for my assignment but I cant seem to find any examples that explain it well enough on the web. So what I got is: [CODE]//Heabder File class Wheel{ public: Wheel() : pressure(32) { ptrSize = new …

Member Avatar for ghost_from_sa
0
188
Member Avatar for bleedi

Hiya, I've got a small problem. I have an interface called "event", which represents a networking event. I have classes implementing this interface. Now, when my server app receives a new event, it checks the class of the event and acts accordingly. This works nicely when the implementing classes are …

Member Avatar for bleedi
0
159
Member Avatar for karlamadeus

Hi guys, I am a bit new to OOP in general, and I was just wondering if I am going around what I want to do in the right way. I am making a small game to try to learn OOP and in this game I have several classes for …

Member Avatar for snippsat
0
113
Member Avatar for karlamadeus

Hello all. I am trying to write a short little game, mainly to boost my knowledge of classes and objects, and of course I am starting to encounter problems. I have several classes for different types of creatures in this game. Most of them take the form of: [CODE] class …

Member Avatar for griswolf
0
225
Member Avatar for lacoffo

Hey all:) I'm learning Java and I'm having a little trouble on a polymorphic write-to-file function. Let me quickly explain my project: I have an abstract class Mammal, with non-abstract children Horse, Cow etc. I have a Main program that creates a couple Horses and Cows, and store these in …

Member Avatar for lacoffo
0
258
Member Avatar for n0de

Hi, i have some issues with class inheritance and i do not know how to solve it, maybe someone could help me with that ? [CODE] //pentathlete.h #include <iostream> using namespace std; template < class T > class pentathlete { protected : T comp_res [ 5 ] ; /*private: int …

Member Avatar for n0de
0
157
Member Avatar for patrickgormally

Hi everyone! I'm creating a class for a mortgage payment. I pretty much have most of the code finished but when I compile the code I receive multiple errors saying "Cannot find symbol". This error occurs about 9 times and I am also having some problems with the compareTo method. …

Member Avatar for patrickgormally
0
130
Member Avatar for clickspiker23

I am supposed to read in data from a file and store it. I know how to read from a file and display it, in main, what i don't understand is how to do that with classes and objects. This is the part im having a little trouble with and …

Member Avatar for jjman4562
0
168
Member Avatar for clickspiker23

Im trying to read from a file using classes and objects. i keep getting this error [CODE]main.cpp:16: error: no matching function for call to ‘Game::fillGame()’ Game.h:41: note: candidates are: bool Game::fillGame(std::ifstream&)[/CODE] here is code that goes with the error [CODE] //Game.h bool fillGame(ifstream & din); [/CODE] [CODE] //Game.cpp #include<iostream> #include …

Member Avatar for jonsca
0
137
Member Avatar for cestra

[COLOR="Red"][B]//This is the main file[/B][/COLOR] [CODE]#include<iostream> #include<fstream> #include<string> #include "Books.h" #include"account.h" using namespace std; int main() { cout << "\tWelcome\t" <<endl; cout << "1-Login" <<endl; cout << "2-Register" <<endl; cout << "3-exit" <<endl; cout << "Please enter a choice: "; cin >> choice; switch (choice){ case 1: system ("cls"); cout …

Member Avatar for cestra
0
203
Member Avatar for Poopster01

I have the following error on line 71 and I'm not sure whats wrong with that statment any explanation would be greatly appreciated. C:\Users\peter\Desktop\CSC 111\welch_lab4\welch_lab4.java:71: cannot find symbol symbol : method equalsIgnorCase(java.lang.String) location: class java.lang.String while (!(response.equalsIgnorCase(FLAG))) ^ 1 error Tool completed with exit code 1 This is the details …

Member Avatar for Poopster01
0
182
Member Avatar for HiHe

This works with Python 2.7 [code]class B: def __init__(self, arg): print(arg) class C(B): def __init___(self, arg): super(C, self).__init__(arg) c = C('abc') # abc [/code]Here super() gives a TypeError: must be type, not classobj [code]from math import pi class Circle: """with Python3 object is inherited automagically""" def __init__(self, r): self.r = …

Member Avatar for HiHe
0
279
Member Avatar for g-pita

Hi I'm trying to create a program that gathers data from some ADC connected and do some averaging on the data. It's build up around classes containing systeminterface and sensors making a datamodel. The program is pretty big, but has worked intil implemention of pthreads I wanted to create a …

0
114
Member Avatar for 650U

I have a question in Inheritance(Python): Write a class named Person with data attributes for a person's name, address, and telephone number. Next write a class named Customer that is a subclass of the person class. The Customer class should have a data attribute for a customer number and a …

Member Avatar for e-papa
0
233
Member Avatar for ghost_from_sa

Hi guys, Im pretty dam stuck at the moment on an assignment Im meant to do. Its my last question so everything is pretty laid out, but the question (to me is not useful) so if you could just help me out it'd be much appreciated Ok so what i …

Member Avatar for ghost_from_sa
0
975
Member Avatar for Rimojenkins

Hello. I'm currently making a program that deals with a priorityQueue and inheritence/polymorphism. Student -> undergrad -> coop_student or student -> grad Now, the queue takes in the data and just puts it in a linked list and gives it a priority. That way, there are 3 queues and we …

Member Avatar for LevyDee
0
264
Member Avatar for 02marks

Hi, I am trying to write a program for my mum who is a teacher, the program needs to be able to store students information like their name address SAT scores etc. I have a basic background in c, but i decided to try and implement this program using c++. …

Member Avatar for thelamb
0
200

The End.