Skip to content

Code Structure III - Constructors Challenge 2 - Typos #232

@BryanF1nes

Description

@BryanF1nes
enum Quality {
    SUPA_FINE,
    FINE,
    SUB_FINE
}

// CODE HERE

void main() {
    Shoe jays = new Shoe("Air Jordans", Quality.FINE, 130.0);
    IO.println(
        "SHOE: " + jays.name + ", " + jays.quality + ", $" + jays.price
    );

    Shoe nike = new Shoe("Nikes", Quality.SUB_FINE, 25);
    IO.println(
        "SHOE: " + nike.name + ", " + nike.quality + ", $" + jays.price
    );


    Shoe moccasin = new Shoe("Moccasins", Quality.SUPA_FINE);
    IO.println(
        "SHOE: " + moccasin.name + ", " + moccasin.quality + ", $" + jays.price
    );
}

There appears to be some inconsistencies here, for both the nike and moccasin instances. My understanding is that they should pull from their respective price attribute and print accordingly.

If this logic is true and nike and moccasin instances need to also call their .price respectively then challenge 3 and 4 would need to be updated as well.

I'm happy to update these and submit a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions