Share on Google+Share on Google+

badrul hisham
Daytype
0 Answer(s)      6 years and 2 months ago
Posted in : JavaScript Questions

Design and implement a class called DayType that implements the day of the week in a program. The class DayType should store the day, such as Sun for Sunday, Mon for Monday and so on and so forth. The program should be able to perform the following operations on an object of type of DayType: Set the day Print the day Return the day Return the next day Return the previous day Calculate and return the day by adding and subtracting certain days to the current day (i.e if current day is Monday and we add 6 days, the day to be returned is Sunday. Similarly is we subtract 3 days, the day to be return is Friday)

Instructions 1. Define DayType class ? appropriate methods and constructor 2. Your program should get the input/output via the main method and pass appropriate arguments through the class methods. 3. Your program should continuously running until it receives a special signal (character/number) in which the program will exit. 4. Compile and run 5. Write a short description on what you have done in your program

Ads

View Answers









Related Tutorials/Questions & Answers:
Daytype
Daytype  Design and implement a class called DayType that implements the day of the week in a program. The class DayType should store the day... be able to perform the following operations on an object of type of DayType: Set
c++
c++  Write the definition of the class dayType that implements the day of the week in a program. The class dayType should store the day... on an object of type dayType: a. Set the day. b. Print the day. c. Return the day
Advertisements
java oop
java oop  Design and implement a class called DayType that implements the day of the week in a program. The class DayType should store the day... be able to perform the following operations on an object of type of DayType: Set
SENTINEL
IN THIS PROGRAME OR CODING public class DayType{ final static int SUN = 0... DayType(int day) { this.day = day; } public void setDay(int day...: "); DayType d = new DayType(SUNDAY); d.print
classes in c++
on this class.   Here is the Java code: public class DayType{ final... day; public DayType(int day) { this.day = day...******"); System.out.println(); System.out.print("Set day: "); DayType d
Tutorials   
Java Spring Hibernate Struts Training code for programming How can I dynamically load user-entered data as content of jquery dialog? java webcam integration question java coding Fix Scrollbar position in a checkboxList after postback Information Save Alert Country wise redirection to files Interface in javascript connect database with javascript Zip Code ZipCode how to validate the email login How to play FLV video files on Ipad using HTML code or javascript code? Nitobi Grid is not working in IE10/IE11 jquery issue plese help RegEx Tree structure from json whose parents can be dragged and dropped from child newyorklife insurance getElementById not working javascript code for search in html file Implement The Skeleton Code Implement This Skeleton Code Mobile Automation using Appium Computer forensic application Java: Searching a string from doc files java linked list urgent !!! java linked list urgent!!! library management library management library management library management question Html form using JavaScript to display the table content java how to prevent no from unroundin off on clicking text box again in JSP and Jquery graph generation from xml design file display data from database in textbox when id entered in textbox Javascript Code for all fields how to get HTTP GET request value using javascript array Javascript Querry autocomplete(): Spring mvc with jquery: I am not getting correct value in the text filed. Please help me Create SpreadSheet same as excel using java applet Create SpreadSheet same as excel using java applet How to change focus among multiple select boxes? Write JQUERY Code Write JQUERY Code Converting jsp variable to java variable java

Ads

 
Advertisement null

Ads