142 Topics
| |
I need a program that will ask 16 true or false questions. The game needs to keep going until the user either answers 8 questions correctly or 8 inncorectly. A message should inform the user wether they won or lost and ask if they would like to play again, at … | |
horizontal scroll from while loop Hmmmm, I accidently posted this in the wrong forum. Is there a way to move it? Hey, ive been trying for several hours now to get the list horizontal with scroll instead of vertical. the divs stacks up to the right but wraps at the … | |
Hey all. All I need is to collect every `id` from `servers` where `active ='1'` and then cycle the results in a loop right until the end for each individual id. (I've written this on daniweb, might be typo's or errors. I'm not interested in code errors it's the process … | |
/* Create a program that uses a count controlled loop to read the patient's "readings" from a file and adds them up individually, calculates the average for each person (ID), and displays the two totals. Input - (numPatients-) 20 idNum numBP bpReading (1, 2, 3, 4) 1234 - 4 - … | |
Hello guys, Working on a stock market table with rates of different currencies. What I would like to achieve is that i have an array of rates and would like the difference of today and the previous day, and it works, but i'm getting an empty value for the first … | |
hi every body i want to show in each row 4 items from my db and go to another row (++row) in each row 4 items until end of items of db instead of in each row 1 item please help me here is the code <?php $sql=mysql_query("SELECT * FROM … | |
hi everybody i got this page form some template that shows items in the page with pagination system but i want to keep this method without any pagination i dont want to spilit number of items i just wanna see all of the items that it read from db in … | |
For some reason I am having trouble comparing strings when inside a while statement using the using the && and || operators. while (input.equals("Yes")) && (input.equals("No")) The error message implies the parentheses are ending the statement prematurely. Can someone please give me a suggestion? Thanks, Jim | |
I'm trying to use a while loop to read in some files, but it only reads once and quits. Not sure what's wrong, professor says this is how it should work as long as I'm understanding him correctly. void populateStruct(ifstream &filein, WordStruct Words[1000], int &itemamount) { while (filein >> Words[itemamount].Word); … | |
Hello, i wanted to know what you guys use with PDO. Do you use ->fetchAll() or ->fetch() + while based on some reading i have done, it seems that PDO->fetchAll() is faster but uses more momory... | |
Hello I am trying to run a perl script on tomcat server. I am putting the incoming http request in a variable data which collects the headers as well as the text file attachment data. The code is like this : .... while(<>){ $data = $data . $_ ; } … | |
Hello, I am hoping someone can help me understand a piece of code i found. Since php is not my primary language, and what i googled returned vague results, i am unsure exactly how a number or integer value can be used directly as a boolean in a while operation. … | |
While lunching the application in TOMCAT 5.5 and JDK 1.5 I am getting below exception could some help me in resolving the issue Jul 25, 2012 4:12:50 AM org.apache.catalina.core.ApplicationDispatcher invoke SEVERE: Servlet.service() for servlet jsp threw exception java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagAttributeInfo.<init>(Ljava/lang/String;ZLjava/lang/String;ZZ)V at org.apache.jasper.compiler.TagLibraryInfoImpl.createAttribute(TagLibraryInfoImpl.java:572) at org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoImpl.java:401) at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:248) at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:162) at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418) at … | |
hey, guys, was wondering if i could get some help with this school assingmnet. no, im not asking for code. more like guidance and clarification. the following is the assignment itself: *You are required to create a Visual Basic application for the Roytec Examinations Department. The program must accept student … | |
Hello again. I am trying to create a simple code that can compute the average of a set of numbers read in using a scanner. import java.util.Scanner; public class Average { public static void main(String[] args) { double number = 0; double total = 0; int count = 0; Scanner … | |
I need a simple script to echo current date 600 times once every second redirect it to a text file and follow the file as it grows using a tail command. | |
so the code is pretty simple. it just loops and if statements. first i have a main. i took the headers and prototypes out to make it smaller. In main all iam doing is asking user to enter command and call one funtion. // main.c int main(int argc, char *argv[]) … | |
hi i am using fedora 14 and 16....while executing the parallel programs in c i am getting segmentation fault(core dumped) when i give the array size more than 100000 .... | |
Hi, Is this a valid while loop? : while((grid[tr][tc]=='0'||grid[tr][tc]==s[i]) && tr<row && count<strlen(s)) { ++count; ++tr; } Although the full program compiles fine, but *sometimes* my program crashes during runtime giving me a "Access violation(Segmentation Fault)" error and the debugger points to this loop statement... By the way, I'm using … | |
Hi all I apologies again in advance for the seemingly stupid question. I have tried googling this once but can't see to get the answer i'm looking for. Basically i have a form which can query the database depending upon what the user has selected. The trouble is if multiple … | |
I'm trying to seem if(t3.alive) is not ever entered. It successfully goes through t1 and t2 if statment but skips over three. I've tried the do while, while (like seen). I would think if t3 is still alive the loop would still go then once it's not, its out but … | |
Hi, I can't figure out what I'm doing wrong here. It must be the simplest thing, but the script is meant to add asterisks only after the numbers 1, 2, or 3. Instead it is appending one to each number. Please help. <SCRIPT LANGUAGE="JavaScript"> var number=1; var is1or2or3; function checkIf1or2or3(n){ … | |
Ok now i am having a retarded issue im sure. but here is what is supose to happen is n is not allowed to be more than 5 but when i run this and enter in 5 i get a blank space and when i enter 1-4 i get the … | |
So the program I'm writing should count how many of each individual vowel is in the program and then print that. I'm basically stuck with while and conditional statements. I think my if statement is where I've gone wrong. I'm not sure how to have it read the letter properly … | |
Hey, guy I'm having some trouble with my function see below: bool tryAgain() { char answer; cout << "Do you want to enter another number? (Y/N): "; cin >> answer; answer = toupper(answer); while(answer != 'Y' || answer != 'N') { cin.clear(); cin.ignore(10, '\n'); cout << "Input invalid." << endl; … | |
Wassup Guyz, I got this laptop Toshiba Satellite and everytime i play games the screen freezes in every 15 sec. Pls Help me Out=) Pc: Processor:AMD Turion X2 Ultra Dual-Core Mobile ZM 80 2.10Ghz Ram:4GB System:Windows 7 64 bits | |
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 … | |
I'm writing some while loops but I feel like there is a better way to write them. [CODE]int i=3; while (i<31) { cout << i << " "; i+=3; } //this one is for the first 10 terms of a sequence starting with 3 and adding 3 each time. int … | |
im trying to make a simple calculator: [CODE] loop = 1 while loop == 1: print "Welcome to Jakes' Calculator" print "1) addition" print "3) multiplication" choice = raw_input("Enter a number 1-4: ") break if choice.strip() == "1": a = input("enter the first number: ") b = input("enter the second … | |
Hi, The following code is working without errors: [CODE] <table> <tr> <td>Booking No.</td> <td>Driver Id</td> <td>Time Booked</td> <td>From</td> <td>Pick Up Time</td> <td>To</td> <td>No. of Passengers</td> <td>Distance</td> <td>Cost</td> </tr> <?php $stmt = $dbh->prepare("SELECT * FROM Booking WHERE cust_id = '$username' "); $stmt->execute(); while($row = $stmt->fetch(PDO::FETCH_ASSOC)){ echo "<tr><td>".$row['booking_no']."</td>". $row['driver_id']."</td>". $row['time_booked']."</td>". $row['pick_up_dest']."</td>". $row['pick_up_time']."</td>". … |
The End.