package OOP; public class ComputerGame { private String Name; private String Description; private float Cost; private boolean Released; private final String Publisher = "TriWorld Studios"; public ComputerGame(String Name) { Name = this.Name; } public ComputerGame(String Name, float Cost) { Name = this.Name; Cost = this.Cost; } public static void Buy() { System.out.println(" The Buy Method "); } public static void Play() { System.out.println(" The Play Method "); } public static void Store() { System.out.println(" The Store Method "); } public static void Sell() { System.out.println(" The Sell Method "); } public String GetName() { return Name; } public String GetDescription() { return Description; } public float GetCost() { return Cost; } public boolean GetReleased() { return Released; } public void SetName(String Name) { Name = this.Name; } public void SetDescription(String Description) { Description = this.Description; } public void SetCost(float Cost) { Cost = this.Cost; } public void SetReleased(boolean Released) { Released = this.Released; } }
package OOP; public class ComputerGameMain { public static void main(String[] args) { ComputerGame FierceArmour = new ComputerGame("Fierce Armour", "A Strategy Game"); ComputerGame Tennis3D = new ComputerGame("Tennis 3D", "A Sports Game"); ComputerGame TwoDCarton = new ComputerGame("2DCarton", "An Arcafe Game"); FierceArmour.setCost(56.45); FierceArmour.setReleased(true); Tennis3D.setCost(76.34); Tennis3D.setReleased(false); TwoDCarton.setCost(23.99); TwoDCarton.setReleased(true); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)