462 Topics
| |
Please help me how can i creat a class and use in windows application for Studen Result card .[COLOR="red"]I want type below code in class and want to use in windows application for student Grade [/COLOR] [CODE] private string MethodGrade(float Avrage) { string Grade; if (Avrage > 91) { Grade … | |
[COLOR="Green"]Trying to take input from user, put it in array and do the sorting[/COLOR] The code is: [CODE] #include <stdio.h> #include <conio.h> #include <stdlib.h> class Sort { static int array[5]; static int index; static int i; public: void insert(int num) { array[index] = num; index++; } int sortarr(const void *x, … | |
Firstly, apologies for the lack of commenting, it will be commented when the program works properly (lol), I'm creating a program which creates a test harness for 3 subjects, employees. This will display their name, ID and payrate per hour, it will then calculates the total amount in 37.5hours. Again, … | |
Hi, I am writing a program to solve the 8puzzle, but for some reason i am having more difficulty with the structure than the algorithm.... I have two classes, a tree and node class. My main problem is to put the nodes in an array in the tree class. Second, … | |
So simple problem. I need to have a division by zero validation in my constructor in this class. It is painfully simple, but I am just starting to learn classes and I just cannot figure out what I have to do. Would it be easier to just put the validation … | |
Hey, was wandering if somebody could help we with some classes and objects, I haven't done c# in a while and i can't remember. Could someone tell me what String falls under in c#, ie allowing one to write somthing like [CODE] static void Main(string[] args) { string s = … | |
Hey guys i'll show the code first then explain my problem: [code=c] Class A { /*Variables required by A, B, C and D */ /*functions required by B and C*/ }; Class B { /*some of it's own functions and variables*/ }; Class C { /*some of it's own functions … | |
Hi I am trying to put quicksort in my class like other methods and call it using the main method, I did it for Selection, Insertion, Bubble Sort and I need one more which is quicksort. I already made the calling code for quicksort but I don't know how to … | |
Hello everyone, I am having some problems with my code and allowing it to do what I want. I need within main to have the account balance from my class to be allowed to change value through "transactions" adding negative numbers for a withdraw and positive numbers to put in … | |
I am learning c++ now and have encountered a problem in trying to create single digit addition, multiplication and subtraction math questions. The numbers used in the questions are randomly generated from 1 to 9 and when I try to print the answer for the corresponding question, I get a … | |
I'm running a structural analysis program in VS2010 which iterates through a loop up to 4000 times. The program keeps breaking on me around the 960th loop and gives the following error Unhandled exception at 0x0040cd1d in Structural Analysis Program.exe: 0xC000005: Access violation writing location 0x00000000. The error seems to … | |
Here's the scenario: I am coding a program that will display data from a database in a variety of fields. Some of the fields need to be read-only. Should have been simple just to set all those controls to read-only, except some of them are checkboxes, radio buttons and date … | |
I have a class Matrix2D where the matrix is defined as vector<double> elements. I'm trying to use the function Gauss() to perform gaussian elimination on a matrix a [CODE]bool Gauss(Matrix2D& a) { [INDENT][/INDENT]//Gaussian elimination routine }[/CODE] The function itselt works perfectly and if I view the matrix a just before … | |
Hi, I'm writing a program for structural engineers that consists of a number of inherited classes. Specifically, I have a main() file which includes a class [I]element[/I] which includes a class [I]node[/I] which includes a class [I]matrix[/I]. [I]element[/I] includes variables of type [I]matrix[/I] and [I]node[/I], and [I]node[/I] includes variables of … | |
Hi all, I am creating an application that includes and calls upon someone else's code. I need to slightly change the functionality of a constructor in their code but the class I need to change is buried away very deep. I considered inheriting from the class so I could change … | |
i hv made it sorry for the disturbance | |
I need a few helps for some things that I just cannot get the syntax of! (I need these, and if you don't believe me I can post the reason) 1) Creating a function within a function 2) Creating a class within a function 3) Declaring a template function outside … | |
Not my code but I think free to share. This is intended as beginning point of learning classes or learning data structures. Read the document [url]http://mcsp.wartburg.edu/zelle/python/python-first.html[/url] As first exercise, this does not work instead of the while loop in test part: [CODE] for i in numbers: print i [/CODE] [QUOTE] … | |
Hi! I have a question regarding a problem I've faced dealing with object oriented PHP. I'm used to always return a value after a method has been executed and then use the returned value in other methods. But that's because I've always done that in procedural programming. So I wonder … | |
I need to be able to loop and get information for up to 10 "BankAccount" arrays, but when I use less than 10 it gives me garbage and I don't know how to fix it. Here is my Code. [CODE]#include <iostream> #include <iomanip> using namespace std; class BankAccount { private: … | |
Hello, I am having some troubles with coding from one of Joyce Farrell's books here is a link showing the exact thing to which I am trying to figure out. [URL="http://books.google.com/books?id=akzWMS9_PYoC&lpg=PA327&dq=BankAccount%20Class%20from%20Joyce%20Farrell&pg=PA331#v=onepage&q&f=false"]Exact question[/URL] Here is the code I have written thus far. [CODE]#include <iostream> #include <iomanip> using namespace std; class BankAccount … | |
I am having problems accessing a variable from one class to another. [CODE] class Player(pygame.sprite.Sprite): def rotateShip(self, rotAmt): radians = self.rotation * math.pi / 180 [/CODE] I am trying to use the variable radians from class Player to another class. radians only exists in 'rotateShip'. Thanks for your help in … | |
Hi, I'm trying to make a program that will write to a file and tell it that the next time that the program is run to not do the first part of the program. [CODE] fstream install; //this is what all of the tutorials say to do. install.open(ready.txt); //this is … | |
I am working on making a 'safetype' abstract class, which will have a complete set of pure virtual operator overloads to help make sure that a class inherited from it is safe to pass to virtual any function. The problem is that I don't know the syntax of a pure … | |
Basically this program uses an abstract class which 3 other classes extends to so that in the end an overridden toString() method will print out how many pages must be read for each class. Okay, well this program is for a class, but I am kinda of stuck because my … | |
| Hi, I am writing a program that allows to keep track of some racing records and to do this I need to be able to save objects on a external file and then load them with next startup of the program. As I am just a beginner I need your … |
Hey Guys, I have the following code: [CODE] class A { int a,b; A(int i,int j) { a=i; b=j; } void showab() { System.out.println(a+" and "+b); } } class B extends A { int k=20; void showabk() { System.out.println("a="+a); System.out.println("b="+b); System.out.println("k="+k); } } class Test { public static void main(String … | |
Hi, I am working on a piece of OOP which needs to be ran entirely by classes, by that meaning the main function should only create the first class and the rest of the program ran by member functions of various classes. Part of this task requires me to keep … | |
I have a problem with using globals within class scope. For example: [ICODE] $GLOBALS['test'] = "How are you?"; class great { [INDENT]function grace() { [INDENT] echo $test; echo $GLOBALS['test']; [/INDENT]} [/INDENT]} [/ICODE] Problem is, that neither of the echos produce any output. Is there a problem with accessing superglobals from … | |
I am in a distributed education programming class, our most recent assignment has me stumped with a error that is driving me insane. The IDE I have on my personal computer is missing some of the libraries I need(I believe), and when I remote desktop to my school's computer and … |
The End.