49,757 Topics

Member Avatar for
Member Avatar for henpecked1

I'm trying to construct a semi simple dice rolling project. I have two classes, onedie and threedice. The threedice class looks like this: [code] class threedice { public: void rollem(); int getsumFaces(); private: onedie die1; onedie die2; onedie die3; }; [/code] Now, when I try to code the two functions …

Member Avatar for vmanes
0
284
Member Avatar for TheFueley

I'm trying to figure out how to write an int (as a record number) and a string (up to 12 characters) into a binary file. So in one project the binary file is created with all 5 records written to it, with blank data, eg string is empty. In the …

Member Avatar for TheFueley
0
118
Member Avatar for Jboy05

After I Prompt the user to get an integer from the keyboard, display the number on screen if it is an even number how do I write the number into a file in A:\ drive under the name OddFile.txt. if its odd. [CODE=cplusplus] #include <iostream> #include <fstream> #include <cstdlib> using …

Member Avatar for Ancient Dragon
0
96
Member Avatar for complexcodes

Hi, I am trying to do my project but I am stuck. It looks like a big project but it is not. here is the question : I am given sample output of rectangles and some code. I need to add few free functions to make the outout like that …

Member Avatar for complexcodes
0
109
Member Avatar for cpp_noobsauce

Heres my code: [code]#include <cstdlib> #include <iostream> using namespace std; //Function prototypes char GetTaxCode(void); int GetProductId(void); int GetQuantity(void); float GetProductPrice(void); char InvoiceInitilization(void); int main(int argc, char *argv[]) { //Variable declarations float gSt = .01; float pSt = .02; int productId; int quantity; char taxCode; float taxAmt; float productPrice; int shippingFee …

Member Avatar for cpp_noobsauce
0
129
Member Avatar for ulyssesmn

I've tried use a program which is will work in sqrt(n),but it got TLE.,please help me [url]http://acm.pku.edu.cn/JudgeOnline/problem?id=1811[/url]

Member Avatar for vmanes
0
84
Member Avatar for big24fan

I just finished an exam that I bombed pretty hard. I just dont know where to begin on this stuff and would love some guidance. Below is the details of the exam. - Write a program that asks a user to enter their full name. Their name including spaces must …

Member Avatar for buddy1
0
161
Member Avatar for gothicmisery85

I'm seeming to have some difficulties with a few things. I don't quite know how to get my program to add interest and charges to the balance, and I keep getting the message in Borland C++ Builder 6, "Unresolved external 'Interest(int)' referenced from C:\Documents and Settings......etc etc." and I'm also …

Member Avatar for gothicmisery85
0
138
Member Avatar for knewc

Alright! I have to make a program that computes the n'th Fibonacci number, and then use it in a program to list the first 20 fibonacci numbers, the recursive definition of fibonacci numbers is: fibonacci(1) = 1 fibonacci(2) = 1 fibonacci(3) = Fibonacci(n-1)+Fibonacci(n-2), for n>2 then modify your program and …

Member Avatar for Ancient Dragon
0
81
Member Avatar for mar000m

hello all, so can any one help me with a code in c or c++ for radix sorting code for names.... i need this for an important project for my study....if any one can help by friday 21-march

Member Avatar for Ancient Dragon
0
51
Member Avatar for lostandconfuzed

Hi guys, I'm working on a program that has to do with Goldbach's second conjecture (any even number larger than 5 can be expressed as the sum of three prime numbers). I have to write a program that takes integer [I]n[/I] (larger than or equal to 6) and finds three …

Member Avatar for knewc
0
138
Member Avatar for Jennifer84

Is it possible to know what key on the keyboard that was pressed through any of these syntax in any way. [I]textBox->KeyPress textBox->KeyUp textBox->KeyDown[/I] I like to find an if statement that says something like this, though I know this is wrong: [code] if ( textBox-> KeyPress != BackSpace) { …

Member Avatar for Jennifer84
0
99
Member Avatar for SJin

Recently I've been trying to write a bit of code that will take a string, for example "This is a string", and returns the string with the contents in reverse order, such as "gnirts a si sihT". I'll only post the function that will do this. Currently, my idea is …

Member Avatar for Ancient Dragon
0
93
Member Avatar for 666kennedy

i have a formula, it is basically the result of two other previous calculations and it gives me an eror message saying that i cant use it as a function [CODE] ERRORC = (( target1 ) - ( OUTC ) )(OUTC)(1 - OUTC); [/CODE] target one is selected at the …

Member Avatar for Ancient Dragon
0
138
Member Avatar for TylerTCF

Thanks for your help earlier with the file input everyone...I have another question to ask of you. I am trying to check two vectors against each other to see if the "timeanddate" match up. Then try to output the ones that do match. I am getting errors from the if …

Member Avatar for mitrmkar
0
123
Member Avatar for Lensva

Say i ask a user to input a number, which will be the return value of one of my class members. How do i make it so that it would redirect me another class member, depending on the number input?

Member Avatar for Lensva
0
96
Member Avatar for Traicey

This program is using setw() and setfill() it supposed to output the stars I have included the sample output at the end of my project I hope u gona be able to read the code cause my coding does not print the stars the way they have to be instead …

Member Avatar for Narue
0
2K
Member Avatar for 666kennedy

firstly id like to thank people for helping me with my earlier problems. anyway, for this program im working on, i want the user to be able to select between two patterns. eg. pattern1 makes x=1 and y=0 pattern2 makes x=0 and y=0 i tried using if statements, but it …

Member Avatar for Narue
0
136
Member Avatar for Jboy05

Do you see anything wrong with this if so let me know [code=cplusplus] #include <iostream> #include <fstream> #include <cstdlib> using namespace std; int main () { int num; ifstream AFile; AFile.open('a:\\OddFile.txt'); AFile << "Enter an integer number please: "; cin >> num; If (num % 2 = 0) AFile << …

Member Avatar for Jboy05
0
141
Member Avatar for TylerTCF

Anyhelp with the ostringstream and datastream line would be appreciated. Can't seem to get the data to actually write to the text file...No data in results.txt, but the file is created by the program when I run it... [CODE] ofstream DataFile3("results.txt"); cout<<"Writing...Please wait...."<<endl; for (a=0; a<Search.size(); a++) { cout<<Search[a].date<<" "<<Search[a].time<<" …

Member Avatar for Narue
0
125
Member Avatar for Jennifer84

I have a wondering. I have put this code in the richTextBox1 event handler. What happens is when you have written 11 characters, the 10 previous characters turns blue. What I wonder is that this code selects and deselects these characters wich can result of "blinking" in the textbox sometimes …

Member Avatar for Jennifer84
0
94
Member Avatar for 666kennedy

this isnt working, i think it has something to do with the natural exponential, its a calculation of the sigmoid function. it basically should read 1/(1 + e^-((W1A*pix1)+(W2A*pix2))) this is what ive coded [CODE] OUTA = 1/(1 + exp -((W1A * pix1) + (W2A * pix2))); [/CODE] please help me.

Member Avatar for 666kennedy
0
245
Member Avatar for krichard89

For the code posted below, a hangman game, how would I make it so after the conditions in the loop are evaluated, it goes back and asks for another letter input without an infinite loop? [code=c++] // Kevin Richard // Hangman.cpp // Basic Hangman console game /* Changelog: -added char …

Member Avatar for Ancient Dragon
0
79
Member Avatar for TylerTCF

Need a recommendation on how to proceed with this task...I am starting new in C++ (after taking it in high school 11 years ago it has been forgotten and has changed alot). I have put the code I have below and some sample lines of data...any recommendations on how to …

Member Avatar for vijayan121
0
170
Member Avatar for sisi

Hello guys, I just join your site to get help about my coding programme class c++. I do have to modify my programme that the out put will show the form sum=1+3+5+7=16. Can you please help me out thxx . Programme is adding odd integer : [code=cplusplus] # include <iostream> …

Member Avatar for lAmoebal
0
79
Member Avatar for scorpio40330

I have an upcoming assignment, in which I have already completed. But I was just curious if anyone could look it over and give me some input on it. I am pretty confident that I have done it correctly. But I think I have became particularly attached to this assignment …

Member Avatar for Daphene
0
115
Member Avatar for Mahen

Hi, Merry cristmas and Happy new year to everyone. I am writing this because i am having problems with my compiler Borland C++ Builder 6 Evaluation Version :-( The problem is that after I have designed a GUI program, Build it and run the executable, Windows declares a Stack Overflow. …

Member Avatar for Mahen
0
412
Member Avatar for alkeshtech

[B]why is this keep giving me same 2 numbers?[/B] [code=cplusplus] #include <iostream> #include <iomanip> #include <ctime> #include <cstdlib> #include <windows.h> using namespace std; int generate(int,int); int _tmain(int argc, _TCHAR* argv[]) { int random[1000]; for(int n=0;n<1000;n++) { random[n]=generate(1,50); cout << random[n] << endl; } system("pause"); return 0; } int generate(int min, …

Member Avatar for alkeshtech
0
245
Member Avatar for Jennifer84

I use this code in a multilined textBox event handler. When writing: "hellowalker" in the textBox:s first line, "walker" turns blue. If you delete this and go down a line and write the same: "owalker" turns blue and down a line again "lowalker" turns blue. What could be wrong with …

Member Avatar for Narue
0
88
Member Avatar for Traicey

I have done most of languages, I did arrays[] to all of them and of cause except COBOL, I can declare them(arrayz[]) yes that one is easy, but manipulating them thats where the problem starts, I never get any program right if I have to use arrays, Im not gona …

Member Avatar for Traicey
0
99

The End.