Java program help  
Author Message
programwiz08





PostPosted: 2004-7-27 23:05:00 Top

java-programmer, Java program help Hello everyone, I need your help.. can you check why did i commit an
error on the n=System.read("enter numer:"); part...? Thanks in
advance...
By the way, the program will run as follows:
the user will input a number, and the program will generate the
fibonacci series based on the number. if example user input is 4,
there should be four series of fibonacci...:)

public class fibonacci
{


public static void main(String args[])
{
int prev1 = 1, prev2 = 1, current = 1;int n;
n = System.read("enter number: ");
for (int i = 3; i <= n; i++)
{
current += prev2;
prev2 = prev1;
prev1 = current;
System.out.println(" " + current);
}

}
}
 
Claudio Alberto Andreoni





PostPosted: 2004-7-27 23:31:00 Top

java-programmer >> Java program help Maybe because a method called int System.read(String)
I think you have to use the methods of the InputStream System.in.
You can do something like this:
java.io.BufferedReader br = new java.io.BufferedReader(new
java.io.InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());

Pats wrote:

> Hello everyone, I need your help.. can you check why did i commit an
> error on the n=System.read("enter numer:"); part...? Thanks in
> advance...
> By the way, the program will run as follows:
> the user will input a number, and the program will generate the
> fibonacci series based on the number. if example user input is 4,
> there should be four series of fibonacci...:)
>
> public class fibonacci
> {
>
>
> public static void main(String args[])
> {
> int prev1 = 1, prev2 = 1, current = 1;int n;
> n = System.read("enter number: ");
> for (int i = 3; i <= n; i++)
> {
> current += prev2;
> prev2 = prev1;
> prev1 = current;
> System.out.println(" " + current);
> }
>
> }
> }

 
Claudio Alberto Andreoni





PostPosted: 2004-7-27 23:31:00 Top

java-programmer >> Java program help Claudio Alberto Andreoni wrote:

> Maybe because a method called int System.read(String) does not exist.
> I think you have to use the methods of the InputStream System.in.
> You can do something like this:
> java.io.BufferedReader br = new java.io.BufferedReader(new
> java.io.InputStreamReader(System.in));
> int n = Integer.parseInt(br.readLine());
>
> Pats wrote:
>
>> Hello everyone, I need your help.. can you check why did i commit an
>> error on the n=System.read("enter numer:"); part...? Thanks in
>> advance...
>> By the way, the program will run as follows:
>> the user will input a number, and the program will generate the
>> fibonacci series based on the number. if example user input is 4,
>> there should be four series of fibonacci...:)
>>
>> public class fibonacci
>> {
>>
>>
>> public static void main(String args[])
>> {
>> int prev1 = 1, prev2 = 1, current = 1;int n;
>> n = System.read("enter number: ");
>> for (int i = 3; i <= n; i++)
>> {
>> current += prev2;
>> prev2 = prev1;
>> prev1 = current;
>> System.out.println(" " + current);
>> }
>>
>> }
>> }

 
 
r9937





PostPosted: 2004-10-26 19:24:00 Top

java-programmer >> Java program help Answers in programming language : Java


Question 1: Explain the difference between the following modifiers
through examples:

?Abstract
?Final Class
?Public

Question 2: Through a small example, Explain the following:

i) Concept of Subclasses, Super classes and Inheritance
ii) What is the name of the top most class in the Java and where it
is defined

Question 3: List and explain the main features of Java (for e.g.
multi-threading) and identify the classes/package through which they
are supported.



This is a Project Assignment. Answer the following question using
Java.

Suppose that you have to computerize a car show room which keeps the
latest models of cars, and provides post sales services to customers.

(i) List all important classes, their data structures and other
attributes.
(ii) Draw an inheritance diagram for the entire application which
should comprise of base classes and sub-classes.
(iii) Implement at least 3 modules.
(iv) Describe different reports to be produced by the programmer.


i am bca student need answers as earlest as possible help me iwill
thank full to those who will help me
thankyou
 
 
Joona I Palaste





PostPosted: 2004-10-26 20:51:00 Top

java-programmer >> Java program help rohit srivastava <email***@***.com> scribbled the following:
> Answers in programming language : Java

> Question 1: Explain the difference between the following modifiers
> through examples:

> ?Abstract
> ?Final Class
> ?Public

> Question 2: Through a small example, Explain the following:

> i) Concept of Subclasses, Super classes and Inheritance
> ii) What is the name of the top most class in the Java and where it
> is defined

> Question 3: List and explain the main features of Java (for e.g.
> multi-threading) and identify the classes/package through which they
> are supported.

> This is a Project Assignment. Answer the following question using
> Java.

> Suppose that you have to computerize a car show room which keeps the
> latest models of cars, and provides post sales services to customers.

> (i) List all important classes, their data structures and other
> attributes.
> (ii) Draw an inheritance diagram for the entire application which
> should comprise of base classes and sub-classes.
> (iii) Implement at least 3 modules.
> (iv) Describe different reports to be produced by the programmer.

> i am bca student need answers as earlest as possible help me iwill
> thank full to those who will help me
> thankyou

How about doing your homework yourself? Sheesh, the way you copied
your assignment word-for-word doesn't make it look like you intend to
bother trying it yourself at all. What do you think you're in school
for, anyway?

--
/-- Joona Palaste (email***@***.com) ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"As a boy, I often dreamed of being a baseball, but now we must go forward, not
backward, upward, not forward, and always whirling, whirling towards freedom!"
- Kang
 
 
zutroi





PostPosted: 2004-11-8 7:02:00 Top

java-programmer >> Java program help Andrew Thompson wrote:
> <http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#field_summary>
>
> [ you would get a much longer and better answer
> on c.l.j.help, I assure you.. ]

thankyou for the pointer. luckily i have subscribed to c.l.j.help
already. can i ask one question of you? what is the charter of
c.l.j.programmer? i would have thought that if you had a java
programming question that this might be an apporopriate place to start?
correct me if i'm wrong, and i know that you will :-)

--
bob (rdr00)

Outgoing mail is NOT certified Virus Free.
For all I know, there's a dirty big fsckin' virus stuck onto
the end of this message and if you're using a Microsfot product,
then I'd say that you're fscked.
 
 
Chris Smith





PostPosted: 2004-11-8 8:20:00 Top

java-programmer >> Java program help zutroi wrote:
> thankyou for the pointer. luckily i have subscribed to c.l.j.help
> already. can i ask one question of you? what is the charter of
> c.l.j.programmer? i would have thought that if you had a java
> programming question that this might be an apporopriate place to start?
> correct me if i'm wrong, and i know that you will :-)

The charter for .programmer is:

This unmoderated group is for problems and discussion relating to
Java as a language, programming in general and the application of
libraries and APIs not covered under other groups.

If traffic is high enough, this group may later be split
functionally. In the meantime, posts specific to a class or package
should include its name at the beginning of the title, for example,
[awt], [sun.net], etc., to facilitate easy filtering.

That's all academic, though. There is no mechanism to update a charter
for a Big-12 newsgroup, and as a result charters rarely describe the
actual usage of groups. Lurking is encouraged to determine that. For
example, .help is quite frequently used for involved programming
questions, despite its charter that encourages mostly setup/install
questions and only the most simple of programming problems.

There's currently a vague understanding that "beginner" questions go to
.help and "advanced" questions go to .programmer. Nevertheless, there's
never really been a determined effort in the past to sort traffic to the
correct groups. Andrew has attempted to start such an effort in the
past year or so, and a few other people have jumped on the bandwagon.
I'm of the opinion that it does more harm than good, especially when (as
has occasionally been the case recently) it causes people to feel
justified in being rude to new posters.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
 
Andrew Thompson





PostPosted: 2004-11-8 11:55:00 Top

java-programmer >> Java program help On Sun, 07 Nov 2004 23:02:15 GMT, zutroi wrote:

> what is the charter of c.l.j.programmer?

Pretty much what Chris said, ..but since I have an URL.
<http://www.physci.org/codes/javafaq.jsp#groups>

Note the caveats that Chris added. Ultimately a group
is shaped by the contributors.

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
 
 
somekid413





PostPosted: 2006-1-13 4:57:00 Top

java-programmer >> Java program help Hi, I have to write the following program for class...and I have no idea
where to start
if anyone would be so kind as to point me in the right direction (or write
the program) i would be very appreciative

1. Write a class named Pupil that implements Comparable. It has four
instance variables of type String and double (Name, testl, test2, test3, and
average). The constructor must input the test scores from the user, and call
the computeAverage method to initialize the instance variable, average. In
addition, the class must have getters for each instance variable. It must
also have a private helper method called computeAverage that returns the
average of all three test scores. And a compareTo method that compares two
students. It must work like all compareTo methods such that it takes in an
Object parameter and returns 1 if the object that called it is greater
returns -1 if they are equal, it returns 0.
2. Create a TestPupil class (must put import Java.lang; at the top) that
prompts the user for the number of students in the class prompts the user to
enter the information about all students in the class and creates a student
object for each pupil. Stores the students in an arrayList and calls the
compareTo method which compares all the students to all the other students in
the class

Thanks
-A
 
 
Eric Sosman





PostPosted: 2006-1-13 5:48:00 Top

java-programmer >> Java program help

somekid413 wrote On 01/12/06 15:56,:
> Hi, I have to write the following program for class...and I have no idea
> where to start [...]

The instructions seem pretty straightforward, so if you
have no idea where to start you must be having pretty serious
trouble with the class. I strongly recommend that you talk
with your professor about the difficulties you're having; you
may need some extra tutoring. Do it now, while the semester
is still young: In the early going your professor may be able
to help you overcome your problems and catch up, but if you
just sit there comprehending nothing and letting the class
wash over you, the professor may not become aware of how far
behind you are until you're so far behind there's no hope.

The professor wants you to learn -- so if you want to
learn, go have that talk. Now!

> if anyone would be so kind as to point me in the right direction (or write
> the program) i would be very appreciative

I see that the "if you want to learn" is not exactly
a tautology.

--
email***@***.com

 
 
IchBin





PostPosted: 2006-1-13 14:38:00 Top

java-programmer >> Java program help somekid413 wrote:
> Hi, I have to write the following program for class...and I have no idea
> where to start
> if anyone would be so kind as to point me in the right direction (or write
> the program) i would be very appreciative
>
> 1. Write a class named Pupil that implements Comparable. It has four
> instance variables of type String and double (Name, testl, test2, test3, and
> average). The constructor must input the test scores from the user, and call
> the computeAverage method to initialize the instance variable, average. In
> addition, the class must have getters for each instance variable. It must
> also have a private helper method called computeAverage that returns the
> average of all three test scores. And a compareTo method that compares two
> students. It must work like all compareTo methods such that it takes in an
> Object parameter and returns 1 if the object that called it is greater
> returns -1 if they are equal, it returns 0.
> 2. Create a TestPupil class (must put import Java.lang; at the top) that
> prompts the user for the number of students in the class prompts the user to
> enter the information about all students in the class and creates a student
> object for each pupil. Stores the students in an arrayList and calls the
> compareTo method which compares all the students to all the other students in
> the class
>
> Thanks
> -A

Apparently your are not paying for you eduction. So how much is it worth
to you for me to write it for you...

--

Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)