462 Topics
| |
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] … | |
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 … | |
| 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 … |
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 | |
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 … | |
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 … | |
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 … | |
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: … | |
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 … | |
| 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='') … |
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, … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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. … | |
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 … | |
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 … | |
[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 … | |
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 … | |
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 = … | |
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 … | |
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 … | |
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 … | |
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 … | |
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++. … |
The End.