The Artima Developer Community
Sponsored Link

Java Answers Forum
I need help!

1 reply on 1 page. Most recent reply: Mar 24, 2009 2:50 AM by Vincent O'Sullivan

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Daniel Arndt

Posts: 1
Nickname: darndt1
Registered: Mar, 2009

I need help! Posted: Mar 23, 2009 6:22 PM
Reply to this message Reply
Advertisement
I was wondering if anybody could help me with this problem I have no idea how to write or start or anything. PLEASE! Thanks so much

Write a structured program with procedures which provides the options
of converting a number from base 8 to 10 and from base 10 to 8. It is a
good idea to have a procedure for each option. Assuming the user only
input integers, the program should make sure the input number is valid,
and return an error message if a mistake is made. For example, 967 is
invalid for a number of base 8.
Hint: Make use of the pre-de ned string functions as much as possible
(http://java.sun.com/j2se/1.4.2/docs/api/), except Integer.toOctalString(.).
The algorithms for conversion between bases are in 3 primitive-data. For
coding, to convert '0' (a character) to 0 (a number), do the following:
(int)'0'-48
To convert an integer i to a string do:
Integer.toString(i);


Vincent O'Sullivan

Posts: 724
Nickname: vincent
Registered: Nov, 2002

Re: I need help! Posted: Mar 24, 2009 2:50 AM
Reply to this message Reply
> I have no idea how to write or start or anything.

Naturally. That will be why you're at school. Have you tried consulting your course notes or any of the reccommended course books or web sites?

Flat View: This topic has 1 reply on 1 page
Topic: JButton Problem Previous Topic   Next Topic Topic: guys take a look.. i need your help...plz..plz..

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use