



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
’ établissement de la cohérence entre vue fonctionnelle et vue structurelle s ’ établit par l ’ intermédiairede la vue comportementale : vue fonctionnelle cohérente avec vue comportementale (Diagramme deSéquence DS) : 1 Use Case représenté par au moins 1 DS ; chaque DS doit être cohérent avec ce quiest défini dans la vue structurell
Typology: Assignments
1 / 7
This page cannot be seen from the preview
Don't miss anything!




public class TestMyDate{ public static void main(String[] args){ MyDate date1 = new MyDate(11,11,1918); MyDate date2 = new MyDate(); date2.day = 11; date2.month = 11; date2.year = 1918; MyDate date3 = new MyDate(); date3.setDate(4,21,1968); String str1 = date1.toString(); String str2 = date2.toString(); String str3 = date3.toString(); System.out.println(str1); System.out.println(str2); System.out.println(str3); } }
Step 1: Create a MyDate class
1.1.1 Select File > New > Java Project ... 1.1.2 In the window that appears, enter AcmeOrderSystem as the project name and click the Finish button.
int day; int year; int month;
Step 2: Create two constructors
public MyDate(){}
public MyDate(int m, int d, int y){ //...use the parameters of m, d and y to set the three attributes }
Step 3: Add some methods to MyDate
public String toString(){ //TODO return a string with month/day/year like “01/20/1964” return ""; }
month and day can be concatenated as month + “/” + day.
public void setDate(int m, int d, int y){ //TODO set the MyDate attributes with m, d, and y values here! }
Step 4: Run TestMyDate
Bonus Lab Creating Classes
Step 5: Add an initialization block
MyDate date4 = new MyDate(); String str4 = date4.toString(); System. out .println(str4);