462 Topics

Member Avatar for
Member Avatar for jeffjnsb

a C++ newbie here.. I am doing the question at the end of Ch3 which is about classes, objects, and constructors. I'm stuck on a few that asks you to write a C++ statement for each: (On 5, I wasn't sure how to give a value in the same statement.. …

Member Avatar for mrnutty
0
177
Member Avatar for Acegikmo

[B]This has been solved! Look at the end of this post.[/B] Hello! I'm having some trouble here with polymorphism, as I need to access methods in a subclass from an array of superclass objects. This method is called parseCommand(Command c); The method exists in the superclass and is overridden in …

Member Avatar for masijade
0
268
Member Avatar for Fbody

I just started an advanced C++ course and my instructor sent around a file with this piece of code: [code]class smallobj // specify a class { public: smallobj() : iData(0){} // Constructor smallobj(int iInValue) : iData(iInValue) {} // Overloaded Constructor ~smallobj() {} // Destructor void setdata(int d) // member function …

Member Avatar for Fbody
0
1K
Member Avatar for winecoding

How many constructor (including copy constructor) and destructors will be called for test1 and test2? [CODE]#include <iostream> using namespace std; class Base{ public: Base(){cout << "Base()" << endl;} Base(const Base&){cout << "Base(const Base&)" << endl;} ~Base(){cout << "~Base()" << endl;} }; Base func(Base b){return b;} void test(){ Base a; func(a); …

Member Avatar for Lawand
0
83
Member Avatar for fallopiano

Hi everyone. I'm currently working on a project with c#, and had some questions about classes. I'm a python programmer, so bear with me ;) How would I make a class that has pre defined arguments? I.e. even if the user doesn't pass that arguement, the default value of it …

Member Avatar for sknake
1
144
Member Avatar for 9w43

Hello, I am using Blue J, I have 3 classes, time, date and patient. When I run the patient class, I can put patient details like name, address, DoB, time. The time and date classes are separate classes, how can I store the date (int) and time which I enter …

Member Avatar for mellowmike
0
173
Member Avatar for ceileyg

Hey all - yes, this is another thread asking for some homework help, but I've got a solid start, just looking for some fresh ideas. Anyways, the task is to create a java clock class and access/use it from a driver. I saw something similar on here, but not quite …

Member Avatar for masijade
0
5K
Member Avatar for ninreznorgirl2

I've worked with making classes, but I've never had to use a class in code that I write, so I'm having a hard time. [CODE]#include <iostream> #include <string.h> #include <iomanip> #include <ctype.h> #include "String2.cpp" using namespace std; const int MAX_WORD_LENGTH = 254; // The type definition below permits much easier …

Member Avatar for u8sand
0
204
Member Avatar for Namibnat

I am sorry to ask such a beginner question: I am just learning to use classes and objects in php and would like to know one simple thing - how to you reference one function (or should I call them methods?) from another within the class. When I specify a …

Member Avatar for omoabobade
0
160
Member Avatar for ahmedshayan

1. Create a class Account that has following instance variables: a. private account number (string) b. private account holder name (string) c. private balance (floating-point) d. private account opening date (string) e. profitRate (final, floating-point): 5% for all accounts Supply a default constructor, a parameterized constructor, and a clone constructor. …

Member Avatar for javaAddict
0
782
Member Avatar for sleight

So, hi, this is my first post here. I can't find a good source for my problem here. My problem: Creating a linked node using classes. I managed to create a list of linked nodes but the problem was that I forgot to delete the nodes I created so now …

Member Avatar for sleight
0
198
Member Avatar for Lisa Hoover

Everyone is talking about how open source technology is the answer to budget cuts and belt tightening in the workplace. There's no denying its use is on the rise and, in fact, the Linux server market is predicted to extend into the tens of billions over the next few years. …

0
434

The End.