Newsgroup: it.comp.lang.javascript
Titolo: i need some help please

I am writting a program for my second assignment in my CS class and i am
having a real hard time Could some one be of any help, Thanks
This is what i have but i dont think its correct. it compiles but i dont
know.
public class MyClassOne
{
//Default Constructor is initiated with 20 and 10
public MyClassOne()
{
firstNumber = 20;
secondNumber = 10; }
//Constructor with one argumetn that initializes the firstNumber only,
secondNumber would be zero by default
public MyClassOne(double fNumber)
{
fNumber = firstNumber;
}
//Constructor initializes both firstNumber and secondNumber
public MyClassOne(double fnum, double snum)
{
fnum = firstNumber;
snum = secondNumber;
}
//Returns firstNumber
public double getFirstNumber()
{
return firstNumber;
}
//Returns secondNumber
public double getSecondNumber()
{
return secondNumber;
}
//Replaces firstNumber with fn
public void firstNumber(double fn)
{
firstNumber=fn;
}
//Replaces secondNumber with sn
public void secondNumber(double sn)
{
secondNumber=sn;
}
//Returns the product of the firstNumber and secondNumber
public double multiplyTwoNumbers()
{
return firstNumber*secondNumber;
}
//Prints firstNumber and secondNumber on the screen
public void printNumbers()
{
System.out.println("firstNumber, secondNumber");
}
//Substract number from the product of firstNumber and secondNumber
public double subParmeter(double number)
{
return firstNumber*secondNumber-number;
}
//Swaps firstNumber to secondNumber and vice-versa
public void swapStorage(double temp)
{
firstNumber=temp;
secondNumber=firstNumber;
temp=firstNumber;
}
//Returns square of the firstNumber
public double getSquareFirst()
{
return Math.pow(firstNumber, 2);
}
//Returns square of the secondNumber
public double getSquareSecond()
{
return Math.pow(secondNumber, 2);
}
//Returns the sum of the squares of the firstNumber and secondNumber
public double getSumSquares()
{
return Math.pow(firstNumber, 2)+Math.pow(secondNumber, 2);
}
private double firstNumber;
private double secondNumber;
}
this is the assignment:
Write a class based on the following information:
  a.. Name of the class: MyClassOne - you need to save this class in a file:
MyClassOne.java
  b.. Instance fields:
    a.. private double firstNumber
    b.. private double secondNumber
  c.. Constructors:
    a.. public MyClassOne() : default constructor should be initiated with
20 and 10.
    b.. public MyClassOne(double fNumber) : constructor with one argument
that initializes the firstNumber only, secondNumber would be zero by
default.
    c.. public MyClassOne(double fnum, double snum) : constructor
initializes both firstNumber and secondNumber.
  d.. Methods:
    a.. public double getFirstNumber() : return firstNumber.
    b.. public double getSecondNumber() : return secondNumber.
    c.. public void firstNumber(double fn) : replace firstNumber with fn.
    d.. public void secondNumber(double sn) : replace secondNumber with sn.
    e.. public double multiplyTwoNumbers() : return the product of
firstNumber and secondNumber.
    f.. public void printNumbers() : print firstNumber and secondNumber on
the screen.
    g.. public double subParameter( double number): substract number from
the product of firstNumber and secondNumber and then return the value.
    h.. public void swapStorage(): swap firstNumber to secondNumber and
vice-versa.
    i.. public double getSquareFirst(): return square of the firstNumber.
    j.. public double getSquareSecond(): return square of the secondNumber.
    k.. public double getSumSquares(): return sum of the sqaures of
firstNumber and secondNumber.
  Write a program based on the following information:
  The program must be saved in a file: MyClassOneTest.java
    1.. Create an object myObject1 with the default constructor.
    2.. Print out the firstNumber and secondNumber of myObject1
    3.. Create another object myObject2 with constructor public
MyClassOne(double fNumber) with argument 15.
    4.. Print out the firstNumber and secondNumber of myObject2.
    5.. Create an object myObjec3 with arguments 5,8.
    6.. Print out the product of firstNumber and secondNumber of myObject3
invoking an appropriate method.
    7.. Print out the firstNumber and secondNumber of myObject3.
    8.. Change the firstNumber of myObject3 from 5 to 8 and secondNumber
from 8 to 5 by invoking the method: public void swapStorage().
    9.. Print out the firstNumber and secondNumber of myObject3.
    10.. Change the firstNumber 8 of myObject3 to 100.
    11.. Print firstNumber of myObject3.
    12.. Create an object myObject4 with arguments 3 and 5.
    13.. Print out the sum of the squares of firstNumber and secondNumber.
  Note: All print out statements should print the name of the variable(s) as
well as the value of the variable. For example: The value of the first
number of myObject1 is 20.
  What to turn in:
    a.. A signed copy of the cover sheet found at the CSIS2301 Fall 2002 web
site( the same place that you found this assignment).
    b.. A 3 1/2" diskette with the files MyClassOne.java and
MyClassOneTest.java stored in the root directory (folder). These files
should contain the Java programs written as the answers to the programming
exercises listed above.
    c.. Printouts of the files MyClassOne.java and MyClassOneTest.java
    d.. Printout of the documentation (public interface) of MyClassOne
    e.. All printouts and the external label on the diskette should be
labeled with your name, your instructor's name, the course number and
section (example:CSIS 2301/3), and the assignment number (this is assignment
# 2). For program files, this information should also be shown in comments
at the top of the program file itself.
    f.. The diskette and the printouts should be securely attached to each
other in some fashion (e.g. a folder with a diskette pocket, or a binder
clip - a regular paper clip will NOT hold them securely). The cover sheet
should be on top of the other printouts.

 [... cut ...]
1st of all: here the [it] stands for "italian" non for anything else;
2nd: ask in some JAVA newsgroup, not JavaScript. It's not the same thing.
-- 
Ciao, Riccardo
------------------------------------------------------------------------
http://www.jsdir.com
 ---- Bring Your Site To Life!!!!
------------------------------------------------------------------------
http://www.dev2dev.it
 - La rete ha connesso nuove particelle - D2D006
------------------------------------------------------------------------
 ----> itALY = it <----