462 Topics

Member Avatar for
Member Avatar for qazplm114477

Is it possible to pass arrays into a function and/or return an array from a function? I think it's possible but I don't really know how to go about it. lets say I have a function that returns a bunch of field from a database ex: [CODE]function a($sql){ $result = …

Member Avatar for qazplm114477
0
85
Member Avatar for aviavyne

Hello It's me again, some might have seen a similar string, and it is probably because it is the same, but with a different problem. The following shows a program which uses a function that converts Fahrenheit into Celsius. The problem is that a person can enter any value they …

Member Avatar for NathanOliver
0
197
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
179
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
137
Member Avatar for kimiko

Just started learning java and i'm having a little trouble with my compiling im supposed to give a screen shots of my outputs if it works but vista is blocking it (asks for permission and then just hangs) ive included the questions just in case its being bleh but it …

Member Avatar for jon.kiparsky
0
236
Member Avatar for lytnus

I have a design question which I have not been able to find a satisfactory answer for by searching. Essentially, I have a class - Base - that contains a vector of pointers to another class - Node. However, I would like to be able extend both the Base and …

Member Avatar for lytnus
0
288
Member Avatar for Xufyan
Member Avatar for BboyRodimus

I got stuck at this error: [B]cannot find symbol symbol: variable BankAddress location: class Bank bankAddress = BankAddress;[/B] [COLOR="Red"]<------pointing at BankAddress;[/COLOR] I'm trying to instantiate an object of Address, calling the constructor of the Address class to create an object of Address. I'll post both classes, Bank and Address [B]Address …

Member Avatar for coil
0
142
Member Avatar for BboyRodimus

Here's the prompt guys: Assignment #4 will be the construction of 2 new classes and a driver program (the class containing a main method). [B]Address class[/B] The Address class describes cpu of a bank. It has following attributes: Attribute name Attribute type Description city String the city of the bank …

Member Avatar for NormR1
0
275
Member Avatar for BboyRodimus

I'm writing two classes for the main program code. I'm stuck trying to do figure out how to instantiate an object of the class Address: [B]Address class:[/B] [CODE]public class Address { private String city; private String state; public Address() { city = "?"; state = "?"; } public Address(String aCity, …

Member Avatar for sneaker
0
1K
Member Avatar for oscarp

Hi, I have a map of a base class object (not pointer to objects). I did this because I need to have inheritance from others types like this: Parameter RealParameter: Parameter IntParameter: Parameter ... My problem is that when I am going to insert in the map, copy constructur of …

Member Avatar for mike_2000_17
0
2K
Member Avatar for Xufyan

Is it possible to call a constructor if we entered know value in the output screen ??? example !! [CODE]import java.io.*; class Employee{ int num; static int count=0; float compensation; public void print(){ System.out.println ("Employee number: " + num + ", Employee Compensation: $" + compensation); } public Employee(){ num …

Member Avatar for group256
0
193
Member Avatar for Xufyan

I got to assignment first one was to print the data of two students using different classes and constructors and count the total numbers of records and i've done this. here is the program. [CODE]public class Student { int RollNo; String name; static int stdcount=0; public void print(){ System.out.println ("Roll …

Member Avatar for NormR1
0
835
Member Avatar for majestic0110

I just wanted to demonstrate a quick point regarding Constructors & inheritance. Look at these two classes and think about what you might expect to see after the main method has run. Notice that ClassB is a subclass (inherits from) of ClassA. So, what do we expect the output to …

Member Avatar for masijade
3
648
Member Avatar for jackabascal

It may seem like a simple answer, but how do I pass an image to a bitmaps constructor. for example: [CODE]Bitmap bmp = new Bitmap(########);[/CODE] what would I put in place of the pound signs If i wanted the default image to be C://Users/Me/Documents/Visual Studio 2010/Projects/MyProject/Image.jpg Please help.

Member Avatar for Geekitygeek
0
185
Member Avatar for crodriguez08

Hey there, I need some help with the placement of constructors and how the second constructor would work (there's two of them). All I ask is for some explanation. These are the exact instructions: The default Constructor should build a dynamic array of size 3 for the grades. Another constructor …

Member Avatar for crodriguez08
0
471
Member Avatar for Garrett2011

take following class and two object definitions: [CODE=c++] class Rect{ public: enum centimeter; enum meter; Rect(double len,double wid,enum centimeter){ length=(len/100); width=(wid/100); } Rect(int len,int wid,enum meter){ length=len; width=wid; } //rest of implementation private: double length;//in meters double width;//in meters }; Rect obj1(10,5,Rect::centimeter()); Rect obj2(10,5,Rect::meter());[/CODE] two previous constructors have dummy enum …

Member Avatar for Garrett2011
0
2K
Member Avatar for jagan605

I have recently learned in school about the dreaded diamond.And I wrote a program using virtual inheritance to overcome the problems.I use g++ and I have the following errors with this program, [CODE]//doing to create an illustration for dreaded diamond #include<iostream> using namespace std; class vehicle { public: virtual void …

Member Avatar for Fbody
0
554
Member Avatar for Garrett2011

take two following classes and their constructors as samples: [CODE=c++] class One{ public: One(int a,int b):adad1(a),adad2(b){} private: int adad1; int adad2; }; class Two{ public: Two(int input[]){ for (int i=0;i<10;i++) araye[i]=input[i]; } private: int araye[10]; };[/CODE] considering objects with static storage duration, I think first constructor can be applied during …

Member Avatar for Garrett2011
0
387
Member Avatar for Garrett2011

Suppose we have following two classes: [CODE=c++] class Temp{ public: char a; char b; }; class Final{ private: int a; char b; char c; public: Final(Temp in):b(in.a),c(in.b){} //rest of implementation };[/CODE] can we initialize an object of the Final class with following syntax in upcoming c++0x standard: [CODE=c++] Final obj(Temp{'a','b'});[/CODE]

Member Avatar for mike_2000_17
0
251
Member Avatar for adaniel058

I have tried to create a simple class where the program passes a name and telephone number to my class type and then prints it to the screen. It tells me I have undeclared identifiers, but I am constructing my program just like an example we did in class. Can …

Member Avatar for adaniel058
0
114
Member Avatar for aragmus

hi guys what constructors should i use for this program? [CODE]using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace BACKUPEXEFILES { public class cCOPY { private string _directorypath; private string _filename; public string directorypath { get { return _directorypath; } set { _directorypath = value; } } public string filename …

Member Avatar for k.d.m
0
127
Member Avatar for steaky1212

Hi, A bit of a tricky question, so I will try to explain everything in its fullest. I am trying to replicate some of the Terrarium work done by the Microsoft guys, but I dont want to look at any of their code. Anyway I have my base class which …

Member Avatar for nick.crane
0
204
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 pi_lord12

Ok, so I'm trying to make a constructor for a text-based game for a monster. Here is the code for it: [CODE]public class Methods { String name; //characteristics of monsters int bodyPoints, mindPoints, attack, defense; public Monster(String name, int bodyPoints, int mindPoints, int attack, int defense) { this.name=name; this.bodyPoints=bodyPoints; this.mindPoints=mindPoints; …

Member Avatar for pi_lord12
0
2K
Member Avatar for daudiam

[CODE]class A extends B { C ob1=new C(); D ob2=new D(); protected void finalize() { System.out.println("Finalizing A"); super.finalize(); } public static void main(String ss[]) { new A(); System.gc(); } }[/CODE] Though System,gc() doesn't guarantee the running of finalization, my question is if the JVM is able to run the finalizations …

Member Avatar for daudiam
0
287
Member Avatar for abhi74k

Why is the constructor called from top to bottom rather than bottom to top ????

Member Avatar for abhi74k
0
146
Member Avatar for zreed

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. …

Member Avatar for CrazyDieter
0
198
Member Avatar for dohpaz42

In a nutshell I am trying to write a program that will connect to a database, query several tables for various sets of data that will then be transformed into XML that is stored into a file on the local hard disk. My first thought process to solve this problem …

Member Avatar for dohpaz42
0
203
Member Avatar for vs.vaidyanathan

When i run this, i get an error message saying TYpe expected and it points to the line having a.drive(100)... Any help please? Newbie... [code] class Car { public Car(){ int odometer=0; System.out.println("Car constructed!"); } public void drive(int miles) { System.out.println("Driving....."); odometer+=miles; } public long odometer; } class Guzzler extends …

Member Avatar for NormR1
0
254

The End.