- Strength to Increase Rep
- +17
- Strength to Decrease Rep
- -4
- Upvotes Received
- 759
- Posts with Upvotes
- 607
- Upvoting Members
- 264
- Downvotes Received
- 56
- Posts with Downvotes
- 52
- Downvoting Members
- 27
Spent most of my life in California. Santa Barbara is about as far south as I go. Right now I'm in Santa Rosa.Received a Bachelor's Degree in Math and Statistics, then became an actuary for a while. It was all right, but a little dull. Decided to try…
- Interests
- Soccer, Rock Climbing, Scuba Diving, Philosophy, World History, Writing and Literature
- PC Specs
- Dual Core Something or Other, Definitely not top of the line. I mainly tend towards AMD over Intel.…
Re: Five numbers can be ordered 5! or 120 ways. The no-brainer way of writing this code would thus be writing an if statement with 119 "else if" statements, one for each possible ordering. You should be using <= instead of < (what if two elements are the same?). There may … | |
Re: What would f2f7 be, anyway? Is the smallest negative short in hexadecimal 8000 (corresponds to -2^15) and the largest negative short in hexadecimal ffff (corresponds to -1), so f2f7 is equal to: [code] f2f7 0d08 (flip bits) Add 1 0d09 Convert to decimal and add a minus sign -3337 in … | |
Re: The code is unreadable. Please format/indent it and use code tags. NetBeans and other IDEs will format the code for you if you want. Code tags are used as follows. All indentation is stripped out if code tags are not used. Please repost with them. [noparse] [code=JAVA] // paste code … | |
Re: > "Write a program that reads in ten numbers to an array. The program then reads the array and displays distinct numbers (i.e. if a number appears multiple times, it is displayed only once)" > > for example: > > `1 2 3 4 5 5 6 7 8 8 … | |
Re: [QUOTE=kittycat07us;785518]Hi, I'm having trouble with creating a program to split a number into there own separate digits and then multiplying the digits to create another number. The program will repeat itself until there is just one digit.. The main thing I'm having problem with is figuring out how I could … | |
Re: [QUOTE=computer engW;614105]Could any one answer my questions??[/QUOTE] I can't figure out what the questions are. The code you posted draws a triangle. Change it slightly to draw a square: [code=cplusplus] int main() { int n = 4; int line, loop; for (line = 1; line <= n; line++) { for … | |
Re: [QUOTE=Climber Ty;] For some reason it automatically shows all the nodes. Maybe I haven't totally grasped the concept of traversing, because I am thinking it will only show one at a time and I know my code isn't exactly right.[/quote] Well, what do you WANT the "traverse" function to do? … | |
Re: [QUOTE=brettw02;538790]Ok this is great... I am only unsure of one thing here --» I am a little unsure of the reason for [number - 1] -- Im sure im just overlooking something rather simple...[/QUOTE] The 1 is subtracted because in C++ array indexes start at 0 and your loops: [code=C++] … | |
Re: > All IP addresses used to register and ***post*** They all make sense to me except for keeping track of the IP address for every single post. Why would provng you aren't spamming require that you keep track of the IP from every single post? I have thousands of them. … | |
Re: [QUOTE=hollywoood69;984746]So i have been at this program for hours....and still no luck. I have made the changes that were suggested...but i get an answer of inf.....not sure what to do from here. any help[/QUOTE] [code=cplusplus] double mortgagePayment::tPayment(double principle, double term, double interest) { term = 0; int years = term … | |
Re: [QUOTE=Compton11;569810]Brittany, you can't do cin >> number[i]..That will not read a value and store it in the array...Do something like this: ...Remember to add to my reputation! [code] cin >> num; numbers[i] = num; [/code] [/QUOTE] [code] cin >> numbers[i]; [/code] works fine. The way you did it works too, … | |
Re: Trying to program a snake game if you can't make yourself understand classes is a recipe for disaster. Ditto linked lists and binary trees. There's a natural progression in C++: "Hello World", print your name, count to 10, count to however high the user wants, functions, arrays, pass-by-reference-versus-value, pointers, structures, … | |
Re: [QUOTE=samsons17;1038634]does anyone know how to do the program that are more or less like peteranswers?? This is the website which has been using to trick people... [URL="http://www.peteranswers.com/"]http://www.peteranswers.com/[/URL] and this is the secret : [URL="http://chriswondra.com/2007/02/21/peter-answers-the-secret/"]http://chriswondra.com/2007/02/21/peter-answers-the-secret/[/URL] i'm just wondering if i'm capable to do just a simple program that is similar like … | |
Re: That gets rid of the compile error by expanding the scope of monkey but that doesn't solve the real problem, which is that the OP should not have been using monkey on lines 116 and 150 in his original post in the first place. monkey is being used as a … | |
Re: That works, though it doesn't match what Ancient Dragon had in mind. His idea has the menu function also asking for the choice from the user. You could have a function that just displays it or one like his that asks for the choice as well. If you want to … | |
Re: [QUOTE=payara111;865657]How can i print it recursively with one helper function? [img]http://img2.imageshack.us/img2/1690/recursive.th.jpg[/img] Here, n will always be a power of 2 and c will be indicating the column number from which to start the output. The above pattern has been produced with the initial function call RecursivePattern(8,1) It prototype should be … | |
Re: To the OP, How can responding to help in such a way (and it WAS help, it wasn't trolling) possibly get you closer to the answer, which presumably is what you are looking for? There are twenty million ways of writing any program. HOW you write it depends on WHAT … | |
Re: Not sure what the question is, but presumably if the code above is in a function called: [code] int checkWinner() [/code] you would harness the return value like this: [code] int returnValue = checkWinner(); if(returnValue == 79) { // code for when O wins } else if(returnValue == 88) { … | |
Re: [QUOTE=playst205;614157]Thanks for the help ill see if it helps and ill contact you if it dusnt when ur online ANYONE ELSE READING THIS FEEL FREE TO GIVE ME YOUR RESPONSES FROM YOUR OPINION THANks[/QUOTE] As others have said, the error is clear, though it can be time-consuming to track down. … | |
Re: You could certainly write a C++ program that could send the following output to stdout: [code] <html> <body>Hello World</body> </html> [/code] but I imagine you'd have to stick it in the cgi-bin folder and type [url]http://somesite/cgi-bin/helloword.cgi[/url] in the browser. If you stick it in the html folder and try to … | |
I have a Yahoo website that uses phpMyAdmin. I've been given the directive "Please run the script mysql_fix_privilege_tables that should be included in your MySQL server distribution to solve this problem!" I do not know how to run this script (or any script) through phpMyAdmin. I've been looking online and … | |
Re: You need a nested loop. The trick in these(always) is to figure out what the loop counter boundaries are. [code] int i, j; for(i = ?; i < ?; i++) { for(j = ?; j < ?; j++) { cout << " "; } for(j = ?; j < ?; … | |
Re: [QUOTE=mattybennett;660320]Simple - because I must. I have been designing the application in question on paper (process and maths side) but recognise that I am weak on programming. That doesn't mean that I should not attempt it.[/QUOTE] You're tackling a huge project without having the fundamentals. I'm not saying don't attempt … | |
OK, I have been experimenting around with GridBagLayout and I'm getting the hang of it. Things are looking the way I want them to on the INITIAL drawing of the GUI. However, when I RESIZE the JFrame to make it smaller vertically, at a certain point, the proportions get skewed. … | |
Re: Sounds like you might want to consider changing majors. If you don't think you have an aptitude for programming, I think that's going to cause problems graduating with a CS degree. There are some darn good coders out there who aren't that great at the algorithms, etc. that are also … | |
Re: [code=cplusplus] #include <iostream #include <iomanip> using namespace std; //function prototypes double patientcharges(int, double, double, double); //in- patient double patientCharges(double,double); //out-patient int main() { char patientTye; //I = in-patient; //O = out-patient; int days; //num days of hospital stay double roomRate; //Daily room rate double medication; // Total medication charges double … | |
Re: >> Untill here everything is working good with me Looks good here too. >> but on line 6 I got confused. What happened to line 5? And what do these numbers represent? What's in the queue or what's in the variables? >> I got[B] 4 5[/B] Again, "got" needs to … | |
Re: Correct way. double fallingDistance1() // no need for any parameters { double d=0.5*9.8*t*t; return d; } d = fallingDistance1(); // harness the return value The way you had it... double fallingDistance1(double d) // no need for any parameters { d=0.5*9.8*t*t; return d; } fallingDistance1(d); There's no point returning a value … | |
Re: >> it's almost working but it seems to be ignoring the first character of the second string. Throw more stuff at it till you can verify this. Scramble the word "computer" and see if it always misses the same letter(s). Instead of "computer", use strings like "abcdefghij" and "jihgfedcba" until … | |
Re: Looks like good old-fashioned round-off and/or overflow error. I changed things to integer types and got rid of the pow, ceil, and abs calls and they match. [code] /********************************************************** Diffie–Hellman key exchange algorithm ------------------------------------- This program demonstrates the Diffie-Hellman exchange key algorithm Tips to improve security ------------------------- [1] Pseudo random … |