oha055's Profile
Reputation: 39
Craftsman
- Group:
- Active Members
- Active Posts:
- 229 (0.15 per day)
- Joined:
- 02-February 09
- Profile Views:
- 2,588
- Last Active:
May 06 2013 12:08 PM- Currently:
- Offline
Previous Fields
- Country:
- NO
- OS Preference:
- Linux
- Favorite Browser:
- FireFox
- Favorite Processor:
- Intel
- Favorite Gaming Platform:
- Nintendo
- Your Car:
- Who Cares
- Dream Kudos:
- 0
Latest Visitors
-
darek9576 
17 Apr 2013 - 09:20 -
burakaltr 
24 Mar 2013 - 18:05 -
The_Programmer- 
18 Mar 2013 - 11:20 -
kamikazeren 
04 Nov 2012 - 15:42 -
ikram002p 
27 Jun 2012 - 10:47 -
Paci 
05 Jun 2012 - 02:14 -
macosxnerd101 
21 May 2012 - 16:47 -
ishkabible 
19 May 2012 - 10:57 -
modi123_1 
18 May 2012 - 19:08 -
pascal7 
13 May 2012 - 15:58
Posts I've Made
-
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; -
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); } -
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) -
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)
-
In Topic: Cannot seem to get the JButton "exit" to work
Posted 20 Mar 2013
Your problem is here:
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:
- D.I.C Head
- 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
Contact Information
- E-mail:
- Click here to e-mail me
- Website URL:
-
http://www.ohauge.net
- Facebook:
- http://www.facebook.com/oyvindshauge
Friends
|
|


Find Topics
Find Posts
View Reputation Given
|
Comments
oha055 has no profile comments yet. Why not say hello?