These Directions Are Not Clear To Me

These Directions Are Not Clear To Me

I have to make a program that uses two files called coin. One file named coin and the other named coin tester. The directions in the book are confusing to me, but I still tried to do the assignment.

I have to make a program that uses two files called coin. One file named coin and the other named coin tester. The directions in the book are confusing to me, but I still tried to do the assignment.

Here are the directions that were given:

Create a Coin class that includes a variable faceUp that stores either a 0 for heads up or 1 for tails up, an accessor method named showFace() that returns a 0 if the coin is heads up or a 1 if the coin is tails up, and a modifier method named flipCoin() that assigns a random integer between 0 and 1, inclusive, to the variablefaceUp.

Test the class with the following client code:

public class CoinTester{
    public static void main(String[] args) {
        Coin nickel = new Coin();
        if (nickel.flipCoin() == 0) {
            System.out.println("Heads up!");
        } else {
            System.out.println("Tails up!");
        }
    }
}

Here is my code for the file named coin:

public class Coin {
    private int faceUp;

public Coin() {
    faceUp = (int)(Math.random() * 2);
}

public int showCoin() {
    return faceUp;
}

public void flipCoin() {
    faceUp = (int)(Math.random() * 2);
}

}

I know for sure I did it wrong because I'm confused and the program has syntax errors. I feel like it is not possible with the directions im given. The CoinTester is expecting a return method but I am not allowed to because of the directions.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Java Fundamentals: Learn Java for absolute beginners |Simpliv

Java Fundamentals: Learn Java for absolute beginners

Java Essentials : Learn Core Java From Basic to Advance

Learn Java Programming Using Practical Assignments. Start Building Back-end Web Applications Robust Test Automation Frameworks By End Of The Course. Learn More!

Fundamentos de Java: Aprende Java desde cero, sin misterios | Simpliv

Fundamentos de Java: Aprende Java desde cero, sin misterios