462 Topics
| |
So, I'm writing a roguelike game in C++. But, its complaining about a class I made called "Player" in the file "player.h" in the file "monster". When I input into monster this function: [CODE] void attackplayer(Player& hero, bool checkup, bool checkdown, bool checkleft, bool checkright) { if (checkup == true … | |
Hello, I have a question on how to use a class similar to the Grid Class included in the Lawerence Press textbook on C++. The question is, do I have to have the InitGrid function in every paint or no? | |
I have an issue where my content has two different classes assigned to it: left and right. The left column is perfect, but the right column which holds my text begins at the bottom of the first column. Please look here for more: [URL="http://mgndesign.com/draft/"]http://mgndesign.com/draft/[/URL]. Feel free to look at the … | |
I have written two different classes that are in two different files one is LoadData.java and the other is csvReader.java both are in the same folder. In the class LoadData I try to use a public function in csvReader by calling csvReader.getData(), when I compile LoadData, which is after I … | |
Hi, I am working on assignments that deal with Generics in java. I have a class Movie that have a String name variable. However I have to add a few more properties to Movie objects like Release year and Director name. So I created an Inventory class that uses the … | |
This class when, it is not integrated with the main program, shows the following error....and I have no idea what it is trying to say.. :( :( [code] #include "character.h" Character::Character(DrawEngine *de, int s_index, float x, float y, int lives, char up_key, char down_key, char left_key, char right_key) : Sprite(de, … | |
G'day, Just a simple question. Does MySQL Support Inheritance? I understand that both Oracle and PostgreSQL support Inheritance, but haven't seen anything in MySQL regarding this. Regards, TC | |
Hi, im still pretty new to PHP and I have just started looking into classes / functions and OOP - I have done loads of searching and watching tutorials and learning from others here on daniweb with great pleasure, I was hoping that someone could fix the problem im having … | |
I need to code a program for my friend and it has been giving me some difficulties. This needs to have two classes, one called Tester and another called Game. And the data in the Game class needs to be pulled to the tester class after the calculations are finished. … | |
Hi, I'm having trouble with my Java code. It's meant to read in from a csv file and update the elements on the GUI to reflect this e.g. as it reads in one line, images and text appear on the GUI reflecting the data. Anyway, to get the GUI to … | |
Hello, I would like to know if you know any framework/classes for systems administration in windows/linux environment. Thanks for you replies! Bye, Marco. | |
Hi I found this example on about.com . I understand most of this, but one part is giving me problems in genral. I tried classes before, and it did not go over so well. But since this is someone else code, it might be better than mine :). Thanks [CODE] … | |
hey guys/gals. i get a segmentation fault whenever the for loop in the print function is executed. any suggestions? im not sure what i did wrong. [CODE]//class member functions #include "experiment.h" #include <iostream> #include <fstream> #include <cstdlib> #include <iomanip> using namespace std; int Experiment::numberOfTests = 0; Experiment::Experiment(){} void Experiment::setExpName() { … | |
Hi, I'm supposed to create a program where I want to purchase tickets to a theater based on rows and columns of the seats. The program uses two-dimensional arrays and constructors, and is supposed to display somethine like this: "ASU Gammage Theater 1. View available seats 2. Request tickets 3. … | |
Hey guys. This is an assignment I've been given by my professor for a C++ course. The assignment description is below: [COLOR="Green"]Create a class ThreeDShape that has a default constructor and pure virtual functions double getSurfaceArea(), double getVolume() and void print(). Function getSurfaceArea() should compute and return the surface area … | |
Hi, just a quick question (i hope!!), i'm working on an assignment where i need to build a user-defined library of shapes. The class structure is to have "shape" as a base-class with both 2d and 3d shapes as derived classes. I've handled this by storing them in a vector … | |
| Hi Everybody, I have succeeded in parsing the values I needed from a text file and storing them in an array. The script I've posted works as a function, but now I tried to put it in a class and I can't figure out how to define the constructor. The … |
[CODE]#include <iostream.h> #include <fstream.h> #include <stdlib.h> #include <string> using namespace std; //const int MAX_SIZE = 10; //char determine_grade(int smarks); class student{ public: student(); //constructor ~student(); //destructor //char grade; //set values void set_mark(int); void set_id(string); void print_students_records(student, int); //get values int get_mark(); string get_id(); private: int mark; string id; }; //void … | |
[code=C++]#include (iostream.hpp) class Stocks { public: Stocks( int price); ~Stocks(); int get_price() const {return pps;} int set_price() const {pps;} int the_price_is (int pps); int pps; } int main() { Stocks AMX (35) cout << " Hello, please enter a symbol.\n"; if cin>> AMX; cin.ignore; cin.get; AMX.the_price_is cout<<" 35.\n"; return 0; … | |
I'm having troubles with a code for a program (involving classes) where I am supposed to input the three sides of a triangle and the program determines whether the triangle is a right triangle, equilateral, isosceles, and scalene, etc. I have only one error preventing me from compiling my program, … | |
What I need to do is using classes, design an online address book to keep track of the names, address, phone numbers, and birthdays of family members. The program should be able to handle a maximum of 500 entries. a. Define the class Address that can store a street address, … | |
hi in my drive file this is what my constructor looks like. im passing an array to it the constructor so that i can assign it to set[num]. what i want to know is what would this look like in the header file? drive-file: [CODE]IntegerSet::IntegerSet( int a[]) { for ( … | |
I need to design a class to represent an oven control unit containing: - Three constants (COOK, BOIL, SELF_CLEANING) with values of 1, 2, & 3. - Boolean value 'on' to represent oven is on or off - Int value for cooking temp, actual temp, and cook time (in min) … | |
The code below is the file for the constructor method and the get methods [code] //Date: 3/18/2010 public class Taxpayer { private int socSec; private double yearlyGross; public Taxpayer(int taxPayer, double income) { socSec = taxPayer; yearlyGross = income; } public int getSocSec() { return socSec; } public double getYearlyGross() … | |
Hi all, I have a list of Classes and I want to sort the list of Class by one of the Attributes held within the Classes does anyone know a easy way of doing this. Kind Regards FlippA | |
Good evening Daniweb, I have another idiotic problem which comes from making an arrival subclass out of Event. I have a few other subclasses of Event and they aren't giving me any trouble. I have tried to copy/paste/rewrite to eliminate any stupid typos. Arrival.h:7: error: expected class-name before ‘{’ token … | |
Hi, I've got a problem with a program that boils down to strange behavior by the vector container class. It seems to not want to call constructors enough but calls destructors too many times: [CODE] #include <vector> #include <iostream> using std::cout; int constructor_count=1,destructor_count=1; class obj{public: obj(){ cout<<"C: "<<constructor_count++<<'\n'; } ~obj(){ … | |
Hi, i have a problem, i am using a library given by my university to create a game, these are my classes and cpp files, and i am getting this error: error C2512: 'Board' : no appropriate default constructor available, pls help. [code] class Board { protected: GWindow &Gwin; int … | |
I'm working on this program. There are 3 classes. These two classes [COLOR="Red"]PassengerMenu and SecurityMenu[/COLOR] are inherited from the class [COLOR="Green"]MainMenu[/COLOR] So the main menu would provide the logo and a description (normal cout). Also an access to either the passnger menu or the security menu. according to your choice. … | |
Hello again DaniWeb! I'm designing a dynamic website in PHP, and it's structured so that each page creates the necessary objects (based on what content is being viewed) which get the right information to display. Smarty then organizes this content and makes it look good. The problem is, I have … |
The End.