91 Topics

Member Avatar for
Member Avatar for AMADH

Hello, I was hoping that someone can help me with this. I have this linking list working, but I have one problem, when I click on the link it shows up with the link like this winner.php?service=1&&year=2010 and honorable.php?service=1&&year=2010&award=1 this is for all years not just 2010, and what I …

Member Avatar for sudeepjd
0
190
Member Avatar for addlou

I need help showing me where I went wrong. Given problem is. Print to System.out a new string composed of every alternate character in sentence starting with the first. Use a loop to go through a string and retrieve characters from alternate index positions. Append these characters to another string …

Member Avatar for addlou
0
4K
Member Avatar for 24x24

First off: I am not looking for somebody to do my homework. Although it would make it easier for me in the short term, please don't "help" me by writing my code for me. I would rather lose points for being late and understanding the code than get the grade …

Member Avatar for peter_budo
0
133
Member Avatar for SoftwareGuy

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 >= …

Member Avatar for SoftwareGuy
0
196
Member Avatar for gpjacks

This is a program which declares two vectors of 6 elements each of type double. One vector is named weight and the other is named rate. The program uses a loop to prompt the user for a weight in ounces and a postage rate for that weight and then stores …

0
239
Member Avatar for cortez716

Okay here's what I'm trying to do use a for loop get 5 numbers from input ONE number at a time. Output the sum and average of the 5 numbers. I am only allowed to use a maximum of 2 variables to solve this problem. Heres my code so far, …

Member Avatar for WaltP
0
151
Member Avatar for neural_jam

What the title says. Basically, I have some code with 12 nested loops based on the code below, and may have to bump it up to 24. This works fine, but seems a little cumbersome, and can't help but think that there's a better way of doing it? All help …

Member Avatar for neural_jam
0
2K
Member Avatar for raheel_88

I'm having trouble with a for loop! I'm trying to solve a differential equation using Euler's method like so; [TEX]\displaystyle\frac{dy}{dx} = 7{y^2}cos(y^2)-3e^{xy}, \ \ \ 0 \leq x \leq 1 \ \ \ y(0) = 0[/TEX] This is solved using the algorithm [TEX]y_{n+1} = y_n + hf(x_n , y_n)[/TEX] Where …

Member Avatar for Unimportant
0
826
Member Avatar for Coemgen3

Hi there, I have only just began the proccess of learning C# Programming (this week)returning to education as a mature student, one of the assessments I have been given is to find out how to, and then write a program using 'nested for loops' to display the 1,2,3 and 4 …

Member Avatar for kplcjl
-1
131
Member Avatar for Toikkala

Hey, i need to make app that should take 10 chars from list. I tried it with range command but it's not working. [CODE] list = 'abcdefghijklmnopqrstuvxyzo' for list in range(10): print list [/CODE] And this code just prints numbers 0 to 10. So, is there some other command that …

Member Avatar for TrustyTony
0
225
Member Avatar for faisal.alawar

Write a program that prompts the user for an odd positive integer, n, greater than 1, and then prints the following hourglass figure which has a height of n text lines: In this example: n = 9 ********* (please refer to the attachment for the figure) * * * * …

Member Avatar for prvnkmr449
-1
206
Member Avatar for coolboss

#include<iostream> using namespace std; void main() { int pro[100]; for(int a=100;a>=1;a--) { pro[a]=a; cout<<pro[a]<<"\t";} }

Member Avatar for arkoenig
0
103
Member Avatar for insanely_sane

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. …

Member Avatar for insanely_sane
0
196
Member Avatar for fire_

Hello. I have some problems. 1.With for cycle. This is my code: [CODE]#include <iostream> #include <fstream> int main () { int i; int i2; char sentence [200]; char repeat; ofstream file ("file.txt", ios::app); for (i=0; i<1;) { cout << "Enter sentence (max. 200 symbols)\n"; cin >> sentence; if (!file) { …

Member Avatar for Kanoisa
0
151
Member Avatar for Musing888

Using the following code I am trying to check the users input string (CAcodes) and checking each one individually by assigning each element in CAcodes to a list (CAcode). A for-loop checks the conditions to make sure that the conditions for each code are met. The main for-loop tests several …

Member Avatar for TrustyTony
0
257
Member Avatar for bettersaid

im a newbie to python, still learning as of today. as a part of my 'self-training' i listed some topics to practice every week but i was not able to run it successfully and im stuck. what i wanted with my activity is for it to read a .txt file …

Member Avatar for woooee
0
174
Member Avatar for cmutzel02

Hi all, I am having a problem when trying to compile this. from compiler: error: name lookup of 'pixel_number' changed for new ISO 'for' scoping error: obsolete binding at 'pixel_number' I understand that I cannot use the pixel_number variable outside of the for loop, have read so in other posts. …

Member Avatar for cmutzel02
0
267
Member Avatar for krishx343

Hi I need to know, is there any option to use For loop instead of While and ForEach to retrieve the result. While Loop ----------- [CODE] $query = "SELECT name, subject, message FROM contact"; $result = mysql_query($query); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "Name :{$row['name']} <br>" . }[/CODE] instead to …

Member Avatar for rajarajan2017
0
9K
Member Avatar for echellwig

Hi I was wondering if there is any way to created a series of lists in a for-loop so that the first list created is named NAME0 or name_0 or indexed in some way. What I have right now is [CODE]for j in range(int(L)): popsizelocus_j=[][/CODE] however, this is not working …

Member Avatar for TrustyTony
0
48K
Member Avatar for echellwig

Hi, I am trying to write elements from a list that I have created to an outfile using a for-loop with this code: [CODE]for j in range(int(Allele[i])): outfile.write(' allelelocus[j] * ')[/CODE] However when I do this I just get a whole bunch of allelelocus[j] in my out file. I was …

Member Avatar for echellwig
0
136
Member Avatar for superchica08

hello everyone i was wondering if anyone would be able to help me in an program i have to do. the program wants me to use my initials A and G and plot them on using gotoxy() function to make some thing that look like the picture in the link …

Member Avatar for superchica08
-1
904
Member Avatar for bharatk

I have 2 lists: a=[0,1,5,7] b=[2,10,6,3] I need to get this list : c=[(b[0]+a[0]),(b[0]+b[1]),(b[0]+b[1]+b[2]),(b[0]+b[1]+b[2]+b[3])] I tried doing this using a for loop: [CODE] c=[(b[0]+a[0])] for i in range(0,(len(b)-1)): for p in range(i+1,len(b)): if i==0: c.append((b[i]+b[p])) else: c.append((c[i]+b[p]))[/CODE] I am supposed to get [2,12,18,21] but I am getting [2, 12, 12, …

Member Avatar for bharatk
0
97
Member Avatar for seven11

I need help in determining,using Big-O notation, the upper-bound for these two algorithms i wrote. They both do the same thing but are coded differently. They both look for all the prime numbers up to some limit, N. This first algorithm: [CODE] public static void algo1(){ primes = new int[n]; …

Member Avatar for Rashakil Fol
0
120
Member Avatar for daniss

I fear from loop statements that's why I cannot figure this thing out. I understand the concept put I do not have bigger picture. Here I would like to close the application after the person try 3 times putting the wrong password. [CODE]Public Class MainForm Private Sub exitButton_Click(ByVal sender As …

Member Avatar for Oxiegen
0
145
Member Avatar for innocentkid

Hi everyone, I am doing a program here to ask question about alphabet, and i am only in the middle of it and i face some problem that i really cant solve, need some help here... ok the problem is, for(int j =0; j<20;j++), in output, the 1st jlabel.setText(j) is …

Member Avatar for innocentkid
0
151
Member Avatar for AdventDeo

OK I'm not really sure how to put it but I will try my best to explain my question. Basically I am really lost when it comes to arrays and for loops, so I need help badly. I have in my HTML Form about 20 checkboxes like this: [CODE]echo "<input …

Member Avatar for AdventDeo
0
180
Member Avatar for musikluver4

The code below is the file for the constructor method and the get methods [code] //Date: 3/18/2010 public class Taxpayer { private int socSec; private double yearlyGross; public Taxpayer(int taxPayer, double income) { socSec = taxPayer; yearlyGross = income; } public int getSocSec() { return socSec; } public double getYearlyGross() …

Member Avatar for javaAddict
0
174
Member Avatar for musikluver4

[code] //Date: 3/17/2010 import java.util.Random; public class Bingo { public static void main(String[] args) { Random bingo = new Random(); for (int i = 1; i <= 50; i++) { System.out.println("Card #" + i + "\n********"); System.out.println(); for (int j = 1; j <= 24; j++ ) { int bingoNum; …

Member Avatar for BestJewSinceJC
0
5K
Member Avatar for musikluver4

[code] //Date: 3/16/2010 import javax.swing.*; class PizzaChoice { public static void main(String[] args) throws Exception { char[] whatSize = { 'S', 'M', 'L', 'X'}; char size; double[] sizePrice = {6.99, 8.99, 12.50, 15.00}; int s; System.out.println("What size do you want?"); size = Character.toUpperCase((char)System.in.read()); for (s = 0; s < whatSize.length; …

Member Avatar for musikluver4
0
947
Member Avatar for rzhaley

hi im trying to create a C# program that'll display * ** *** **** *** ** * type pattern but i can only get mine to look like this when i try to add on to the code * ** *** **** and then it stops. can anyone help on …

Member Avatar for Geekitygeek
0
147

The End.