## oha055's Profile User Rating:

Reputation: 39 Craftsman
Group:
Active Members
Active Posts:
229 (0.13 per day)
Joined:
02-February 09
Profile Views:
3,441
Last Active:
Nov 20 2013 05:46 PM
Currently:
Offline

### Previous Fields

Country:
NO
OS Preference:
Linux
Favorite Browser:
FireFox
Favorite Processor:
Intel
Favorite Gaming Platform:
Nintendo
Who Cares
Dream Kudos:
0

### Latest Visitors

oha055 has not set their status

1. #### In Topic: Reading time name...

Posted 19 Apr 2013

When you return from a method, code beneath the return stement is diregarded. That is why you only get hours. Rather than returning the strings directly, you should store them in a variable, and then at the end of the method return this variable.

String hoursAndMins = "";

if(hours == 1) hoursAndMins += "one";

...

if(mins == 30) hoursAndMins += "thirty";

...

return hoursAndMins;
2. #### In Topic: Need help with recursive method

Posted 19 Apr 2013

Finally got it working! damn.. that took some time.

(Since the assignment required me to use only a single function, I couldn't use jons answer.)

For future reference, here is what I did:
```	public static int rec(int n) {
if(n == 0) return 3;
return rec(n-1)*rec(n-1);
}

```
3. #### In Topic: Need help with recursive method

Posted 17 Apr 2013

Thanks again! very much appreciated!

One last question though, would my initial solution work in theory? Given unlimited resources. The reason I'm asking is that the assignment was to write pseudocode on paper. (discrete mathematics-course)
4. #### In Topic: Need help with recursive method

Posted 17 Apr 2013

Thanks for your reply jon! Cant do 9^n though, since what I am computing isnt (3^2)^n but (3)^(2)^(n)
5. #### In Topic: Cannot seem to get the JButton "exit" to work

Posted 20 Mar 2013

```else //code to execute if the user clicks exit
{//open else
try
{
output.close();
}
catch(IOException c)
{
System.exit(0);
}
}//close else

```

With your try/catch block you are telling the program to only exit if there is an I/O exception. Why? Just remove the try/catch and you should be fine

### My Information

Member Title:
Age:
26 years old
Birthday:
January 20, 1987
Gender:
Location:
Voss/Bergen, Norway
Interests:
computers, music, photography, beer
Full Name:
Øyvind Hauge
Years Programming:
5
Programming Languages:
PROFICIENT: Java, PHP
OTHER: jQuery/JavaScript, CSS, HTML5, XML, Prolog
CURRENTLY LEARNING: Android, C++, Python

E-mail: