1,089 Topics
![]() | |
Hi Can any one tell me how to call a subclass method from a superclass? For example: I have a class A,B and C. Now B and C extends A. So is there any way that we can call a method of B in A? Thanks Abhishek | |
I'm new to OOP php and I am trying to load objects into an array. I followed the syntax I found [URL="http://www.daniweb.com/web-development/php/threads/286967"]here[/URL] and it works but only for the first object :sad: Here is the code i am using for the class [ICODE] class category { // Variables var $id, … | |
[CODE]#include <iostream> using namespace std; class X{ public: int p; }; int main(){ int b; X obj; int X::*ptr = &X::p; obj.p = 100; cout<<obj.p<<endl; cout<<ptr<<endl; cout<<obj.*ptr<<endl; system("pause"); return 0; }[/CODE] When i run this program, i get the output as: 100 1 100. I understand why it shows 100...but … | |
Hello guys well I have been working in this arraylist that is now driving me crazy! Bascially I wrote a CAR class which has some methods in it, however now I created an arraylist so it could store cars from the other class and at the same time have access … | |
guys I've been trying to write this lab for my comp sci class for three days now. i've got to the point where it compiles but when I try to run it a table pops up that's says there's an error somewhere in the program that causes it to abort. … | |
I have a function that takes a reference to an interface class as a parameter. I have created a derived class from the interface class, but when I try to call the function with an instance of my derived class as an argument I get a compiler error saying "error: … | |
Guys ,, i want help regarding the career path of the SAP ,, I'm certified SQL Server development and administration and some skills like (c#, OOP concepts) , now ... one of my friends give me advice to learn sap ,, i've choices one of them is go for ABAP … | |
Hi everybody, I am learning c++, i tried to learn java but it seams hard. do you personally think that learning c++ will make me understand OOP in a bad way ? Is it better to learn c++ before java or vice versa ? Is java slower than c++ (Some … | |
Hi am trying to write a program and its giving me this error "cannot instantiate abstract class", can someone help me please? this is the code: Header: [CODE]#ifndef ABSTRACTGEOMETRICOBJECT_H #define ABSTRACTGEOMETRICOBJECT_H #include <string> using namespace std; class GeometricObject { public: GeometricObject(); GeometricObject(string color, bool filled); public: string getColor(); void setColor(string … | |
Hi all new to this forum, just thought i'd post in here because i am having a bit of trouble with an assignment... basically i have this class in a header file called Product.h... [CODE] class Product { private: int _id; unsigned int _price; public: }; [/CODE] I access this … | |
Hi, I have a basic understanding of C++ and was creating something myself with a class of 6 integers and a string what I want to do is to be able to find the mode values for each of the six integers and strings I have instantiated a set of … | |
I have been teaching myself algorithms and I am stuck with the AlphaBeta AI algorithm. I want to test my knowledge of it with a TicTacToe simulation. The thing is I want it to be easy to modify for any two player game and I cannot figure out how to … | |
Please tell me deeply about classes and objects My Question are: What is class? Why we use class? How can we use class? what do help class? Please tell me and also tell how can I learn about class? | |
Hi, I've got a problem with my project. When I initialize an arraylist, the content is displayed and you can go through the arraylist by correctly answering the given word. But when I load a new arraylist from a file, the old arraylist is removed and the new one is … | |
Hello, I am having trouble forwarding ports. I am using Asus RT-N56U router. Tried to forward many random ports but when I check canyouseeme.org it says "Connection refused". My windows firewall is off. Don't have any other. I also tried forwarding ports on my older router DGL-4100, but no luck. … | |
Hello everybody I [I]thought[/I] I understood inheritance but it turns out I don't. I am creating an SDL/OpenGL mini-GUI library. I have a master class, GUIComponent, with subclasses such as TextLabel under it. I have a vector called guiList that is initialized as [ICODE]std::vector<GUIUnit*> guiList[/ICODE] (it's extern'd and initialized elsewhere; … | |
Hi community First I want to thank everyone who will look through this, because it's a longer post. I'm currently reading a book on AI by Mat Buckland. I'm re-building Mats entitymanager, though I just copied it. He used std::map to collect all entities as pointers which are cross referenced … | |
Hi, networking is new to me in vb.net as I normally use third party components to do my networking like Winsock Orcas. However I want to make my own classes for networking. The following is what I have so far. It has problems. 1) Its disorganized...particularly the way I'm multi-threading, … | |
Hay every one Hay everyone I need help I have project in subject programming languages about make one idea on two languages c and java . I have made it in java and c++ but I couldn't in c This is the code in C++ [CODE]// Link.cpp : Defines the … | |
Hay everyone I need help I have project in subject programming languages about make one idea on two languages c and java . I have made it in java but I couldn't in c this is the code in java [CODE] Class Link // Link.java // to run this program: … | |
Hello, I'm working on a game, and for this game, I created a class. There is one object of this class for each player in the game: [CODE]class PlayerClass { public: PlayerClass(Nationality); // Constructor ~PlayerClass(); // Destructor sf::Sprite PlayerFeet; sf::Sprite Arms; sf::Sprite Body; sf::Sprite Head; int HitPoints; GameClass CurrentClass; }; … | |
Hi, i am doing a multiple-file project and i come across a difficult obstacles. I want your help, DaniWeb readers on this problem, which i find very strange: [CODE] #include "stdafx.h"//i have included vector header here #include "globals.h" #include "functions.h" using namespace std; #ifndef CPIECE #define CPIECE class CPiece { … | |
trying to connect a product class to the main class but i am getting errors i don't understand.like C:\Users\Juanelle\Documents\OOP Final Project\Order Process.java:36: cannot find symbol symbol constructor Product(java.lang.String,double) location: class Product Product product1 = new Product("Roses", 50.00); and in the error message the arrow is pointing at the n in … | |
Hi! I'm making a console game with cars. I am stuck trying to make the enemy car approach. If you have any thoughts or ideas, let me know! I'm thinking of using classes, but i dont know how to make them :) Is this legal? It probably isn't but here … | |
I am having problems with my program to add and multiply two 4 bit binary numbers. The part in which I am currently having trouble is when I run the program the output for the addition function is not correct. Instead of displaying the correct answer it is just displaying … | |
this project is an order processing prograam for a flower shop Orders are checked to see how the payment is to be made. Orders may be prepaid or, if the customer has a good credit line, they must be invoiced. Credit must be refused if the customer has paid late … | |
i have the server and client system. my problem is how the server enable to retrieve the client's bandwidth usage. i have the codes for bandwidth, but i am not sure how to do it because i confuse what extra codes should add in my client public partial class and … | |
Hi!! my application have 2 frames including tabel 1,tabel 2 when run time i insert values though textfileds to tabel 1 ,after inserting 5 or more then i click next button then display other frame with tabel 2 and tabel 2 must auto filled. my problm is last row(i already … | |
Suppose the xMethod() is invoked in the following constructor in a class, xMethod() is _________ in the class. public MyClass() { xMethod(); } A. a static method B. an instance method C. a static method or an instance method what is the answer a or b or c | |
I'm writing an application launcher program. The launcher will launch applications based on the files found in the working directory. (Example: a folder containing files with the extensions .docx, .xlsx, .sln, and .txt, would give the user the option to launch Word, Excel, Visual Studio and Notepad loading any of … | |
A question regarding inheritance implementation. Let's say we have 2 classes: [CODE]class B { public: int x; // for the sake of argument it's public, don't stone me }; class D: public B { public: int x; // again x, i know ... stupid dilemma };[/CODE] Now, if you will … | |
My code is posted below along with it's output of errors. [CODE] #include <iostream> #include <fstream> #include <string> using namespace std; class Node { public: string name; Node* north; Node* south; Node* east; Node* west; }; class MazeConstructor { private: Node nodes[12]; public: Node* ConstructMaze(); }; Node* MazeConstructor::ConstructMaze() { nodes[0] … | |
Hello, it's me with oop again, So now I understand what are oop and how to use it, but I have 2 questions: [1] - How to use controllers models views libs [2] - Is there any tutorial on how to create a cms using oop even if I should … | |
Hello This year I am taking OOP as a core course and I am starting with C#.. So my first code to accomplish is to make an array of information about different types of cars.. In a brief.. It consists of 2 forms, The first form is where the user … | |
Hello, I wrote a hangman game but it won't output what the user entered. At the beginning the display array is filled with underscores and as the user enters letters it is supposed to get updated with their input, but it isn't updating. Can someone please tell me what I'm … | |
[CODE]#include <iostream> using namespace std; class bike { public: bike () { cout << "Bike: no parameters\n"; } bike (int a) { cout << "Bike: int parameter\n"; } void color(int a,int b) { cout<<"Inside Bike Color"<<endl; } }; class ducati : public bike { public: ducati (int a) { cout … | |
I've tried searching for articles that relate to this issue, but all I keep finding are articles about people who don't know how to define constructors/can't call the parent constructor/etc and I think this will cut straight to the chase. The problem code is as follows: [CODE] #include <stdio.h> class … | |
Ok So Im writing a app which would pick the 'cheapest' plan for a consumer. While writing this I came across something puzzling to me. Why is it starting after the default constructor, the first CellPlan has three arguments passed too it and then the next one two and then … | |
HI. I want to dig deep into PHP and OOP so I have been told that Zend is a very popular framework so I want to learn . Can you give me some (not many) resources for learning the beginning Zend and step by step go deep into it ? | |
Good day, I'm trying to build an online quiz for my website. i want to do it oop style but i'm having problems in certain areas but i'll need help. this is the class code [CODE]class Quiz{ // method to get the questions and answers public function getQuestion(){ $host="localhost"; // … | |
Hello all, I'm trying to inherit a "CarPanel" I created using arrays to draw various shapes in order to make a car. Now I am trying to essentially create a subclass that inherits that class, but add a Timer Action to move the car across the screen. I got it … | |
Hi all, I have a main GUI class as seen here: [CODE] import java.awt.*; import javax.swing.*; import javax.swing.border.*; /* * Class is to communicate with various other classes in the program to * create a roster for user based on their selection on GUI. */ public class MainGUI extends JFrame … | |
Hi everyone! When i compile my small piece of code it gives me the error [COLOR="Red"]C2512 : No appropriate default constructor available[/COLOR] this is my definition of class person: [CODE] // Person.h // A class defining a person #pragma once #include <iostream> #include <string> #include <functional> using std::cout; using std::endl; … | |
I made a code(test1.cpp) from an existing code of a game (ramble_shuffle.cpp) using classes...but the code gets stuck somewhere...Iam unable to find the fault...can some1 find please...the code hangs up.... Original game code : shuffle_game.cpp my code : test1.cpp | |
Hello Everyone , I`m trying to build MVC pattern using OOP PHP , please read the rest of the post to understand what I want exactly This is the homepage controller which extends the main controller [CODE]class Home extends Controller { function __construct () { parent::__construct(); } public function index … | |
Ok So I have to create a Date Class that will allow me to return the current day with data members of month , day, and year this is what I have for from my Main() class: [CODE]using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace DateApp2 { class DateApp … | |
I'm really confused at the moment. I'm not looking for anyone to give me the answers, but if you could at least give hints on what i need to do in each method, i'll be happy!! FYI, one of the main things that's confusing me is that i'm not allowed … | |
Hello - I am a student who bis mid-semester in an OOP course, with zero programming experience. I am trying to understand the concepts but this stuff is tough....I have an increased level of respect for all of the developers out there! Here is my question..in the code i am … | |
Hello, i need some help with code, i need to be able to print something that function returns then i press button on panel1 it should return text to panel2 textctrl in wxpython. Here is some bit of code.(i just cut code that i think is needed for this) [CODE] … | |
Hello I can't understand OOP in python I am looking to good tutorial , i am looking to good tutorial , about OOP in python from zero Thank you |
The End.