can someone please make this code
Your class should be called Number. It should contain 6 fields of type int
named correspondingly for numberEntered, firstDigit, secondDigit, thirdDigit,
fourthDigit and fifthDigit. You should have the following methods:
a) default constructor – initializes to "no data" ie zeros.
b) getNumberFromUser – prompts user for the five-digit number and reads in
c) calculateDigits – calculates each of the five digits
d) displayDigits – displays each of the digits on a separate line
Rewrite your main method to declare a reference variable to an object of this
class, use new to create (instantiate) the object, and then call the methods
on the object.
Im new to Java and still dont get this.
Re: can someone please make this code
What have you tried so far? If you're not sure where to start, start by working from the top down:
1. How do you declare a class? What should it be called?
2. What methods do you need? Do you know the parameters? What should the method return?
3. What fields do you need?
4. What should method 1 do?
5. What should method 2 do?