52 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for letters1417

Hello! I have to print patterns using '*' and I am at a loss how to get these patterns printed! I figured out the first one, * ** *** **** ***** ****** ******* ******** ********* ********** and now i have to do it upside down: ********** ********* ******** ******* ****** …

Member Avatar for JamesCherrill
0
2K
Member Avatar for naz1234

Hi, from the result in my "for" loop, have stored four value. How to extract that value to show the value(sprintf) ? Kindly refer to the attached the image file. Thanks Regrads, nazif

Member Avatar for naz1234
0
226
Member Avatar for Niloofar24

Hello! I have a little problem with a For Loop, this is a For Loop in my script: $last_id = $conn->lastInsertId(); for($a = $last_id ; $a > 0 ; $a--){ code.... } But it doesn't work because of `($a = $last_id ;`, the variable $a can't be set to the …

Member Avatar for Niloofar24
0
874
Member Avatar for cahram

Hi, I'm new to Python and have a task of reading a user input text file that is tab-delimited and contains 4 columns in each line: Authors, Year, Title and Journal. I currently am just able to open a file, and now I don't know how to begin parsing the …

Member Avatar for nihad.aziz
0
4K
Member Avatar for brittney_2

I need to create a 2D array that holds the number of family members by the highest numbe of titles of one of the family members, and they input on one line. However, I am having trouble when I call the class in my other code in the main method. …

Member Avatar for brittney_2
0
310
Member Avatar for izzytoots

So I am working on a simple assignment for my C class that reads a formatted file and prints information about the file based on the format. The file format looks like this: #Domain Alexa Rank Site Name #------------ ----- ------- --------- amazon.com 13 1177136 Amazon.com google.com 1 4533883 Google …

Member Avatar for izzytoots
0
192
Member Avatar for abaddon2031

I have a python code that reads several csv files and writes teh data to a single file but every time it loops back around to the next file it prints the headers again. Is there a way to stop this I can post my code if it is nessisary.

Member Avatar for abaddon2031
0
280
Member Avatar for fourty

Hi Champs, Im using VBA for Excel. and Im trying to use the code below to move through records and increment their values by one since they meet a certain criteria Sub promotion() Dim x As Range Dim y As Integer Sheet2.Range("c2").Activate Do While y < 1002 y = ActiveCell.Row …

Member Avatar for Stuugie
0
297
Member Avatar for jspence29

I am making a program that does synthetic division, except for it is not showing the quotient only the remainder. I have checked my for loops so many times, and I can't understant what is happening here is my code: import java.util.*; import java.lang.*; class synthetic { static Scanner userInput …

0
204
Member Avatar for ckjaseem

Hi all , I have a set-interval function inside a for loop and when inside the set-interval function if it meets a criteria give an alert and clear the interval. Below is my code but its not working can anyone tell what the mistake here. var timeCheck = 0; function …

Member Avatar for LastMitch
0
483
Member Avatar for richprich

Although there are many similar questions and answers here and i've tried my best to make it work but no luck. This is my code: $content = "Blah...blah...[image=1], blah...blah...blah...[image=2], blah...blah...blah...[image=1], no more..."; function get_image($content) { $stripper = $content; preg_match_all("/\[image=(.+?)\]/smi",$stripper, $search); $total = count($search[0]); for($i=0; $i < $total; $i++) { $image_id …

Member Avatar for richprich
0
598
Member Avatar for TylerTCF

Hi Everyone. It's been a while since I was on here last, but ran into an interesting problem with a nested for loop that I cannot solve. Hoping someone here will know the answer. I placed breakpoints in my code at the For x=1 to 10 line and after to …

Member Avatar for TylerTCF
0
286
Member Avatar for ilovejava

i have to do a pyramid with a pattern like this [iCODE] 1 1 2 1 1 2 4 2 1 1 2 4 16 4 2 1[/iCODE] i just realized dani web didnt take my center pyrmaid thing it moved to the side no matter what spacing i did …

Member Avatar for JamesCherrill
0
306
Member Avatar for FraidaL

I wrote this code for an assignment that asked to create a program that calculates and displays the average of any amount of real numbers. The program is supposed to ask the user how many numbers they want to enter and then use a loop to ask the user to …

Member Avatar for FraidaL
0
3K
Member Avatar for Szabi Zsoldos

Hi guys, Working on a table. Each of the entries has an A or B in the 'tip' field. I order them by 'tip' how can i add a special row for the first entry of the A or B series from the query? I know it's not an IF …

Member Avatar for Szabi Zsoldos
0
131
Member Avatar for letters1417

Okay so this is another question printing patterns but this time using input! I have to prompt the user and read an odd number from the input. I can only use System.out.print('*'); System.out.print(' '); and System.out.println(); I need to maximize my use of repetition and minimize the number of output …

Member Avatar for DavidKroukamp
0
510
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 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 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
247
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
296
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
690
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 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
234
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
155
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
223
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

The End.