91 Topics

Member Avatar for
Member Avatar for pwolf

I have the task of writing a function to determine the outcome of a game of tictactoe, i at first thought use a couple of for loops but that proved pointless, and then the only way i could think of was to write an if...elif...else statement for each row, column …

Member Avatar for woooee
0
303
Member Avatar for LogicalOutlier

This program determines the grade average, raised grade average, of individual students and all students. The program takes scanner input. In the scanner, the number of students, the number of grades for each student, and the grades of each student are entered. Ultimately, I need to print out each student's …

Member Avatar for hiddepolen
0
2K
Member Avatar for pwolf

Create a function generateNumbers(num) that takes in a positive number as argument and returns a list of number from 0 to that number inclusive. Note: The function range(5) will return a list of number [0, 1, 2, 3, 4]. Examples [CODE] >>> generateNumber(1) [0, 1] >>> generateNumber(10) [0, 1, 2, …

Member Avatar for TrustyTony
0
2K
Member Avatar for ibthevivin

So basically I'm stuck at the do-while statement. Should I use a do while? or a for loop? This program is supposed to test my ability to use loops. [CODE]/*Create an application that reads an integer value and prints the sum of all even integers between 2 * and the …

Member Avatar for stultuske
0
229
Member Avatar for Ahmed2

Hello every body I'm trying to iterate through a list for a certian number of times using a for loop. below is the current code I've written, but this will iterate through the list until it ends. [CODE]list<FileInfo*>::iterator p = currentlist.begin(); while(p != currentlist.end()) { cout << (*p)->remainingtime << " …

Member Avatar for Schol-R-LEA
0
1K
Member Avatar for mkbear

Hey so Im a beginner, and I need some help. My professor gave us this code: [CODE] def average(list): total = 0.0 for number in list: total += number return total / len(list) [/CODE] Then, he asked us to rewrite that program so that it uses a while loop instead. …

Member Avatar for askandstudy
0
201
Member Avatar for mkbear

Hey so Im a beginner, and I need some help. My professor gave us this code: def average(list): total = 0.0 for number in list: total += number return total / len(list) Then, he asked us to rewrite that program so that it uses a while loop instead. So far …

Member Avatar for inuasha
0
207
Member Avatar for dsmush

Hi trying to recover an RSA encrypted 5 character word using a forward search dictionary attack in Python but having difficulty. The word was encrypted in 2 24 bit blocks (3648141 5604637) padding last block with a space e = 5 n = 21508387 table = {} for ptext in …

0
110
Member Avatar for jdiaz1302

Hi everyone, well I have trying to do an elevator simulator, wich have to includo the panel with the floor, available floors, and a button panel with available floors and button up, down, but I dont understand is how to use the timers for up and down, because I vague …

Member Avatar for Reverend Jim
0
589
Member Avatar for TrueCoding

Hi the aim of my program is to allow a user to enter the size of an array and then allows the user to enter the values into an array. The bit im having a problem with is I want to count how many odd and even numbers there are …

Member Avatar for Rushirl Quiño
0
2K
Member Avatar for megatron21

I am having hard time understanding what the problem is with my code here. Basically I have a map that contains Key objects as the key, and Block* as the value. The point of this for loop is to print out the values that the key contains on to the …

Member Avatar for megatron21
0
250
Member Avatar for C++newbie chick

Hello guys, I'm trying to make it so that the user can opt to change student's course code or credit points (they can choose to change neither, either or both) in case 5 of my main switch statement. The problem is, the loop doesn't end after you choose to do …

Member Avatar for Ancient Dragon
0
297
Member Avatar for Justinedeleon

Oh. btw admin! sorry about my earlier thread. i promise not to do something like that ever again :) anyway. i was having trouble with my project and its about Multiplication with loops. i started with a few codes and im really frustrated with what im doing now. please let …

Member Avatar for Justinedeleon
0
337
Member Avatar for ilovejava

i have to write a program that displays the value of pi for values for i = 10000,20000.....,and 100000 i have to use the following series pi = 4(1-(1/3)+(1/5)-(1/7)+(1/9)-(1/11_+...+(1/(2i +1))-(1/(2i +1)) any ideas i have to do a program with looping i cant use arrays can someone give me a …

Member Avatar for NormR1
0
1K
Member Avatar for dakaboguy

Hello all, I have a form with 24 textboxes incremented by a letter. example: txtDimVala1.text, txtDimValb1.text, txtDimValc1.text, etc. I created a code to check each textbox, but there must me a more efficient way to loop it. I have tried a few loops but I cant get them to work …

Member Avatar for dakaboguy
0
696
Member Avatar for JoshuaBurleson

I have no idea what went wrong with my most recent code, but I suspect it has something to do with the following so I'll start there. Did I do something wrong in this? [CODE]cards=['1','1','1','1','2','2','2','2','3','3','3','3','4','4','4','4','5','5','5','5','6','6','6','6','7','7','7','7','8','8','8','8','9','9','9','9','A','A','A','A','K','K','K','K','J','J','J','J','Q','Q','Q','Q'] import random random.shuffle(cards) h1=[] for card in cards[1:7]: h1.append(card) cards.remove(card)[/CODE]

Member Avatar for TrustyTony
0
225
Member Avatar for googlygoo

Hi! I'm a newbie in this forum. I'm a novice C++ programmer and we are tasked to create a program with the following requirements: [QUOTE]Given the sequence of numbers [I][B]n a1 a2 a3 . . . an[/B][/I] a simple histogram should be printed to the computer screen. The number [B][I]n[/I][/B] …

Member Avatar for vijayan121
0
421
Member Avatar for bribissell

I am making a page which pulls from the user's browser their preferred language, via the Request.UserLanguages....which returns a two letter code (ex. "en") or detailed code (ex. "en-GB"). I basically get the string of user languages (they are in order of preference) and store them in a string array. …

Member Avatar for bribissell
0
320
Member Avatar for vijaybrar

Hi i am just new to VB.NET and our teacher told us to experiment on for loop in a ODD SUM Program you need to add all odd numbers from Input One to Input Two like that but i can't stop it from adding continuously for example i input the …

Member Avatar for adam_k
0
235
Member Avatar for leetari

hi all, I have this minor problem which is making me go cranky at the mo.. Can't think straight, need some insights to what I can do... Below is the code which I am working on which takes the test sample values stored in my test 2D array subtracts the …

Member Avatar for leetari
0
157
Member Avatar for BOOMBOOMF

could someone plz help.. i'm stuck in one part where u have to access the array form the main class(random) ive juss posted the two classes i have doubt in.. the question goes soemthin like this: Q:Make a java class file for function that can do addition, then make a …

Member Avatar for Annuate
0
941
Member Avatar for zachcoenen4

I have been trying for about 6 hours to get this program to work. It's a C++ program for for loops. I am trying to go through a book, but I don't have source code for how this should be. I need to make a program that looks like this …

Member Avatar for zeeshan soomro
0
466
Member Avatar for kratosaurion

So here is my problem, my friend and I are writing a simple project for a electrical eng. teacher, who really doesn't know too much about programming c++. We were assigned to make a successive approximation ADC [URL="http://en.wikipedia.org/wiki/Successive_approximation_ADC"]Look here[/URL] in any coding language possible. I would have liked to make …

Member Avatar for kratosaurion
0
449
Member Avatar for lil_miss_choc

I'm working through an exercise to create a short program to calculate E using the series 1 + 1/1! +1/2! + 1/3! + ... The summation has to stop when value of a term is less than a value entered by the user. The code I have to produce the …

Member Avatar for lil_miss_choc
0
225
Member Avatar for fuaki

Hey, I made this code with the bits and pieces of knowledge i have, but i don't know how to convert it into a while loop. it is currently in a for loop. the program counts how many certain letters there are in a sentence/ word. String word; String letter; …

Member Avatar for turt2live
0
176
Member Avatar for stan2000

I'm trying to write a method that draws a rectangle. If the user enters height = 4, and width = 8, and the print of character " * ", then the left rectangle is drawn on the left if the filled flag is true. If the flag is false, then …

Member Avatar for richieking
0
2K
Member Avatar for CrumbledCookies

Would somebody please assist me? I have been consistently been doing trial and error with my counter. You see, when the program cannot locate an item (which is typed at the bottom) it displays "Sorry, no such item number exists, please enter another one or 0 to stop." Every time …

Member Avatar for CrumbledCookies
0
351
Member Avatar for battlex2010

i have the following code for getting the number of files on a drive: [CODE] Dim num As Integer = 0 Dim drive As String = "C:" For Each File In System.IO.Directory.GetFiles(drive,"*",System.IO.SearchOption.AllDirectories) Try num += 1 Label5.Text = String.Format("Files found: {0}", num) If num > 50 Then RaiseEvent start() End …

Member Avatar for Unhnd_Exception
0
191
Member Avatar for insanely_sane

Ok, so you know how, if we want to output the elements of an array to the screen, we have to make a for loop right? So I have the following code... [CODE] char array[] = new char [10]; array[0] = '1'; array[1] = '2'; . . . . array[9] …

Member Avatar for jon.kiparsky
0
2K
Member Avatar for musikluver4

I want to be able to create JLabels, all different names, with a for loop ex: [CODE] static JLabel[] totalAYearLabelYr = new JLabel[termYears]; [/CODE] So I got 30 JLabels named totalAYearLabelYr, which I'm not sure you can have 30 JLabels named the same thing. I wanna name them all totalAYearLabelYr1 …

Member Avatar for musikluver4
0
7K

The End.