Create a class date, each object is a value represented the day in the year in form year,month,day.Provide a constructor that enables an object of this class to be initialized when it is instantiated. The constructor should contain default values in case no initializes are provided.Provide Public member functions for each of the following operations: set the day, set the month,set the year, set the date,print the date in the form yyyy,mm,dd , increment the datebyoneday, increment the dateby one month, compare two datesfor equality, and final determine if one dateis “less than” (comes before) another date.Include any additional operations that you think would be useful for your class.Design,implement, and test your class.
Trending nowThis is a popular solution!
Step by stepSolved in 5 steps with 1 images
- Make C# (Sharp): console project named MyPlayList. Create an Album class with 4 fields to keep track of title, artist, genre, and copies sold. Each field should have a get/set property. Your Album class should have a constructor to initialize the title (other 3 variables should default to null or 0). In addition, create a public method in the Album class to calculate amount sold for the album (copies sold * cost_of_album). You determine the cost of each album. Also create a method in the Album class to display the information. Print out of information should look something like this: The album Tattoo You by the Rolling Stones, a Rock group, made $25,000,000. In the main method, create 3 instances of the Album class with different albums, use setters to set values of the artist, genre, and copies sold. And then use getters to display information about each on the console.arrow_forwardin the date classOverload the constructor method as the class diagram showsIn the main program, create three objects of class date, one from each of the constructors.In the main program, overload the showdate method to display the date in the following formatsThe date in dd/mm/yy formatThe date in dd/mm formatThe date in “d of month” formatIn the main program, make use of each of the showdate methods, one with each of the created objects.Send your two files, the date file and the main program where you use the date constructor overload and the showdate method overload.arrow_forwardThe non-static class level variables and non-static methods of a class are known as a. instance members b. object behaviors c. object attributes O d. object referencesarrow_forward
- Select the correct option for the question shown below.arrow_forwardPortfolio Instructions: You are working for a financial advisor who creates portfolios of financial securities for his clients. A portfolio is a conglomeration of various financial assets, such as stocks and bonds, that together create a balanced collection of investments. When the financial advisor makes a purchase of securities on behalf of a client, a single transaction can include multiple shares of stock or multiple bonds. It is your job to create an object-oriented application that will allow the financial advisor to maintain the portfolios for his/her clients. You will need to create several classes to maintain this information: Security, Stock, Bond, Portfolio, and Date. The characteristics of stocks and bonds in a portfolio are shown below: Stocks: Bonds: Purchase date (Date) Purchase date (Date) Purchase price (double)…arrow_forwarda) Illustrate the comparison between Scenario-based Modeling vs. Class-based Modelling.arrow_forward
- 1- Design a class named Rectangle to represent a Rectangle. The class contains: • three variables integer data field named height, integer data filed named width and integer data filed named length. The default values are 1 for height, length, and width are 1.0 for each of them respectively. • A no-arg constructor that creates a default Rectangle. • A constructor that creates a Rectangle with the specified height, length and width. • A method named getVolume() that returns the volume of this Rectangle. (Volume = height * width * length) %3! 2- Write a test program called Test Rectangle that: • Creates two Rectangle objects: one object with height 11, length 5, and width 7, the other object with height 10, length 2 and width 6 • Display the volume of each Rectangle object.arrow_forwardName the operator that you can use to check whether an object is an instance of a specified classarrow_forwardCreate a Class called Transaction with: instance variables: stock - your stock class type - char -> b or s (buy/sell) quantity - can be fractional price - buy/sell price when - LocalDate constructors: constructor with parameters for stock, type and quantity. - sets the price from the stock price instance variable - sets when from LocalDate getters and setters for each instance variablearrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY