43,549 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for cblue

i'm trying to write a program that takes two numbers from the user prints out the sequence between the 2 numbers and then outputs wthe longest sequence for example if the user inputed 8 and 10 it should out put 8 4 2 1 9 28 14 7 22 11 …

Software Development c++
Member Avatar for WolfPack
0
795
Member Avatar for Mouche

Another program. This one has you guess 5 letters and then gives you the word you're trying to guess as masked by -'s and has the letters you've guessed filled in. Ex: Say the word is "computer." If you guess "r," "s," "e," "a," and "m." It would say: [CODE] …

Software Development python
Member Avatar for vegaseat
0
10K
Member Avatar for mattyd

Hello: I am having a bit of problem with logic in a segment (marked in [B][COLOR="Blue"]blue[/COLOR][/B]) of this code: the indicated code should simply update the variable upon each pass of the function as it runs; the variable value maxes out at 456-- it will not increase by 228 beyond …

Software Development c++
Member Avatar for mattyd
0
148
Member Avatar for n.aggel

hi, sorry if this is a stupid question, i am a total newbie:) i want to dynamically allocate an object to a pointer and i write: [code=c++] class_test *ptr = new class_test(); [/code] [code=c++] class_test *ptr = new class_test; [/code] both of them compile:confused:....are they the same thing{meaning that the …

Software Development c++
Member Avatar for ~s.o.s~
0
202
Member Avatar for aidi.morini

[COLOR=#808080]Hi, [/COLOR] [COLOR=#808080]I’ve written a Windows application in Visual Studio .NET using C++. The main window of my application is a dialog window. I need to display a Save File Dialog window when one of the buttons on my main window is clicked. But my main window is a dialog …

Software Development c++ visual-studio
Member Avatar for Ancient Dragon
0
148
Member Avatar for DoubleShot

HELP! I am trying to write a database app with three tables. I have figured out how to connect to my database with oledbconnect. From there I am confused as to how to get a select command to work. I have found plenty of info on selecting data from one …

Software Development c# dataset
Member Avatar for Venjense
0
144
Member Avatar for Mouche

So, I'm trying to make a program that works with Newton's method. I want the program to take in two formulas and a guess and then follow this pattern. This is the pseudocode/python (I kinda did both): [code] [B]def[/B] newtonIterationFunction(x) [B]return[/B] x - (function1) / (function2) get function1 get function2 …

Software Development python
Member Avatar for Mouche
0
212
Member Avatar for MarkWalker84

Hi everyone. Would really just like someone to take a look at what ive done and tell me how many horrible faux-pas ive made :-) I'm trying to teach myself the language as im going along which is making it hard to conform to any standards. I know there are …

Software Development engineering os-x perl python
Member Avatar for bumsfeld
0
119
Member Avatar for n.aggel

if i write something like this it works: [code=c++] Person array_persons[10]; int age=0; for(int i=0; i<10; i++) { cout<<"give age : "<<i<<endl; cin>>age; array_persons[i].setAge(age); } [/code] but when i try to do it with pointers: [code=c++] Person *array_persons[10]; int age=0; for(int i=0; i<10; i++) { cout<<"- give age : "<<i<<endl; …

Software Development c++
Member Avatar for ~s.o.s~
0
94
Member Avatar for Barefootsanders

Hey guys. Ive been having problems with something. Im trying to load a picture and put random dots on a square part of that image. Right now I got it to put dots on the whole image but I cant seem to get it to just a certain section of …

Software Development
Member Avatar for Barefootsanders
0
150
Member Avatar for mattyd

I have come to point in my program where I have decided a static variable would be the best option. I am not very familiar with static variable use and have never implemented them often. The area of concern is highlighted in [COLOR=Red]red[/COLOR]: I am simply using a time function: …

Software Development c++ user-interface
Member Avatar for mattyd
0
110
Member Avatar for smallpau1

I am having trouble, i am trying to make a program read in 3 points and calculate the 3 things listed in the program, but i cant seem to get the sideA-C to get calculated out without overloading the sqrt function. The functions given above main have to be used …

Software Development c++
Member Avatar for smallpau1
0
227
Member Avatar for ffire

Hey whats up im pretty new here and new to java. I have no idea when it comes to methods. (this is my first java course so im completly lost) I have a test coming up and Im just trying to review. We got a couple examples of things that …

Software Development java
Member Avatar for ffire
0
102
Member Avatar for kamitsin

Hi, Yesterday a friend of mine asked me about the use of $ at the end of the crontab command. His query is something like this. [B]15 3 * * * command [COLOR=red]$[/COLOR][/B] Can someone please help me with the use of $ at the end of this crontab command …

Software Development shell-scripting
Member Avatar for kamitsin
0
94
Member Avatar for mattyd

I have been looking at a small bit of code concerning the use of [B]static [/B]with variables; I thought I understood the use of [B]static[/B], but I find this code confusing: [code]//: C03:Static.cpp // Using a static variable in a function #include <iostream> using namespace std; void func() { static …

Software Development c++ pdf
Member Avatar for Salem
0
153
Member Avatar for sneekula

I have a file of sentences similar to this: [CODE] Tom ate his Apple. Frank shoveled Snow. Henry drove a Truck. [/CODE]I would like to prosess each sentence so it only retains the capital letter in the first word, every other word in the senetnce should be lower case. The …

Software Development apple python
Member Avatar for Mouche
0
122
Member Avatar for Mouche

So my idea for this program was to take data from a file and compiling it into a schedule type thing.... Comments? Again...for learning purposes, I'd love to see suggestions for content, efficiency, and techniques. [php] # Get data from schedules.txt import string f = open("schedules.txt","r") schedule_rawdata = f.readlines() f.close() …

Software Development python
Member Avatar for Mouche
0
193
Member Avatar for pachjo

I am trying to get to grips with treeviews in pygtk/gtk and am stuck on setting the alignment of the columns. No matter what I try I cannot change the alignment[IMG]http://ubuntuforums.org/images/smilies/eusa_wall.gif[/IMG] Here is the code I found on the web which I am using to change different lines to see …

Software Development python
Member Avatar for pachjo
0
190
Member Avatar for mattyd

I am incorporating clock_t into a current build; I need a simple way to measure time elapsed; it is not so important the source of elapsed (CPU) time or even its starting point (zero would be ideal, but it should not matter). I really just wish to understand the output …

Software Development c++
Member Avatar for WaltP
0
231
Member Avatar for tehloki

Hey, it's me again, with another problem on an assignment. The input/output looks like this: [I]Enter the wind speed on the Beaufort Scale: [COLOR=red]7[/COLOR] Enter the number of boats racing (1-10): [COLOR=red]7[/COLOR] Enter the code for boat 1: [COLOR=red]LASE[/COLOR] Enter the time for boat 1: [COLOR=red]29:41[/COLOR] Enter the code for …

Software Development c first-post
Member Avatar for tehloki
0
220
Member Avatar for boujibabe

I'm trying to find a way to convert a number in any given base to decimal and then to the target base. What i'm asking is how will I represent this procedure in the function for example 123 base 4 to decimal= 1x4^2+2x4^1+3x4^0=27. I was thinking of decrementing the raised …

Software Development c
Member Avatar for boujibabe
0
120
Member Avatar for linq

if I have three words in there lines in a .txt file, and I want to read them to three string, how to do this using c++ ifstream? how to read every line(word)?

Software Development c++
Member Avatar for WaltP
0
21K
Member Avatar for katharnakh

hi everyone......... I have a task, I have fragmented the task into subtask. I have planned to create a class to each subclass and one parent class to handle the sub tasks. Each subclass are saved in seperate file and all my subclasses and parent class are placed in the …

Software Development gui os-x python
Member Avatar for vegaseat
0
204
Member Avatar for JS1988

Quick question, what do i want to put in the while of my do while statement in myprintitle function so that will loop around with the main part as well. [CODE] include<iostream> #include<iomanip> using namespace std; int startDay(int , int ); int calcjan1(int, int ); void printMonth (int , int …

Software Development c++
Member Avatar for JS1988
0
130
Member Avatar for mattyd

Greetings: A simple question that has me stuck: Program runs, calls function, function runs... Return to Main? This last area is where it fails. No errors, just no control returned to Main.cpp at end of function run. I've been studying the code much and researching the solution on the Net …

Software Development c++
Member Avatar for mattyd
0
153
Member Avatar for mikki2

hi, i dont want it to seem like everytime i have a problem i come to this forum...but i just need to cover all bases b4 my exam in a month...thanks for understanding. my question is..is there any way to write the following program WITHOUT using a [inlinecode]while[/inlinecode] loop? i …

Software Development first-post java
Member Avatar for mikki2
0
156
Member Avatar for JS1988

can anyone tell me how to fix this, it needs to print out the calendar for a whole year. [CODE]#include<iostream> #include<iomanip> int startDay(int year, int calcjan1); int calcjan1(int year); void printMonth (int startDay, int days); int main() { char again; int year=0; do { cout<<"Enter a year for a calendar …

Software Development c++
Member Avatar for Nick Evan
0
119
Member Avatar for RichC

I have been trying to store the values of card face value into an array called faceValue but I don't know how to do this. I've created the array and placed in public in my h.file (char faceValue[5];) but trying to link it to *face in the function deal is …

Software Development c++
Member Avatar for Ancient Dragon
0
110
Member Avatar for noxee

Hi I'm trying to have an assignment operator for my linked list class so that when I call it, it replaces the current one with the one I pass in. i.e testList1 = testList2; I'm trying to get it so that testList1 will point to testList2. Here is the code …

Software Development c++ linked-list
Member Avatar for noxee
0
78
Member Avatar for noxee

I'm having a problem inserting data into my binary search tree, it will insert some of it but not all. this is the header file for my BST class: [code=c++] #ifndef BST_H #define BST_H //----------------------------------------------------------------------------------------- #include <string> #include "LinkedList.h" //----------------------------------------------------------------------------------------- using namespace std; //----------------------------------------------------------------------------------------- class BST { public: //Default constructor, …

Software Development c++ linked-list
Member Avatar for noxee
0
128
Member Avatar for mattyd

I am planning to implement [I]#include <time.h>[/I] in my program. I have never yet used this include. I will be using this in order to track a 24-hour period, or at least that is what I wish to do; I basically need to set up a natural 24-hour day that …

Software Development c++
Member Avatar for WolfPack
0
115
Member Avatar for mruane

Well, I actually succesfully completed my first complete program in python, and I didn't use the forum for help, I stuck it out and figured it out on my own. After spending about two and a half hours getting all these make shifts loops right, I feel pretty darn good …

Software Development python
Member Avatar for Mouche
0
114
Member Avatar for mruane

When using the Py2exe program snippet given in [URL="http://www.daniweb.com/code/snippet499.html"][COLOR=#800080]http://www.daniweb.com/code/snippet499.html[/COLOR][/URL] I get the following error message: Traceback (most recent call last): File "C:/Python24/hate me/p2e_test1.pyw", line 29, in -toplevel- console = [{"script": 'hateme2.pyw'}] ) File "C:\PYTHON24\lib\distutils\core.py", line 166, in setup raise SystemExit, "error: " + str(msg) SystemExit: error: command 'C:\PYTHON24\PYTHONW.EXE' failed with …

Software Development python
Member Avatar for mruane
0
148
Member Avatar for macca1111

Hi, I have created the following code to check a list and then determine which is true then update the variables associated with the correct if else statement. My problem is it doesn't update any of the variable even if true. As you can see, the var ch should be …

Software Development python
Member Avatar for vegaseat
0
136
Member Avatar for mikeallen

I'm trying to write a program that uses overloading of operators to perform operations (add, multiply, etc.). I've got the program done, but I'm having trouble modifying the driver I have to fit the program. The original program used a print method, and the new program uses overloading input and …

Software Development c++
Member Avatar for mikeallen
0
146
Member Avatar for mattyd

Hi, I am working on a fairly simple project (it will grow more in time as planned) but I am stuck in a spot which I cannot solve yet. The operation of this prog at this point is: [LIST] [*]Start. Ask user for input choice (only 1 choice available at …

Software Development c++
Member Avatar for ~s.o.s~
0
139
Member Avatar for king13

My program seems to be ignoring my cents after the decimal point for total_charge. It adds the dollar amounts, but ignores or does not see the cents. Can anyone give me suggestions as to what I need to look at? I'm brand new at coding, thus the reason for all …

Software Development c++ ios
Member Avatar for king13
0
112
Member Avatar for hui

//My function is but the problem is that i dont have a proper working main function void reverse(int a[], int n) { // function: Reverses the elements of a. // parameters: // a inout array of values. // n in number of values in a, a[0]..a[n-1] // returns: nothing for …

Software Development c++
Member Avatar for may4life
0
288
Member Avatar for JS1988

Does anyone know how to writea program to print 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 and so on until it is down to one. Anyone know how to right a function that …

Software Development c c# c++
Member Avatar for may4life
0
123
Member Avatar for Jonezy

Hey.. Names Jay.. I'm new around here.. Doin C++ and i'm a beginner programmer.. I have been going OK but i am stuck!! For this assessment i have to create a payroll system for a company.. The company must contain staffmembers.. There is a class for staffmembers.. Inheriting frmo this …

Software Development c++ first-post
Member Avatar for Jonezy
0
4K
Member Avatar for sneekula

I like to create a structure in Python, something like: [code]solvent_name boiling_point melting_point flash_point [/code]I need to search and sort this structure. How can I best do that?

Software Development python
Member Avatar for jbennet
0
232
Member Avatar for slash10

am beginner in C..am trying out some questions in books n i want to write a small encryption program that will encode a word..cn any1one help?i want to convert a character such as 'a' to the next character of the alphabet that is 'b'...how should i proceed?

Software Development c encryption
Member Avatar for neeven
0
177
Member Avatar for king13

Hello, I'm having issues with my final total for charges. When I run my program, it either comes up with "0" or if I don't declare my variable, it comes up with a long string of numbers. My total hours works great, but not my charges. Can someone take a …

Software Development c++ ios
Member Avatar for king13
0
994
Member Avatar for Gorilla

I have created a project using Jython (there was no bug in compling it by my IDE) I also have read the topic named [B]Py2exe help [/B](Ene Uran---Oct 23rd 2006 6:43 pm) and I can tell you that it really helped me so much. But in this project, I cannot …

Software Development ide java-swing python
Member Avatar for bumsfeld
0
179
Member Avatar for sneekula

Now I am looking for the best way to reverse the digits in an integer. For instance x = 12345 should become y = 54321.

Software Development python
Member Avatar for ghostdog74
0
466
Member Avatar for mruane

My fiance is having a birthday in less than 20 days. I am therefore trying to create a program for her (trust me, it is not intended to be the only gift) to play around with, and hopefully enjoy. The only problem I am having so far, is that when …

Software Development first-post gui python
Member Avatar for Mouche
0
312
Member Avatar for macca1111

Hi, I have a card class and deck class. The cards are in suitList rankList. I call the cards from a file cards.txt and split them into the above. I need to import the cards.txt and then shuffle them. I have the following code: def shuffle(self): import random nCards = …

Software Development python
Member Avatar for macca1111
0
183
Member Avatar for mruane

I am trying Vegaseat's suggestion in one of my threads to use shuffled lists for combat in my text adventure. He suggested creating two lists, myhit_list[1, 0, 2, 0, 3, 0, 0, 1] and monsterhit_list[1, 0, 2, 0, 3, 0, 0, 1] and using random.shuffle(myhit_list) and random.shuffle(monsterhit_list) iterated with "I …

Software Development python
Member Avatar for vegaseat
0
112
Member Avatar for katharnakh

Hi, I finding difficult to execute this program. The wx.Notebook i created is coming on the splitted frame(self.p2). How do I that. I am started to learn wxPython, and when I run the code, the code doesnot close gracefully, it throughs me an error. "pythonw.exe has encountered a problem and …

Software Development python
Member Avatar for vegaseat
0
144
Member Avatar for DarkFlash

Hey guys, I'm making a CMS for my website with python. I was wondering if anybody could give me some insight on (perhaps) an OS function that will copy a file from one folder and 'paste' it in another. thanks!:cheesy: Alright...I couldn't find anything as far as the os module …

Software Development cms python
Member Avatar for Ene Uran
0
94

The End.