142 Topics

Member Avatar for
Member Avatar for microbert

Hi, I have a While Loop to display my MySQL info. This makes a list of all my data, in one row. But what I want is it to display it in a table with 5 columns so that the data is more readable. this is my code: [CODE] while …

Member Avatar for broj1
0
4K
Member Avatar for Joe34

I'm trying to simply match these letters using php, but it's kind-of a complex matching formula... First, I have two arrays and one string. The arrays contain letters and the string is a near match of those letters. $a - [Array] Must be <= 7 $b - [Array] Must be …

Member Avatar for cereal
0
232
Member Avatar for MBPB

Hi all. I am learning Java, and having a problem with a sentinel loop to fill an array. I want the loop to terminate when -1 is added, OR when the array is filled. [CODE] int i = 0; int counter = 0; int[] array = new int[40]; System.out.print("Enter values …

Member Avatar for DavidKroukamp
0
3K
Member Avatar for adohertyd

I am writing a spellchecker program and have some issues. First thing is that I need to make better use of the memory. My code iterates through a large dictionary file repeatedly. I know its better to read this into memory first then iterate through the block but I really …

Member Avatar for VernonDozier
0
205
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 BoBok2002

I am trying to build a binary search tree. The elements in my input file is printing, but with junk. The problem is with the sentinel in the while loop. I'm not sure of what else to try. I've tried: while (infile) while (count != 14 && infile.good()) while (strcmp(Str, …

0
127
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
202
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
208
Member Avatar for sushlet

[CODE] ifstream in_gradebook; ofstream out_gradebook; in_gradebook.open("gradeBook.txt"); out_gradebook.open("gradeBook_edit.txt"); while (???) //while int is being read { in_gradebook >> score; out_gradebook << score << " "; sum = sum + score; } average = sum / 10.0; out_gradebook << average << endl;[/CODE] Here is a small snippet of the code I have …

Member Avatar for sushlet
0
242
Member Avatar for wolfgangcs

Trying to make a short to do list. show item to do-->click who you are $who and $item sends to top to show that item no longer there, but the rest are [CODE] <? echo "Here is the list of things that need to be done!"; echo "<form>"; while($row3 = …

Member Avatar for jmichae3
0
248
Member Avatar for RoqueyB

I am supposed to have a while loop that asks for a number until the number is a negative. Then I am supposed to get a total of all of the numbers EXCEPT the negative number. As of right now my program adds up the absolute value of all the …

Member Avatar for TrustyTony
0
148
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 joshThtch

Building a phonebook program for school--very much a work in progress. I still need to write a sort function, tweak my delete function, etc. But actually what I'm hoping you folks could answer is hopefully simpler--for some reason I seem to have a while loop that is executing twice, and …

Member Avatar for joshThtch
0
205
Member Avatar for effBlam

Im having a main function issue. My program is a text analyzer of more than several lines and then input 'END' to stop taking input. It analyzes input text based on the chosen options 1 through 2, relooping for invalid choice. Im having an issue having it properly work in …

Member Avatar for Greeky
0
223
Member Avatar for effBlam

I am making a program that analyzes text from a user After inputting several line and using the keyword "DONE", the program will ask for one of 8 possible options which is the menu() function where the user will enter the number. How would i be able to run my …

Member Avatar for JoshuaBurleson
0
211
Member Avatar for mattnguyen45

The last do..while loop only prints the 2^n of the number entered and n is user input. It does not print all 2^n from 1 to what ever value user inputted. [CODE]/** * * * @author * @version */ //import Scanner utility import java.util.Scanner; public class Loops { public static …

Member Avatar for JamesCherrill
1
165
Member Avatar for davesmith437

Hi, This is what I'm trying to achieve...... An html table on a page which shows results from a series of races with the competitors listed on the x axis and the results per race on the y. Each series has a different number of races so it isn't possible …

Member Avatar for davesmith437
0
257
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 mhillig1

[B]What I want on the first run thru[/B] is to ask for input, print input, ask for 2nd input, print 2nd input. End the first run, saving inputs to text file. My results are: input 1 input 1 again. input 2 input 2 again. On the 2nd time thru, it …

Member Avatar for JoshuaBurleson
0
1K
Member Avatar for srednakun

Hello, I am not sure why, when I call my method, it goes into a continuous loop and prints out nothing. The operator - method is suppose to be able to subtract a Date object and a Date argument. I will clarify if anything needs clarifying, thanks for the help …

Member Avatar for tkud
0
153
Member Avatar for natha_peepli

#include<stdio.h> #include<string.h> main() { int n; char aan = 'y'; while (aan == 'y') { printf("entr ") ; scanf ("%d", &n) ; printf("sq of %d is %d", n, n*n ); scanf ("%c", &aan); printf("\n want aan y/n""\n"); } } I want to make this using while loop. kindly tell me …

Member Avatar for asitmahato
0
102
Member Avatar for CeeGee

Hi all, I am a newbie to C# and need help bad. I am to use looping (do,for, while or any combination).The program will accept a letter 'A' example and then end. What am i doing wrong. Three salespeople work at Sunshine Hot Tubs-Andrea, Brittany, and Eric. Write a program …

Member Avatar for ddanbe
0
1K
Member Avatar for Ravenn

hi, i put together this code to read a text file line by line, split the resulting string into the 4 values and send these values to four text-boxes. during each cycle of that while loop it's suppose to initialize the backgroundworker_dowork, which will read the values and use them(and …

Member Avatar for Ravenn
0
542
Member Avatar for mr3k

Hello! I've been stuck with this for a while now. First I want to say that this is a school project and not something illegal bet site. The first MySQL table have results from games and the other table contains users bets on different games.. My problem is that I …

Member Avatar for diafol
0
110
Member Avatar for adamworld

I have code where I am pulling data from my database and it needs to be separated by commas except the last value (that part works) so I can take those values and input into another SQL query. Here is the working code: [CODE]$biz_id = $row_businesses['id']; $query_related = sprintf("SELECT * …

Member Avatar for adamworld
0
107
Member Avatar for klemme

Hey, I have a question on how to make an inline style to this..: [CODE] $sqlCommand = "SELECT * FROM pages WHERE subjectid='" . $subjectid . "' AND showing='1' ORDER BY pos ASC"; //*** $query = mysqli_query($myConnection, $sqlCommand) or die (mysqli_error()); $PageMenuDisplay = ''; while ($row = mysqli_fetch_array($query)) { $pid …

Member Avatar for klemme
0
156
Member Avatar for oybek

Hi guys, I'm not good at programming so would you help me with this?! No fancy codes, just make it simple. Problem Statement For research purposes and to better help students, the admissions office of my college wants to compare how well female and male students perform in certain courses. …

Member Avatar for oybek
0
159
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 ilikepaste

So I'm trying to define a counter in a while loop, and print it from the class: [CODE]public class odd { public static void main(String[] args) { System.out.println("Input your number"); int x = IO.readInt(); int odd = 0; int even = 0; while (x != 0) { if (x % …

Member Avatar for ilikepaste
0
228
Member Avatar for br007

Here is the snippet of code I am having issues with. cout<<"So are you a male or female, Please type m/f"<<endl; cin>>sex; if (sex='M','m') { alcohol_distribution=.73; } else if (sex='F','f') { alcohol_distribution=.66; } So I know I have this terribly wrong, but i want the alcohol_distribution based on whether or …

Member Avatar for br007
0
118

The End.