Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Exercise 7.13 JHTP (Date Class): Create a class called Date that includes 3 instance variables—a month (type int), a day (type int), and a year (type int). Provide a constructor that initializes the 3 instance variables and assumes the values provided are correct. Provide a set and a get method for each instance variable. Provide a method displayDate that displays the month, day, and year separated by forward slashes(/). Write a test application named DateTest that demonstrates class Date’s capabilities.
Java code
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- question 9 and 10arrow_forwardQ1: Write a complete JAVA program that carries out the following task s: Declare a class Video with the following non-static data members: v Vname (Type String). v my Price (Type int). The class also contains the following static data members. V number (Type int). daty The class also contains the following methods. V No_Argument_constructor to give initial values for all data members. V Full_constructor that accepts values of all data members as arguments from the user. V setName () method to reset the Vname of the Video. V getName () method to return the Vname of the Video. V set Price () method to reset the myPrice of the Video. V getPrice () method to return the my Price of the Video. V display () method that prints out the class data. V main () method to test the functionality of the class, asking the user to enter any necessary data. 3/r ado CS2301 - Homework2 Note: the static data member (number) is set to 0 and it is increment by 1 when an object is instantiated. Q2: What…arrow_forward5. Declare a class called coordinate. This is to represent 3 dimensional Cartesian coordinates (x, y and z).Define the following methods cumulatively in Java cumulatively:a. Constructorb. Display, to print values of membersc. Add_coordinates, to add three such coordinate objects to produce a resultant coordinate object.Generate and handle exceptions if x, y and z coordinate of the result are zero.d. Main, to show use of the above methods.arrow_forward
- Only Number 21arrow_forwardIn python and include doctring: First, write a class named Movie that has four data members: title, genre, director, and year. It should have: an init method that takes as arguments the title, genre, director, and year (in that order) and assigns them to the data members. The year is an integer and the others are strings. get methods for each of the data members (get_title, get_genre, get_director, and get_year). Next write a class named StreamingService that has two data members: name and catalog. the catalog is a dictionary of Movies, with the titles as the keys and the Movie objects as the corresponding values (you can assume there aren't any Movies with the same title). The StreamingService class should have: an init method that takes the name as an argument, and assigns it to the name data member. The catalog data member should be initialized to an empty dictionary. get methods for each of the data members (get_name and get_catalog). a method named add_movie that takes a Movie…arrow_forward/*** This class describes a tweet. A tweet has a message in it, a unique ID,* a count of the number of likes, and a count of the number of times it* has been retweeted. In addition, the Tweet class will have a static * variable to count the total number of tweets to ever be created * (retweets don't count as a new tweet).* * You may NOT import any library class.* * **/public class Tweet { /*** This constructor creates a tweet with the given message.* Assume that the message is not null because only the tweet() method* from the TwitterUser class will call this constructor. There are* no length requirements on Tweets.* * The very first tweet to ever be created will have an ID of 0, the * next one will have 1, and so on and so forth. It may help you to use* the static count variable to set the ID. * * You will have to initialize other instance variables appropriately.* @param message the text of the tweet*/public Tweet(String message) {throw new UnsupportedOperationException("Implement…arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education