43,549 Solved Topics
Remove Filter ![]() | |
When i run main it prints out gibberish not sure why. main.cpp [CODE] #include <iostream> #include <string> #include "phrase.h" #include "EA.h" #include <cstdlib> #include <time.h> int main() { phrase a; EA b; std::string phrase; int populationsize; std::cout<<"enter a population size\n"; std::cin>>populationsize; std::cin.ignore(); b.setpopulationsize(populationsize); std::cout<<"enter a string\n"; getline(std::cin,phrase); a.setphraselength(phrase); b.setlength(phrase); std::cout<<"the … Software Development c++ | |
pls help me with this problem......its for my exam for finals...pls help me.... here are the instructions: Create a Class of the ff: (focus on payroll) 1. EmployeePay (parent) define: attribute: salary(net), gross, rate, no of hours worked, tax=20% constructor: (2) method: setters/getters, reset()-set number of hours work to 0 … Software Development java | |
i am making a high score table for my whack a mole game. variable Score on frmGame is [CODE]Public score as integer[/CODE] then in frmHighScore table i have [CODE]Dim numbers As Integer numbers = frmGame.score[/CODE] however variable Numbers comes back as a empty variable for some reason. Help? thanks Software Development visual-basic | |
I am trying to create a double pointer. never done it before. Problem is currently in intializepopulation(); Error C2106 left of operand must be l-value. EA.h [CODE] #ifndef EA_H_INCLUDED #define EA_H_INCLUDED #include <string> #include "phrase.h" #include <iostream> class EA:public phrase { public: EA(); ~EA(); void setgenerationnumber(int generationnumber); int getgenerationnumber(); void … | |
Hi, I am trying to write to a .txt file an integer but the characters I see when I open the file are strange. Could you tell me what happens ?? [CODE] import java.io.*; public class A { public static int readInt() { byte b[] = new byte[16]; String str; … Software Development java | |
its it skipping. This is the part of the code. :( cout<<"enter a string\n"; getline(std::cin,phrase); [CODE]#include <iostream> #include <string> #include "phrase.h" #include "EA.h" #include <cstdlib> #include <time.h> int main() { phrase a; EA b; std::string phrase; int populationsize; //int percentmutation; std::cout<<"enter a population size\n"; std::cin>>populationsize; b.setpopulationsize(populationsize); //std::cout<<"enter the percentage you … Software Development c++ | |
UnboundLocalError: local variable 'gold' referenced before assignment ...[CODE]if chooseItem == "1": gold, arrows, whip, cannnonballs, heartPotions, megaHeartPotion, infinityPotion, infinityXPotion, duelBloodXXHealer, bloodXHeal, energyYPotion, basicRainbowHealer = bloodXHealerZZ.buy(gold, arrows, whip, cannnonballs, heartPotions, megaHeartPotion, infinityPotion, infinityXPotion, duelBloodXXHealer, bloodXHeal, energyYPotion, basicRainbowHealer)[/CODE] Software Development python | |
Okay, I think I know the problem, but I don't know how to solve it. I want to write a binary file with raw bytes. Windows appears to interpret 10 as ASCII 10 and it does its thing where it interprets 10 as '\n' and decides to change that to … Software Development c | |
I'm making an archery game and I need to shoot 5 arrows and assign a point value to each spot of the target. Bulls eye is worth 9 and each ring out from there is worth 2 less. I am having trouble figuring out how to assign a score to … | |
just need some advice on making a list containing values for Tkinter buttons. thankyou :) | |
Hello all, I have a few questions about C++ (I have programmed quite a bit in VBA and some in the past using C++, and have been working through relearning C++). Currently I am working through a bit on the "Char" variable type. regarding the following (from the FAQ): * … Software Development c++ | |
I have been searching around the internet for a few questions I have on the List<T> class with no success. 1. how do you edit the last item in your list 2. how do you edit a specific items value, every time i do it says you cannot edit a … Software Development | |
I'm in the process of reworking a bit field that I built to condense a collection of rule activation flags for a game I'm working on. I need to change the "multiplierRule" so that it can represent 2 different variations of the same rule as well as an "inactive" state. … Software Development c++ | |
Hi all, I am trying to learn the basic concept about array, however when I tried to change the type into string, it shows error .. I am using IDE visual studio 2005 [CODE]#include <iostream> #include <string> using namespace std; int main() { string stName[20]; cout << "what is your … Software Development c++ ide visual-basic visual-studio | |
Hi there! I am working on a simple text based console application for a game of battleship. I am not really looking for a raw code just ideas on where to go next with my code. Some things i would like to put in it that I am flat out … Software Development c | |
Guys I'm having a problem which is really annoying me .. I'm trying to change a normal class into a template class, but every time I try to do that I get a bunch of problems with the object of that class and the template : let's say I have … Software Development c++ | |
Hello, I'm writing a simple version of the message digest algorithm. In our version we get a string, translated to its decimal value. We need to tackle 8 characters per loop. I'm having problems with the implementation of the loop. I have a DD which stores the size of the … | |
Hi @ all, b4 things get serious. :icon_smile: Im using MFC with VCPP 6. I have a simple dialoge based app. Im using a triggered event with which I want to update the content of a CEdit box. The ASSERT of IsWindow fails because m_hWind = 0, I figure this … Software Development c++ gui windows-api | |
Hi all. I am doing a project with visual basic 2008, i'm using c++ windows form. i have a question about the code for this particular button, where i wan tis button click to be link to another folder. For example, when clicking this button [btnDownload], it will open the … Software Development c++ visual-basic | |
Hi all, Im currently doing an assignment where we have been told to write a program to input 2 values (namely the area of wallspace to be painted & the price of the paint) & then output several other values based on the values input. At this point I'm writing … | |
I am not getting the correct output for this method. I have looked at the BigInteger class, and even tried to implement, after rewriting for my instance variable, but it did not carry the numbers over to the next digit, or bring down the remainders. Thanks in advance. [CODE] public … Software Development java | |
Hey Narue! I need ur help on a upper-lower case switch problem.. Read the contents of a text file (using ifstream class).. and create a new file or edit the same one (using ofstream class) to switch the case of each char (upper to lower & vice versa).. Thanks a … | |
Can anyone explain whats wrong with this program why this is not working. [CODE] void main(void) { long a,b=1; clrscr (); printf ("Enter number to calculate its factorial:"); scanf ("%ld",&a); if (a=0,1) printf ("You entered 0 or 1"); else for (a=a;a>0;a--) { b*=a; } printf ("Answer is %ld",b); getch (); … Software Development c | |
Hi, everybody. I've started learning about recursion, but I'm having a hard time completely understanding it. I've tried to write a simple recursive function that returns the sum of the series m(i) = (1/3) + (2/5) + (3/7) + (4/9) + ... (i / (2i + 1)), but I keep … Software Development c++ | |
ive got a xml file like this: [CODE] <?xml version="1.0"?> <orders> <customer> <order_num>6656</order_num> <name>jon doe</name> <street>123 fake st</street> <city>Beverly Hills</city> <state>CA</state> <zip>90210</zip> </customer> <customer> <order_num>1337</order_num> <name>bob johnson</name> <street>1232 something ave</street> <city>Petaluma</city> <state>CA</state> <zip>94952</zip> </customer> <customer> <order_num>5643</order_num> <name>bill story</name> <street>1st ave</street> <city>Beverly Hills</city> <state>CA</state> <zip>90212</zip> </customer> <customer> <order_num>4533</order_num> <name>tom hutchinson</name> <street>214 … | |
Hey everyone. I am new to java and I am stuck in this program. I am getting error messages and cannot figure out why. On public class Rectangle I am getting error messages on lines 84, and 85. On RectangleTest line 12. Thank you all in advance for and guidance … Software Development java | |
i am trying to connect to mysql database using java. I have done connecting to microsoft access before. and i modified my code to connect to mysql server locally. i think the problem is I don't really understand where my mysql database is. anybody may point out the problem would … Software Development java microsoft-access mysql | |
i have a client server and i send data perfectly to the client its when the client wants to send or update data which is the problem. what i am trying to do is check to see if the object that is passed to the server has a id and … Software Development client-server java | |
Hey guys, I'm mostly done with this but need a little help with multiplication and the output. (Just outputting +'s) [CODE]#include<iostream> using namespace std; class Polynomial { friend ostream &operator<<(ostream&, Polynomial&); private: int degree; int coefficient[10]; public: Polynomial(int, int[]); Polynomial operator+(Polynomial&); Polynomial operator-(Polynomial&); Polynomial operator*(Polynomial); }; Polynomial::Polynomial(int d, int c[]) … Software Development c++ | |
Hi, I am new to programming. As an absolute newbie, I downloaded codeblocks and wrote my first programme i.e. Hello World. But when I hit F9 key of my keyboard, the programme didn't run. Can someone guide me as to how a programme is run after writting it in the … Software Development c++ | |
Trying to raise an event in an ActiveX control from a module (.bas file). Been trying to create a timer control that will go past the 1 minute limit of the vb6 timer.ocx. The Windows API SetTimer will do this. But wanted to create an Active X timer control that … Software Development api visual-basic windows-api | |
Hello there. Finally decided to make an account here :) Anyways, I just started trying to implement function pointers in my code, and I seem to be having a few issues. (this is, of course, test code): [CODE] #include <iostream> using namespace std; class MyClass; class SomeClass { public: SomeClass(); … Software Development c++ | |
Sub CalculateStorageCharge() Dim datedue, datecollected As Date Dim daysoverdue As Integer Dim storagechargetotal As Integer Dim storagechargefeeperday As Integer = 5.0 daysoverdue = DateDiff("d", datedue, datecollected) If (daysoverdue) > 0 Then storagechargetotal = (storagechargefeeperday * daysoverdue) Else : storagechargetotal = (0 * storagechargefeeperday) End If storagechargetotal = CInt(txtStorageChargeFee.Text) End Sub … Software Development vb.net | |
I have a CSV file where fields are delimited with a comma. The fields of this CSV file contains the attributes of Permanent Survey Marks and I’ve created a GIS python script to convert it to a table that is stored it in our Enterprise GIS Spatial Database (SQL Server). … Software Development python | |
Hi, im trying to call this method in my class "MyWidget" which is suppose to draw a line when someone indicates the coordinates via 4 parameters. Here is the method: [CODE]public void Connect(int xline, int yline, int nextX, int nextY) { Graphics g = getGraphics(); g.drawLine(xline, yline, nextX, nextY); } … | |
I need help with trying to convert a String of number to a Integer Array. I will then be adding the to Arrays together like any addition problem, but I am having trouble with just getting the string in to the arrays without it outputting jargon. [CODE] public static int[] … Software Development java | |
I was starting a cash register program. I got to the point of a simple test. I ran into a problem where when running the loop to input my variables, it completely blows through the loop the first time. I looks like this: Product: Product: ---------now I could input [CODE]#include … | |
Hi, Basically I have a game type scenario in which objects are falling from the sky onto uneven terrain below but my problem is this: I can't figure out how to determine when an object has actually collided with a slope (the point of impact) because obviously the y value … Software Development c++ | |
Im trying to figure out how i will calculate items needed. for example for every 500 sqft of space, one gallon of paint and 8 hours of labor is required. how will i put that n to a formula Software Development c++ | |
Hi again. I have a file that have about 1000 lines, and then, time by time I need to read some of this lines, for example: 13:00:00 read lines 01 to 100; 13:30 read lines 101 to 400; .... 15:00:00 read lines 900 to 1000. There is a way to … Software Development c file-system | |
hi guys, this is my first post to the forum although i do use this website regularly for help. now i have a problem with my code for a sorting program i am making. basically the program is used to make a random number list and then you should be … Software Development c | |
Hello. First of all I'd like to say HI to everyone. I've recently joined this community and this is my first post. I have a class called Numerical Calculus where the assignments often require the input and representation in a GUI of various matrices. So I've been looking for ways … Software Development display gui matrix-multiplication | |
Okay, i have an 8X8 grid, i want to use control arrays to create labels instead of creating each manually so that it is less repetitive code and easier to control when i try to switch the colors of each label on the gird. [CODE=c#]namespace app1 { partial class Form1 … Software Development | |
Alright, this is for a project designed to make us use inheritance. This is Creature, which is a subclass of Thing. Creature is supposed to be able to eat, move and tell what it ate. Here are my issues: 1. How do I use a constructor from Thing in Creature? … Software Development java | |
hi.im facing an error that says 'syntax error in FROM clause'.i dont know where i went wrong because it used to run smoothly.from my research about this error,it seems each solution is unique,it doesnt relate to what im doing.can anyone please help?here are my codes: [code] Private Sub Cmd_Login_Click() Adodc1.RecordSource … Software Development visual-basic | |
Hi, I was looking at this tutorial: [URL="http://linuxgazette.net/77/krishnakumar.html"]http://linuxgazette.net/77/krishnakumar.html[/URL] There's an instruction there that says "seg es", my question is whats this instruction in AT&T style? I'm trying to rewrite the code in AT&T syntax and use it with gcc/ld but it gives me an error: "kernel.s:6: Error: no such instruction: … Software Development assembly | |
Hi Guys, Is it possible to add a string to a list using a static method or am i really misunderstanding this? This is what i'm trying... [CODE]using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace LDAPNOCISCO { class STOREUDPs { private … Software Development | |
Hello all, I just bought a book on Python, and started to go through it (bought it for my children and myself). I'm having a problem importing 'easygui'. I am new to programming. I am trying to program on my Mac. I downloaded easygui to the following:/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/ When I go … Software Development python | |
[B]MyClass.h[/B][CODE]class MyClass { //... public: template <class T> static void Swap(T& Var1, T& Var2); //... }[/CODE] [B]MyClass.cpp[/B][CODE]template <class T> void MyClass::Swap( T& Var1, T& Var2 ) { Var1 ^= Var2; Var2 ^= Var1; Var1 ^= Var2; }[/CODE] In another file[CODE]#include "MyClass.h" //... int n = 40; int m = 60; … Software Development c++ | |
Hi All, I have got the multiline textbox in the picturebox. I want to save the whole picture into a bmp file (including the multiline textbox). Is there any easy way to do it? what I have done at the moment is: pic.currentx = textbox.left pic.currenty = textbox.top pic.print textbox.text … Software Development visual-basic |
The End.