1,089 Topics

Member Avatar for
Member Avatar for anglwthnati2de

Hi guys. I am hoping for a little help with this. I am pretty new to programming and just can't seem to get things right yet. Here is my code. It returns like 40 errors. Way messed up eh? [CODE]#include <iostream> #include <string> using namespace std; class Date { public: …

Member Avatar for anglwthnati2de
0
204
Member Avatar for TahoeSands

Every time I think I am really making progress in understanding object oriented programming, I run into something that makes me have to go back and start all over again... This time its "subclassing". I believe that I understand the basics inheritance and overriding, but when I start to develop …

Member Avatar for jon.kiparsky
0
124
Member Avatar for TrustyTony

This code is giving minimal change from real Python class to JavaMonster with every method having setter and getter not following the PEP8 naming but capitalizedWordsFormat. When instrunctor turns his head or if you put the code in your library, you can simply remove the setter/getter lines.

0
261
Member Avatar for dddundalk

Hi all, Afraid I'm not going to be much help just yet. Am learning C++ and Java. Used to be a Cobol Mainframe programmer in a previous life and I'm having a hard time with OOP. So I mostly come here to get answers to how to do something or …

Member Avatar for WASDted
0
117
Member Avatar for henryford

Hey guys I have a study guide that I need some assistance with if possible. it is basically definitions. Classes={} Assume these statements are working with classes and objects: Attribute?property Instance Encapsulation Also I need to tell what this code does. I am not good with classes at all please …

Member Avatar for SgtMe
0
119
Member Avatar for Tsunami49

Hi there. I am currently trying to get my head around using classes across two files. I currently have a super class and a sub class stored in a file and the main function in another. When I try and pass arguments to the class they work fine if the …

Member Avatar for Tsunami49
0
137
Member Avatar for geethasree

Hi All, this is my first query after joining the forum. I would like to know following points: 1. If I can create threads in constructor 2. If yes, can I use the same object / instance (which created this thread)in this thread to call other methods of the class …

Member Avatar for geethasree
0
2K
Member Avatar for ace8957

Hi all, So I'm working on this program to use a circular doubly linked list to implement a queue class. It went fairly well, but I'm stuck on the copy constructor, which causes runtime errors whenever I try to test it. Nonetheless, I really don't see what I am doing …

Member Avatar for caut_baia
0
2K
Member Avatar for ace8957

Hello all, So I'm working on this simple program with a Queue class template that is publicly derived from the abstract base class CharQueue. The only problem is that I keep getting hit with the error "expected class name before '{' token". The reason I don't understand this is that …

Member Avatar for Fbody
0
738
Member Avatar for Rez11

The point of the program I am making is to have a pure abstract base class called BasicShape and have 2 child classes, Circle and Rectangle. I have the program written but with one unresolved error. [B]Main.cpp file[/B] [CODE]#include "Pure.h" #include <iostream> using namespace std; int main() { Circle pizza(2,2,10); …

Member Avatar for Rez11
0
968
Member Avatar for vbx_wx

Anyone knows some good books about OOP in C++ ? But not books with theory,i want to learn how to implement oop.

Member Avatar for Fbody
0
58
Member Avatar for mommabear

[B]Specifications (minimum):[/B] The CDROM class contains the following, private, data members: string Name; // The Name of the CDROM string CDType; // The Type of CDROM float Cost; // The Cost of the CDROM [I]The ONLY recognized (i.e., legal) CDROM types are, “Game”, “Word”, “Compiler”, “Spreadsheet”, “Dbase”, and “Presentation” (AND, …

Member Avatar for mitrmkar
0
152
Member Avatar for bejfake

Hi, I have to write game Minesweeper in OOP way. I have classes: Square which inherits to mineSquare, emptySquare, digitSquare and class Board which is responsible for initialize and control the game. I have such code: [CODE=c]#include <iostream> #include <typeinfo> #include "time.h" using namespace std; class Square{ public: Square(){ this->isShown …

Member Avatar for bejfake
0
177
Member Avatar for notuserfriendly

I am reading from a file. After i tokenize and assign each value to a string field i call the constructor and initialize the object. next i want to add them to an array. I have done this with a vector and all i do is [CODE=java]ObjectVec.add(obj1);[/CODE] Mind you this …

Member Avatar for masijade
0
175
Member Avatar for vt2009

Tryin to finish some C# tutorial examples, I write VB and some procedural proprietary languages at work and must learn C#. I am having trouble with OOP and syntax: Why does the writeline command return no values? My struct contains the method and variables I want passed to the Main …

Member Avatar for manugm_1987
0
188
Member Avatar for Milton Neal

Hi All This is more a discussion than a problem. :) I’m working on a small project that needs to be done in C++. Part of it requires that I maintain an array of file streams so that I can open serveral files at one time, read, write exchange data …

Member Avatar for Narue
0
245
Member Avatar for rcogq7

//This is the error that i have Exception in thread "main" java.lang.NullPointerException //at CardTest.main(CardTest.java:16) /** * @(#)CardTest.java * * * @Robert Coughlin * @version 1.00 2010/10/15 */ //this is the main public class CardTest { public static void main(String [] args) { Card [] randomCard=new Card[20]; for(int i= 0; i<20; …

Member Avatar for kramerd
0
234
Member Avatar for Radio2006

I am trying to start this java program using the requirements below, but I have no idea where to start. Just so you guys know, I am just starting out in this language. i have experience in Javascript programming, but this is completely different. I am used to Java programs …

Member Avatar for Radio2006
0
247
Member Avatar for bee90

I am practicing the inheritance concept od oop in c++. It seems like a simple program but the linking error my compiler Dev C++ 4.9.9.2 version is giving me, makes it look sooo annoyingly difficult. Error is: [CODE] [Linker error] undefined reference to `vtable for Cd' [Linker error] undefined reference …

Member Avatar for bee90
0
188
Member Avatar for PerplexedB

[CODE]Partial Class system.windows.forms.control Overridable Sub ioEnabled(ByVal mode As ModeValues) End Class[/CODE] ... gives me a zillion errors. Is there a proper way to "expand" a system class?

0
86
Member Avatar for emilyhedgecock

Basically, its all to do with the inventory system, all the other reams of code work fine, thank God! with the inventory, the idea is that each character can hold 5 items, so an array, but the array needs to hold the itemID and the itemName therefore an array wont …

Member Avatar for Stefano Mtangoo
0
155
Member Avatar for ana_1234

This is a friend operator overload function that used addition. It adds two mix fraction by reducing them to simplest form the adding and converting them back to a mixed number [CODE]Mixed operator+(const Mixed& f1, const Mixed& f2) { int newnum, newnum2, gcd, tmpNumerator2, tmpNumerator, tmpInteger, tmpInteger2; Mixed r; tmpNumerator …

Member Avatar for ana_1234
0
434
Member Avatar for ana_1234

So I've been working on this program for a while, I'm finally finish but I have two error that I can not understand why. My first error is when I am declaring the header f [CODE] //------------------- Mixed.cpp -------------- #include <iostream> #include "mixed.h" using namespace std;[/CODE]ile> it keep sending me …

Member Avatar for ana_1234
0
305
Member Avatar for jknapp06

Hello, I'm in a software design class and we are using java; I've taken other programming classes and I'm familiar with a few other languages but that's the problem. I feel like I'm missing the point of java. I don't even know the term for it...but the java style I …

Member Avatar for JamesCherrill
0
139
Member Avatar for TahoeSands

For several weeks, I have been trying to wrap my brain around the concept of the paint(Graphics g) method. I have a pretty good idea how it works, but I am still struggling with the "practical" application of the paint method with respect to OOP. I can write small apps …

Member Avatar for TahoeSands
0
172
Member Avatar for PerplexedB

VB2008 won't let me drag my lblBase class from the toolbox onto a form in design mode. Why? Is there a way around this? [CODE]Public Class lblBase Inherits System.Windows.Forms.Label 'Public Sub New() 'MyBase.new() ' Me.BackColor = Me.Parent.BackColor 'End Sub End Clas[/CODE]

Member Avatar for JJCollins
0
131
Member Avatar for Garrett2011

Is there any way to inline just some selective calls to a particular function not all of them? by function I also mean class operators like assignment operator, constructors like copy constructor. The only form I know is declaring function as such at beginning and that's supposed to effect all …

Member Avatar for Narue
0
155
Member Avatar for solitaryy

So I have designed my program but am stuck on one function. [I]The following is an excerpt from my class:[/I] [CODE] public class SqrXY { public void SqrXY (double x, double y) { xaxis = x; yaxis = y; } public double addition () { //this is what I am …

Member Avatar for solitaryy
0
124
Member Avatar for doctorjo5

I'm having trouble figuring out a few different methods that I'm putting into a constructor. Any chance for advice? I'm having trouble with the last 3 near the bottom. I want to compare two name variable to each other to see if they are the same regardless of case, then …

Member Avatar for NormR1
0
204
Member Avatar for bspace

Hi, I'm trying to learn OOP, and I've run into a problem. I am supposed to have the user create a user name, and then I'm supposed to import a list of movies for the user to rate. I created a class called Movie. The function within is supposed to …

Member Avatar for bspace
0
257
Member Avatar for d87c

Just a little homework I have to do. Using OOP approach. Retrieve a data pass it to array then sort it(bubble sort) and then display in the right order like the follow. But im stuck on the bubble sorting part. Can anyone help? following code is right below Thanks so …

Member Avatar for mshauny
0
110
Member Avatar for Rikard

Hallo! I've been having some trouble getting a save/load function to work properly. I'm trying to save object and their properties to a file in binary using fstream. And then being able to load the object from the binary file the next time im running my project. Quick breakdown: I …

Member Avatar for Rikard
0
214
Member Avatar for lecofr

I am new at VB2008.net. I am trying to convert a program that I wrote in 2003.net for a dot.net class to now utilize OOP. The program basically computes the moment at increments along the length of the beam (1ft.) and the incremental total moment from the sum of several …

0
35
Member Avatar for liran ritkop

Hi I want to build some objects that have a little difference between them. But i wonder how would i do it - 1. build a class with some variables and build objects out of him, or - 2.build class for each object, with the functions dedicated to this 'only …

Member Avatar for mike_2000_17
0
128
Member Avatar for qazplm114477

Is it possible to pass arrays into a function and/or return an array from a function? I think it's possible but I don't really know how to go about it. lets say I have a function that returns a bunch of field from a database ex: [CODE]function a($sql){ $result = …

Member Avatar for qazplm114477
0
87
Member Avatar for daniel955

I'm Daniel, a Chinese living in the Philippines currently 3rd year Computer Science. and has no experience in developing software. I know how OOP works and basic programming in C#, Java create simple website with ASP.net with C#, SQL server and MySQL

Member Avatar for daniel955
0
64
Member Avatar for aviavyne

Hello It's me again, some might have seen a similar string, and it is probably because it is the same, but with a different problem. The following shows a program which uses a function that converts Fahrenheit into Celsius. The problem is that a person can enter any value they …

Member Avatar for NathanOliver
0
200
Member Avatar for Pado

Hi all, I've finally gotten a handle on object-oriented programming (it took ages), and I really like it. But I'm still struggling with conceptualizing some things. For example, if I want to make a form using objects, do I make a Form class with a method like startFORM($name_of_action_page, $method), then …

Member Avatar for Stefano Mtangoo
0
180
Member Avatar for Mouche

I'm working on a tasklist program to brush up on my C before I take a class. I have two structs, task and tasklist. Here is the task struct: [CODE] typedef struct task { char name[100]; bool completed; /* bool is described as an enum in an included header file …

Member Avatar for abhimanipal
0
151
Member Avatar for TahoeSands

I am writing a Java application that "passively" interacts with a Windows Desktop Application. What I mean when I say that it interacts "passively" is that I perform screen captures to determine the location of "buttons" displayed by this Desktop Application and I use "absolute" x and y coordinates to …

Member Avatar for TahoeSands
0
542
Member Avatar for Triztian

Hi everyone hope you can help me with this issue, I'm trying to make a login system that is object oriented so I have the following classes: [INDENT] [LIST] [*]MySQLDB: Peforms all database operations, adding/removing members, checking passwords and usernames, also performing querys. [*]Session: Performs Session actions(log in/out, keeping track …

Member Avatar for Stefano Mtangoo
0
297
Member Avatar for Takeshi91k

This is my first post here on Daniweb and I intend to do things right. I actually did read the "READ THIS FIRST" thread and instead of posting 500 lines of code I whipped up a test program I aptly titled test.cpp First I will walk you through my problem. …

Member Avatar for Takeshi91k
1
139
Member Avatar for kimiko

Just started learning java and i'm having a little trouble with my compiling im supposed to give a screen shots of my outputs if it works but vista is blocking it (asks for permission and then just hangs) ive included the questions just in case its being bleh but it …

Member Avatar for jon.kiparsky
0
247
Member Avatar for medopunsher

Hello Everyone , I'am new to OOP and QT and i'm trying to write a simple chat program (client , server) with winsockets. I Have an error which i don't seem to understand : this is my code so far : [CODE] #include "pmessenger.h" #include "ui_pmessenger.h" #include <QMessageBox> #include <winsock2.h> …

Member Avatar for Stefano Mtangoo
0
115
Member Avatar for Jamesbch

Hello everyone, I've found out that the [I]friend[/I] keyword can be used with a class or a function/method but I'm wondering if it's possible to do something like this : [CODE=C++]class A; class B; class A { private: friend class B void AddEl(void *el); friend class B void RemEl(void *el); …

Member Avatar for Fbody
0
122
Member Avatar for lytnus

I have a design question which I have not been able to find a satisfactory answer for by searching. Essentially, I have a class - Base - that contains a vector of pointers to another class - Node. However, I would like to be able extend both the Base and …

Member Avatar for lytnus
0
292
Member Avatar for Xufyan
Member Avatar for BboyRodimus

I got stuck at this error: [B]cannot find symbol symbol: variable BankAddress location: class Bank bankAddress = BankAddress;[/B] [COLOR="Red"]<------pointing at BankAddress;[/COLOR] I'm trying to instantiate an object of Address, calling the constructor of the Address class to create an object of Address. I'll post both classes, Bank and Address [B]Address …

Member Avatar for coil
0
143
Member Avatar for BboyRodimus

Here's the prompt guys: Assignment #4 will be the construction of 2 new classes and a driver program (the class containing a main method). [B]Address class[/B] The Address class describes cpu of a bank. It has following attributes: Attribute name Attribute type Description city String the city of the bank …

Member Avatar for NormR1
0
279
Member Avatar for newprimitive

Hello, In OOP PHP, i got 2 classes: Database and News. In News class i call DB function and get result (multidimensional 2D array). Now i have to display that array in index.php. I call News class (lets say get_news() function) from index.php but cant retrieve data and always get …

Member Avatar for Stefano Mtangoo
0
155

The End.