48 Topics
|
|
I get the following error from running this code. Was wondering if 'i' and 'j' are considered objects. If yes is there any way i could cast them..... How do i write a better for loop for this.... array2D = [[0 for i in range(10)]for j in range(10)] for i … |
|
Hi. This should be very easy for you guys, but I still can't get it visualized in my mind. Here's what I'm trying to do: [CODE] if (flag) for (i = 0; i < 10; i++) {LARGE_BLOCK_OF_CODE (that visits an array in order)} else for (i = 9; i >= … |
|
i need help with the following: make a program that gets the summation of a given number e.g. 4+3+2+1 implement it using both iteration and recursion ex. enter a positive number: 4 the sum is 10. |
|
I am working on this program in Python that would allow me to scan for a certain phrase in a certain text document. I used the finditer function in Python's re library.The certain line of code resembled the following: [CODE]phrase=regex.finditer(page)[/CODE] I also had a print statement at the end that … |
|
i need help with the following: make a program that would display the nth of the fibonnaci sequence. 1 1 2 3 5 8 13 21 34 55 ... n implement it using both iteration and recursion. |
|
hi guys! please help me understand anything about recursion and iteration ways of coding. :) (maybe some overview, details or something) thank u. we haven't had any further discussion about this. ;p but our teacher gave an exercise that goes like this: make a program that gets the summation of … |
|
I need to iterate through an array, starting with the first element, in chunks of, say, 5, then break off and do something else with the array, then go back to where I left off. I'm confused about how the array counter, using next, or current etc. would work. How … |
|
ifstream mystream(file_name); ofstream outputstream(filename, ios::out); do { mystream.getline(line, 100); mystream >> country_name >> happiness_value; total_happiness = total_happiness + happiness_value; count++; outputstream << country_name << " \t \t " << happiness_value << endl; } while (!mystream.eof()); the file ifstream is reading from is a .dat file, in this format: first 1 … |
|
hi all, i have a programming assignment where i read a text file through command line arguments. i then use that information to get a list of photos (just strings, not actual images) and a list of keywords that correspond to each of those photos. i am stuck on how … |
|
Hi guys I'm trying to finish my assignment, I stuck in a weird situation. I'm trying to create a pointer a linkedlist. This linkedlist contains pointer to a user-defined objects (City) and I'm trying to add City to this linkedlist and then iterate through the linked list to find and … |
|
Ok.. so I just started python (just = 3 hours ago). I have basic input and output set. Hell I even understand slicing and stuff (OMG SUBSTRINGS SO MUCH EASIER ON PYTHON :O ) but Im finding it not so easy to understand how to use for loops (silly me. … |
|
Hello everybody, For the last 2 days im trying to deal with a treeview. What i want to do is to copy the structure from one tree to another. I know there are other ways to do this, but the way i want is to iterate through any node-of any … |
|
[COLOR="Red"]4.6 - Insert() vector argument specs. Iter or not?[/COLOR] This allows me to refer to the second spot in a vector named 'inventory': A) [CODE] vector<string>::iterator myIterator; cout << "\nYou found a compass"; inventory.insert((inventory.begin() + 1), "compass"); cout << "\nYour items:\n"; for(iter = inventory.begin(); iter != inventory.end(); ++iter) cout << … |
|
I have a few things I want to make that I havent yet so this will be a later project but I was just wondering, How would a anti virus program work in C#? I've seen ones on youtube that iterate through your HD and looks for keywords like "Virus","Trojan" … |
|
Basically need help with one evil section of code! My program opens a start window which introduces the program. A start button leads to a second window with a number of buttons. The main two are "open" and "find restriction site". Im having problem with the code for the latter. … |
|
I am TRYING to write a program that finds restriction sites in a DNA file and returns a picture and information box of the enzyme which cuts it. My problems are; a) I have no idea if my program works past opening the file directory. b) I dont know how … |
|
Hi, I’m currently trying to develop a method to get a overview of all my different web templates I’ve created and (legally) downloaded over the years. I thought about a displaying them like Wordpress is previewing it’s templates view a small preview windows, displaying the concrete file with styles and … |
|
Whenever you hear the word recursion, factorials or Towers of Hanoi are never far away. Well here they get mentioned, because we are not going to talk about these guys at all! Iteration and recursion are in fact quite similar: they both loop until a certain condition is met. As … |
The End.