97 Topics

Member Avatar for
Member Avatar for Brianbc

Working with some OOP, I had an error that I have now traced to inistantiation of a class when the file in which the class is contained is included in any other file. Is this the default/normal behaviour of php, and how do I get myself out of this? I …

Member Avatar for Brianbc
0
107
Member Avatar for benny2010

The header file [code=c] #ifndef DRAUGHTS2_H #define DRAUGHTS2_H #include <SFML\Graphics.hpp> #include "TwoPlayerGame.h" #include <iostream> enum state{intro, playing, gameover}; //the states found within the game enum squareValue{green, red, blank}; //the draught square values on the board class Input { public: Input(); void setInput(unsigned int,unsigned int); unsigned int getX(); unsigned int getY(); …

Member Avatar for benny2010
0
270
Member Avatar for aligajani

Hi. I have this code but I want it to store the same data and function using objects. However, I would like to also know how to get information from the objects in an ArrayList. Currently the information is stored directly without the using of objects. I also want to …

Member Avatar for Eric Cute
0
167
Member Avatar for CanYouHandstand

Hi All I've been working on a program that automates a test sequence for testing a product before it is sent to the user. The program controls 12 test stations. There is an object that controls the interactions with each station (12 instances total). One of the challenges of the …

Member Avatar for Wolfgan
0
125
Member Avatar for Swedenrock

Hi! When I print the six card I would like the "player" to be able to pick three out of these cards. Does anyone know how to do this? Do I create a new list and then append the cards to that list? Very thankful for any help! Here's the …

Member Avatar for woooee
0
215
Member Avatar for brandonrunyon

I have a class "Homework" that has a private attribute "int time" and I have set up a + operator to add the times of two Object instances. I have also created a Template "sum(T a, T b)" that takes two arguments and adds them together. I'm having difficulty using …

Member Avatar for brandonrunyon
0
255
Member Avatar for Andy_Parr

Hi, I'm writing code for a graphical map of a shopping center. Whilst writing the code I realised it would be simpler to be able to draw objects using "names" instead of values. E.g. g.drawRect(Asda); instead of g.drawRect(100,100,40,40);. Is this possible? I have tried writing various classes but I can't …

Member Avatar for JamesCherrill
0
579
Member Avatar for Xufyan

I've create a program for the array of objects, here is the code..! [CODE]import java.io.*; class Student{ int rollno; String name; public void setValues (int rollno, String name){ this.rollno = rollno; this.name = name; } public Student getValues(){ Student s = new Student(); s.rollno=this.rollno; s.name=this.name; return s; } } class …

Member Avatar for NormR1
0
228
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
200
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
124
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
177
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
134
Member Avatar for Derkus

So, this might be simple but I seem to be missing it. I am trying to figure out how to use variables to define which object to update. I could of course use a case statement to pick the object based on a variable, but it seems to me like …

Member Avatar for trpsjt2008
0
158
Member Avatar for TahoeSands

I am working on an application in Java and for part of my plan I would like to have an object (eventually an array of these objects) where I could store two or three (I am not sure yet) varied types of data, for instance... A BufferedImage and a string …

Member Avatar for JamesCherrill
0
954
Member Avatar for mahdir24

I'm working on a project from school - airline reservation system. I have a slight problem. I created a class time and another class aircraft. In the class aircraft i have created two private data members of the type time - atime, dtime. Now why does the compiler flag an …

Member Avatar for mahdir24
0
134
Member Avatar for amishraa

[B]Create a project that contains a Pet class. Each object will contain pet name, animal type, breed and color. The form should contain text boxes to enter the information for the pets. A button or menu item should display the pet information on a separate form. Hint: Use a ReadOnly …

Member Avatar for amishraa
0
294
Member Avatar for seanvitalaim

Can someone please explain to me why I cannot move variables from object to object. I've been getting no sleep and burning myself out learning java and it is driving me crazy here is the example. [CODE]import static java.lang.System.out; class ONE { public static void main(String[] args) { TWO addition …

Member Avatar for NormR1
0
97
Member Avatar for mloC

I was wondering how one would go about creating a structure that cannot be used by itself, i.e. only through a wrapper class. My question is what would be the syntax for this construct? I'm currently on a personal project to make simple tests from old tests, all the questions …

Member Avatar for mloC
0
110
Member Avatar for i-teq

Whilst having 20+yrs in IT I'm brand new to Python programming... I'm trying to reference an object in a different class as a lookup... I have a class which describes items and their prices I have a class which describes a currency code and a conversion rate I'm trying to …

Member Avatar for i-teq
0
4K
Member Avatar for adrianniebla

I have three classes one which is class User contains information about users name, last area code etc.... and it must implement Comparable but receiving generic parameters. Another one is a custom doubleLinkedList which basically has a link to the right and one to the left and contains a generic …

Member Avatar for JamesCherrill
0
203
Member Avatar for pickleleon

This is my very first thread on the net period, I'll do my best to describe my c# problem. I was wondering if there is any way of calling upon general event trigger objects (referring to buttons, picture box etc.) on a whole, for example is there a keyword that …

Member Avatar for pickleleon
0
260
Member Avatar for smkdude

Hello, I am currently trying to write a board game, and I am having trouble making each GameTile on the board access the same Point on the board. Each GameTile contains a certain number of Points, and sometimes Points overlap(the Point on a corner of one tile may be the …

Member Avatar for smkdude
1
164
Member Avatar for pateldeep454

[B]Card.java[/B] [CODE] package poker; public class Card { int suit; int rank; public Card () { suit = 0; rank = 0; } public Card (int s, int r) { suit = s; rank = r; } public int getSuit () { return suit; } public int getRank () { …

Member Avatar for javaAddict
0
203
Member Avatar for lifeworks

Hi I think what Im trying to do is possible, just not sure how... On a button click - Ive created an object, with some properties in it. If I want to access those properties when clicking another button... how do I do that? [code] function build() { var circ …

Member Avatar for Airshow
0
103
Member Avatar for 0xbadcode

Hello mates, I want to dig deeper on WebBrowser Control programming, I searched in Microsoft's MSDN for advanced WebBrowser Control, But I didn't find the one that I want to take-up, It's about Converting Web Objects to its own type, let's say Flash Embed object to type of Flash will …

0
136
Member Avatar for lanilonzo

Hi All, I am working on adding additional functionality to an existing legacy code. In that code, I have a function which returns a pointer to an object of a parent class. I know that this object is actually a subclass of the parent class, and would like to access …

Member Avatar for StuXYZ
0
83
Member Avatar for TheWolverine

Hi all, I am just getting into the world of OOP and I'm not totally sure in what situations it's better to use objects and when it's simpler to just revert to arrays. For example, I am currently re-writing a bit of scientific code written in C that simulates the …

Member Avatar for TheWolverine
0
164
Member Avatar for Gadgetman_53

Hi, I am new to Java, but have been programming in C++ for a few years now. I am working on a project where I have to write a class to implement a gameboard. To do so, I'm using a 2D array of objects. I have a method that swaps …

Member Avatar for Gadgetman_53
0
282
Member Avatar for SpyrosMet

I was wondering if [CODE] *pntr.age = 19;[/CODE] is valid considering that pntr is a pointer to an object that has age as a varible. If it is valid, can it be used with an array of pointers to objects? if yes can i get an example please? thank you.

Member Avatar for mrnutty
0
99
Member Avatar for feoperro

Hi, I have pasted my code below, please paste it into a JSP and tell me why it gives the error "Unterminated String Constant" [CODE] <html> <head> <title>Debugging</title> <script language="javascript"> function changeOn(object, objectId) { alert('in function'); if (object == 'bookingsButton') { alert('first if'); document.getElementById(objectId).src = 'Images/BookingsOn.png'; } else if (object …

Member Avatar for feoperro
0
199

The End.