34 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for NoobCoder85

Here is my code: ` #include <iostream> #include <iomanip> #include <string> using namespace std; class Register { //Private members private: //Creating an array for all the Prices static double Price[]; //Declaring RegNUM and RecNUM int RegNUM, RecNUM; //Print out Item name in a loop static string items[]; //Creates a Receipt …

Member Avatar for David W
0
368
Member Avatar for NoobCoder85

The tools Hal’s sells are: Hammers: $10.99 Wrenches: $10.99 Levels: $19.99 Tape Measures: $4.99 Screwdrivers: $8.99 In order to make things easier in the long run you have decided to make a c++ program that takes in all the orders for each register and tallies them at the end of …

Member Avatar for NoobCoder85
0
1K
Member Avatar for Pyler

I can serialize an object if it's class definition has attributes. So if I have an object whose class does not have attributes, do I serialize the attributes importedi in it's class definition? For example; suppose I have the following class, #ifndef BREAD_H #define BREAD_H #include "EGGS.h"; #include "FLOUR.h"; class …

Member Avatar for mike_2000_17
0
274
Member Avatar for AbstractEden

One of my assignments, that I already turned in, dealt with collecting a student's name and gpa, and storing the information in an array. Afterwards, we were asked to display the student's information in descending order based on their gpa. I was curious if anyone has any suggestions on improving …

Member Avatar for stultuske
0
4K
Member Avatar for CoilFyzx

Oh boy They ust be tired of me now. My trouble: I have two ArrayLists of custom classes. ``ArrayList<Subject>` **a**` ``ArrayList<Student>` **b**` Within those custom classes are other custom classes which themselves have primitive data types as well as an ArrayList of other custom classes. It's a big circus going …

Member Avatar for JamesCherrill
0
562
Member Avatar for salford6129

Okay, so my hurdle here is to Serialize a list that has a bunch of objects in them, write them to a file, and be able to open the file to load the list of objects back into a listbox. I've read the MSDN articles and browsed some Forums, but …

Member Avatar for salford6129
0
197
Member Avatar for utchia

hi i have been working on my project to create a store and i have to add items and sell items, and once i add items i store them into a textfile separated by commas, and i made the add item button work perfectly but i am having trouble with …

Member Avatar for Majestics
0
576
Member Avatar for phfilly

Hi I have trouble with implementing a dynamic two dimensional pointer array on allocating memory for it. I tried it this way but not sure if it's correct. The array should contain pointers to heap allocated **Integer** objects const int size = 10; Integer *** twoD; twoD = new Integer**(); …

Member Avatar for Ancient Dragon
0
321
Member Avatar for Yoink

Hi, I had an assignment where we had to fox a program and get it working correctly. I fixed 99% of the problems and the program runs correct. The only thing that is wrong is my insertionSort() method. It runs correctly, but in the wrong order. Currently its listing names …

Member Avatar for Yoink
0
3K
Member Avatar for rahul.ch

class Account { Long accNum, pwd} public class Banker { public static void main(String r[]) { new Banker().go(); // do more stuff } void go() { Account a1 = new Account(); a1.accNum = new Long("1024"); Account a2 = a1; Account a3 = a2; a3.pwd = a1.accNum.longValue(); a2.pwd = 4455L; } …

Member Avatar for rahul.ch
0
232
Member Avatar for Geli19

Hello Everyone. I am having trouble creating new objects in a loop. I am using: DataType *Ptr = new DataType (); I use this in the beggining of the loop then end the loop with: delete Ptr; Each constructor and destructor gets called each time the loop is executed.... but …

Member Avatar for Geli19
0
5K
Member Avatar for Pyler

Do you need to implement a class in order for an object to access the class's functions/methods? When should you implement a class? When shouldn't you?

Member Avatar for rubberman
0
338
Member Avatar for Pyler

I wanted to write a simple program that uses classes but I've been running into errors. Anyone have a clue as to what is wrong with my code because I can't seem to figure it out. #include <iostream> #include <iomanip> #include <cmath> using namespace std; class cone{ private: double radius; …

Member Avatar for Rashakil Fol
0
248
Member Avatar for gabrielcastillo

How do i get value from this return? Im looking to get the value of 2. array 79 => object(stdClass)[356] public 'parent' => int 8 public 'type' => string 'meta' (length=4) public 'name' => string 'limitcounter' (length=12) public 'value' => string '2' (length=1)

Member Avatar for gabrielcastillo
0
180
Member Avatar for DEAD TERMINATOR

I'm working on a music player and I want to make it so that if I'm playing a song and I click on another song in the list the first song stops before I hit play on the second one, without having to manually stop the first. So just the …

Member Avatar for DEAD TERMINATOR
0
2K
Member Avatar for phummon

Hi everyone, I'm a moderate-level C++ programmer who is a little rusty at the moment. I've got an object question which is driving me nuts. I'm sure this is a C++ 101 level question, but for the life of me, I can't recall the solution. Basically, I've got one object …

Member Avatar for phummon
0
254
Member Avatar for diafol

Hi all, been dipping my toe into OOP and am getting on OK, but I'm hitting a bit of a wall with a current project. classes: db (a PDO extended class) User Timetable The db is just a few shorthand ways of running PDO The User is just for handling …

Member Avatar for diafol
0
210
Member Avatar for denvious

Hello All, I'm currently having an issue trying to retrieve elements that have been saved within my arraylist. I currently have two classes, Project and Staff. In the Project class, i have declared an ArrayList of type [i]staff[/i], as seen below: [CODE]public static ArrayList<Staff> staff = new ArrayList<Staff>();[/CODE] In the …

Member Avatar for denvious
0
9K
Member Avatar for karlamadeus

Hello all. I am trying to write a short little game, mainly to boost my knowledge of classes and objects, and of course I am starting to encounter problems. I have several classes for different types of creatures in this game. Most of them take the form of: [CODE] class …

Member Avatar for griswolf
0
224
Member Avatar for 24x24

My assignment: develop a limited application to track the statistics of sports players. For each player, track first and last name, points scored, assists made, and penalty rate. Design and implement an object capable of recording this info. Implement this object as Player. Must allow user to enter new player …

Member Avatar for yancouto
0
210
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 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 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
199
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 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
133
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 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 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
259
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

The End.