Question: how would I write the code? Define this in the Walletjava file. Properties: The class should have properties to hold the number of credit cards,



Define this in the Walletjava file. Properties: The class should have properties to hold the number of credit cards, total amount of cash, and owner name. Encapsulate all the properties by making them private. Private instance variables are more secure and standard practice in most java libraries. Encapsulation is the idea that we can interact with an object, while the actual implementation detalis are hidden. Thirk about an Arraytist. We can add to it, we can get information from it; we can know the amount of data contained within it. To do those things, we used methods (add, get, and size). We do not know how Arraytist grows when we add, or how it retrieves the data, but we know we can use those methods and they will work. The implementation detalls of growing and retrieving were. from us, the users. Constructors - Wilte a constructor with no arguments that defaults the - Write a constructor that takes in only the owrer name and sets the property to the parameter, Default the. instance vaiables to zero. - Write a comstructor that takes in numcreditcards, owner, and totaicash and sets all properties. Define this in the Clockjava file Properties: The class should have properties to track the hour, minute and time zone it should also have a pericd property to track AM or PM. - Use for the hour and properties. - Use for the and the Encapsulate the properties by making them private. Constructors - Write a constructor with na arguments that defauls the time to 12:00AM, Eastein time zone. - Write a constructor that takes in hour, minute, period, and timezone. The constructor should make these checks before setting the properties. Any parameter that isnt valid will be set to the default value instead (12:00 AM, Fastern). o check that hour is between 1:12. Check that minute is betwien o- 50 . Check that period is "AM" or "PM" Check that time zone is "Fasterny CCentral: Mountais, or Paclic: Mothods Write public gettirisetter methods for each property using standard namieng conventions. ToDoltem Define this ciass in file first as it will be used in the class: Dublife class Toboteen 4 1. Hyourictass definition here - Properties: The class should have description, priority, and isbone properties. Constructors - Witie a constructor with no atguments that defaults the string values to empty shings and the boolean to falie. - Write a comatructot that takes in degcription and piority, set those properties and default the isDorve fiag to false: Methods White mubile-getfer/antter methods for each properiy using sandard namisg corientions. Define this class in the ToDoList.java file and set it to public. Properties: The class should have listName, maxitems, and itemlist properties. Constructors - Write a constructor with no arguments that defaults the string values to empty strings and defaults the Instantiate the property to an empty Arraylist. to 10. Remember, to instantiate an empty Arraylist, use the keyword like so: - Write a constructor that takes in and sets the Arraylist in the same way. Methods Write public getter/setter methods for each property using standard naming conventions Do this for the property as well
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
