Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
එක පැකේජ් එකයි මාසෙටම Unlimited Internet. තාමත් DATA CARD දාන්න සල්ලි වියදම් කරනවද? අඩුම මිලට අපෙන්.
sayuru bandara
Updated:
Tuesday at 12:30 PM
Ad icon
ඉන්ටර්නෙට් එකෙන් හරියටම සල්ලි හොයන්න සහ Success වෙන්න කැමතිද? 🚀 (E-Money & Success Stories)
siri sumana
Updated:
Saturday at 11:44 PM
Gemini AI PRO 18 months Offer
Hawaka
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Talk!
Java Problem
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="¤--bACarDi--¤" data-source="post: 9867594" data-attributes="member: 160399"><p>hello im not a java expert & languages are mixed up now <img src="/styles/default/xenforo/smilies/default/baffled.gif" class="smilie" loading="lazy" alt=":baffled:" title="Baffled :baffled:" data-shortname=":baffled:" /></p><p></p><p>but did some, i dnt have java so can't compile it. there may be many syntax errors fix them & just implement converting methods lol u DO THE MATH <img src="/styles/default/xenforo/smilies/default/lol.gif" class="smilie" loading="lazy" alt=":lol:" title="LOL :lol:" data-shortname=":lol:" /></p><p></p><p></p><p></p><p>[CODE]</p><p></p><p></p><p></p><p>#import Java.util.*</p><p></p><p>class NumberBaseConverter </p><p>{</p><p> public static void main (String [] args)</p><p> { </p><p> int number, base , decimal;</p><p> Scanner sc = new Scaner();</p><p> System.out.println("Eneter No: ");</p><p> number = sc.nextInt();</p><p> System.out.println("Base of the Entered Number: "); </p><p> base = sc.nextInt();</p><p></p><p> </p><p> switch (base)</p><p> {</p><p> case 2:</p><p> decimal = binaryToDecimal(number); </p><p> break;</p><p> case 8:</p><p> decimal = octalToDecimal(number); </p><p> break;</p><p> case 16:</p><p> decimal = hexaToDecimal(number); </p><p> break;</p><p> default:</p><p> System.out.println("Invalid Input, get a life :P "); </p><p> break;</p><p> }</p><p></p><p> </p><p> System.out.println("Entered Number in decimal = " + decilmal ); </p><p></p><p></p><p> }</p><p></p><p></p><p> public static int binaryToDecimal (int number)</p><p> {</p><p> </p><p> return ;</p><p> </p><p> }</p><p></p><p> public static int octalToDecimal (int number)</p><p> {</p><p> </p><p> return ;</p><p> </p><p> }</p><p></p><p> public static int hexaToDecimal (int number)</p><p> {</p><p> </p><p> return ;</p><p> </p><p> }</p><p></p><p></p><p></p><p>}[/CODE]</p></blockquote><p></p>
[QUOTE="¤--bACarDi--¤, post: 9867594, member: 160399"] hello im not a java expert & languages are mixed up now :baffled: but did some, i dnt have java so can't compile it. there may be many syntax errors fix them & just implement converting methods lol u DO THE MATH :lol: [CODE] #import Java.util.* class NumberBaseConverter { public static void main (String [] args) { int number, base , decimal; Scanner sc = new Scaner(); System.out.println("Eneter No: "); number = sc.nextInt(); System.out.println("Base of the Entered Number: "); base = sc.nextInt(); switch (base) { case 2: decimal = binaryToDecimal(number); break; case 8: decimal = octalToDecimal(number); break; case 16: decimal = hexaToDecimal(number); break; default: System.out.println("Invalid Input, get a life :P "); break; } System.out.println("Entered Number in decimal = " + decilmal ); } public static int binaryToDecimal (int number) { return ; } public static int octalToDecimal (int number) { return ; } public static int hexaToDecimal (int number) { return ; } }[/CODE] [/QUOTE]
Insert quotes…
Verification
Dawasata paya keeyak thibeda?
Post reply
Top
Bottom