637 Topics

Member Avatar for
Member Avatar for TheFueley

I'm having trouble figuring out how to use exceptions to check if a file stream was created successfully. I know I can use if statements, but how do I do this using try/catch statements? It compiles successfully but it gives me an error when I supply a non-existent filename as …

Member Avatar for TheFueley
0
8K
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
Member Avatar for theweirdone

Hi, I'm pretty new to CakePHP, and have been managing so far. I've created a scraper that scrapes TV.com for episode information (episode number, airdate, title, description). The scraper works fine, and returns an array such as: [CODE]Array ( [0] => Array ( [name] => Stowaway [number] => 17 [description] …

Member Avatar for jkon
0
325
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
234
Member Avatar for beejay321

[CODE]int userChoice(){ int choice; cin>> choice; while (choice!=1 && choice!=2){ cout<<"that is not a valid choice please choose again "; cin>>choice;} return choice; }[/CODE] the whole point of this is that if a user doesnt enter 1 or 2 then it tells them to enter 1 or 2 and wont …

Member Avatar for Crutoy
0
246
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
120
Member Avatar for Lelly

Hello, Can anybody explain to me how can I do: Implement the Random partitioning version of Quicksort. Take care that your data array is not copied (by value) into your subroutines, because you will sort the RandomEnglishDictionary.txt file. Report the first, 1000th and last elements in your sorted list. Thanks

Member Avatar for mrnutty
0
530
Member Avatar for iamthesgt

This is homework. I am not asking for someone to write this code for me, just to help me understand how to solve my problem. I have to take two lists or integers inputted by the user, sorted in ascending order and combine them using pass-by-reference to return a pointer …

Member Avatar for iamthesgt
0
308
Member Avatar for Craftknight

Hello, I just wrote my first code with a while loop and I am getting strange results. The program is supposed to give a Fahrenheit (TF) to Celsius (TC) conversion for every 5 degrees Fahrenheit increases between 0 and 100. It increases the value of TF just fine but in …

Member Avatar for Craftknight
0
94
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
193
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 keicola

hi, i'm currently learning C on my own. i explicitly made a binary tree just to see if my postorder procedure works. i have no idea why but at the end of running the program, before it does the last procedure, this appears: [IMG]http://i56.tinypic.com/2nb52xx.jpg[/IMG] everything else works fine. i know …

Member Avatar for keicola
0
171
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
134
Member Avatar for EneilShade

I was humming along, and decided to try out data sorting. So, I did a few pieces of research, and came up with a really cool looking algorithm: Quicksort. I did what I should have, and started to program. Now, here is where I sound like an idiot: Why is …

Member Avatar for EneilShade
0
219
Member Avatar for Mayank23

how would be able to display all the names a user entered. the user entered the names through a while loop

Member Avatar for alaa sam
0
106
Member Avatar for Mayank23

how can i display all the account numbers that have been entered. it only shows the last account number entered, not any before it. heres the code- [code] #include <iostream> using namespace std; int main() { double deposit; double previous; double newtotal; double withdraw; int total; int number; int res; …

Member Avatar for Mayank23
0
176
Member Avatar for Mayank23

i made a bank program, it askas the users to put in their account number. it works with a while loop. i ask for the person to enter 1 to start or 0 to stop. i need help on how to display all the account numbers that were entered once …

Member Avatar for Mayank23
0
115
Member Avatar for AdriftUniform

Hi, I have created a system where users can follow another user, I am currently querying the table to display who is following who. I have two queries as shown below: [code=php] // followers query $query = "SELECT * FROM friends WHERE friFriend='$view'"; $result = queryMysql($query); $num = mysql_num_rows($result); // …

0
112
Member Avatar for Kadafiz

[CODE] class test{ function load($mailID,$message){ echo $mailID; echo $mesage; } function test1($arr,$message){ foreach($arr as $mailID){ $mailID = $mailID.","; $this ->load($mailID,$message); } } }[/CODE] this is my code ... bt this is nt correct.. actually i need is function test1 get mailadresses and message for the mail.. arr is a array. …

Member Avatar for Kadafiz
0
168
Member Avatar for bangor_boy

What is a better way to write the code, [CODE] public void showFeelings(int howManyGoals) { switch (howManyGoals) { case 0: System.out.println("Oh dear, not very good"); break; case 1: System.out.println("Oh dear, not very good"); break; case 2: System.out.println("Oh dear, not very good"); break; case 3: System.out.println("Ive seen donkeys shoot better"); break; …

Member Avatar for JKP()
0
183
Member Avatar for damsean102

I've built a blog where the user can attach a PDF to a post. This all works fine apart from one small minor detail. I call the details from the MYSQL database on the home page and use a while loop to go through the results. In the DB there …

Member Avatar for damsean102
0
1K
Member Avatar for rotexhawk

I get the following error from running this code. Was wondering if 'i' and 'j' are considered objects. If yes is there any way i could cast them..... How do i write a better for loop for this.... array2D = [[0 for i in range(10)]for j in range(10)] for i …

Member Avatar for djidjadji
0
209
Member Avatar for kiran.madke

hi everyone i want a solution for this. i tried to check a all data from datbase table using dataset with a foreach loop. but this logic check only first row not below that so any one help me to solve this problem so i can check all rows from …

Member Avatar for CrappyCoder
0
766
Member Avatar for Iamthecheese

Hello, I'm getting quite flustered with this program and the errors are starting to get harder to debug. This is my tree.java file: [CODE]package TreePkg; import java.io.FileNotFoundException; import java.lang.SecurityException; import java.util.Scanner; import java.util.NoSuchElementException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.Serializable; import java.io.EOFException; class TreeNode<T extends Comparable <T>> …

Member Avatar for JamesCherrill
0
228
Member Avatar for Basteon

Hi! I'm writing the mergesort algorithm, theoretically everything is fine in it but when the function gets to call itself the program crashes. I belive that I'm doing something worng when I pass the vector<int> as a parameter to the function. [B]procedure mergesort(T[1 .. n]) if n is small then …

Member Avatar for Basteon
0
1K
Member Avatar for lasl0w

Hello, I'm doing a full traversal of a binary search tree structure looking for a node by a field that is not the sort key. If the node i'm looking for is the root node, no problem. If it's any other node then the function has a Seg Fault. Anyone …

Member Avatar for lasl0w
0
198
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 amari ♥

i need help with the following: make a program that gets the summation of a given number e.g. 4+3+2+1 implement it using both iteration and recursion ex. enter a positive number: 4 the sum is 10.

Member Avatar for Shankye
0
164
Member Avatar for Safia Abdalla

I am working on this program in Python that would allow me to scan for a certain phrase in a certain text document. I used the finditer function in Python's re library.The certain line of code resembled the following: [CODE]phrase=regex.finditer(page)[/CODE] I also had a print statement at the end that …

Member Avatar for griswolf
0
12K
Member Avatar for amari ♥

i need help with the following: make a program that would display the nth of the fibonnaci sequence. 1 1 2 3 5 8 13 21 34 55 ... n implement it using both iteration and recursion.

Member Avatar for Shankye
0
155

The End.