" data-bs-original-title="" title="">
To get back to the actual scientific answer, I believe Ene Uran had it right a while back. An evolutionist is going to say that the egg came first. > Evolutionists: > An almost chicken laid the egg the first real chicken came out off. > Creationists: > God made …
* Stick a "return 0" in there at the end of main. * Count your opening and closing brackets. Make sure you don't have a bracket mismatch. * Get rid of the stray semicolon after the final bracket.
You're a high school freshman and you can do a four minute mile? That should be a U.S. record for the 15 to 16 year old age group. http://www.usatf.org/statistics/records/view.asp?division=american&location=outdoor%20track%20%26%20field&age=youth&sport=TF Scroll down. Record for 1500 meters (shorter than a mile) is 3:54.02 in the 15 to 16 year old category. If …
[QUOTE=FtKShadow;694512]I am trying to get my homework assignment to work for class, but I cant seem to get it. Heres the assignment. Seems not to bad doesnt it? Well I have been working for a while and it still isnt working for me. I enter lets say a 4 it …
> the program shouldnt display the previous numbers counted. Do I take this to mean that there should be no output? Or should there be a countdown from 30 to 0, with a delay in between each iteration, then there is a "Screen Clear" and the new number is displayed? …
Forget the computer for a bit. Think of the algorithm. How would you do it with pencil and paper? What steps would you take? Write the steps out exactly. Follow the steps exactly to make sure they are right for all scenarios. Now go back to the code and make …
[QUOTE=SpecialeW;529887]hi, how can i make sure that when i ask a yes no question, i don't get rubbish for an answer. i have tried some while codes, but i seem to do something wrong, because when i execute the program i can enter anything i want... this is what i …
I'm reading the function name. I see a function called **addBook**, not **addBoooks**. Hence I am expecting to one book, not many. I am hoping this is the intent. One book, not twenty. I am confused by your description of what is occurring. You are entering something 20 times, not …
Code tags: [noparse] [code=JAVA] // paste code here [/code] [/noparse] Code looks terrible without them. This looks like a cut and paste of the assignment specification that someone gave you. What seems to be the problem?
This is a matter of going line by line and changing the code to C++. All variables in C++ must have a type (i.e. int, char, string, etc.) and must be declared before you use them, so a good start might be to figure out what variables you need and …
You have not posted the declaration of dna1, so it's hard to say exactly where you are going with this. Regardless, having the brackets operator without an array index seems like an error. if(!dna1[].strand1){ Does the compiler let you do this? Then later you have this... cout<<"<"<<sizeof(dna1.strand1)<<">";} Is dna1 an …
[QUOTE=joshmo;877835]Ofcourse I can get to understand the logic..What I want to know is how i can get, say a given equation to integrate or differentiate a number, then change that logic, to JAVA code..is there any application or tool that can do this?[/QUOTE] Depends on the equation. A lot of …
You need the ruler to break the candle in two. If you have the ruler, then Dani's solution has it covered. All these solutions only need ONE candle, yet we have two of them. Is the second candle a red herring? I think we can assume we have matches. Not …
Consider using the "at" function instead of the [] operator and catching the error. You have a 2 dimensional vector. You need to find out which one gives the error. For some debugging... cout << i << '\t' << j << '\t'; cin.get(); cout << grid.size() << '\t'; cin.get(); cout …
What exactly is the problem? Possibilities might include... * Reading from file. * Writing to file. * Iterating through the list. * Swapping elementss that are out of order. * Not understanding the bubble sort itself. I see no non-commented out attempt to do a bubble sort, so obviously things …
[QUOTE=Alex_;889004] I know there is another thread about the same subject but it's been dead for years. And nobody pays attention because of the silliness of the poster.[/QUOTE] There are a couple of THOUSAND threads regarding project ideas and as a result, most get ignored or flamed. However, I won't …
[QUOTE=savinki;620158]Hi, wt is the function that can use to count number of digits in a long integer? e.g. 12345678 -> 8 11 ->2 456 -> 3 6724 -> 4[/QUOTE] I don't know that there is a function that does that. You can do two things though. You can use the …
Line 43 seems way off. I'll take your word that this compiles and runs, but even so, line 43 is definitely wrong. I'm assuming that line 43 is supposed to be a function call. However, it is NOT a function call. Function calls don't have the return type and parameter …
> i have to copy and rename the output file in each step so that they can be used in another program . "Copy" AND "Rename"? So you start with a file named a.txt and you are supposed to end up with what? one file? Two files? A file named …
Use the iostream library to read in data from the file into a card type and card number. How best to do that will depend on how the information is arranged in the file. A common way to set up a file would be to have two fields per line, …
[code] void CoinChanger::getCoinChange(int &DollarCoin, int &QuarterCoin, int &DimeCoin, int &NickelCoin, int &PennyCoin) { this->DollarCoin = DollarCoin; this->QuarterCoin = QuarterCoin; this->DimeCoin = DimeCoin; this->NickelCoin = NickelCoin; this->PennyCoin = PennyCoin; }[/code] This is a set function, not a get function. Either rename it or make it an actual get function. [code] void …
Is there still a "noparse" option? I tried posting the following in the C forum (let's see if it works here). Error message is as below. > The code snippet in your post is formatted incorrectly. Please use the Code button in the editor toolbar when posting whitespace-sensitive text or …
struct Card { const string rank[13] = {"Ace", "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King"}; const string suit[4] = {"Spades", "Hearts", "Clubs", "Diamonds"}; }; These are string arrays. The only purpose of them is to provide a quick way of converting a number from 0 …
The || operator is the "logical or" operator. the | operator is the "bitwise OR" operator. The |= operator combines the bitwise OR operator and the assignment operator. Thus the code above is equivalent to the code below. #include <stdio.h> #include <stdlib.h> int main() { int a=8,b=3; int c = …
> is it possible to print both statements of else If you are using the if-else clause as intended, either the code in the "if" part will execute or the code in the "else" part will execute, but not both. Now if the question is "Can I print 'Hello World'" …
Quite a few questions in this thread. Not sure which ones are still relevant and which are already solved. First, from an overall design, there is more than one way to do this. There are two main ways and you have mentioned them both. One is to have the Card …
Who wrote the code here? Is this code you have been given or did you write it? I've never seen this style of doing things. I always did it more like this... struct Student { string name; int id; int* markPtr; Student(); }; Student::Student() { markPtr = new int [100]; …
I'm searching your code for the phrases "pop" and "push" and not finding them. You can't have a queue or a stack without "push" and "pop" functions. You probably have them in the code, but are calling them something different. I see "malloc" in the hireEmployee function, so my guess …
> Why I can't create a new Cat I'm searching for the phrase "new Cat" and not seeing it, except in a comment. Also, capitalization counts. "Cat" and "cat" are not the same... sc1->method("Cat"); if(something == "cat") Not directly relating to your problem, but still needlessly complicating your code is …
The End.