Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

this is the third time i send it and they solve wrong !! please solve it correct

ID: 3840551 • Letter: T

Question

this is the third time i send it and they solve wrong !! please solve it correctly .. i need comments on it and it need it as wanted pleassseeee :(

UNIVERSITY 0F WOLLONGONG SCIT School of Computing and Information Technology Autumn 2017 CSII 111/811 Programming Fundamentals Assignment 3 (15 marks) Due ime and Date: Due by May 21, 8 pm, Resubmission is open till May 28, 8pm General Requirements: You should create your programs with good programming style and form using proper blank spaces, indentation and braces to make your code easy to read and understand; You should crcatc identificrs with scnsiblc namcs: You should make comm ents to describc your code scgmcnts whcrc they are ncccssary for rcaders to understand what your code intends to achicvc. Logical structures and statements arc properly used for spccific purposes Read the assignment specification carefully, and make sure that you follow whatever directed in this assignment. In every assignment that you will submit in this subject, you must put the following information in the header of your assignment: My name: My student number: My Course CSTT111 or CSITB 11 My email address: Assignment number 3 Objectives This assignment requires you to write a program in Java that calculates the day of week and the week of month for a given date, as well as to print the calendar of the month where the given date exists Background 2017 MAY damen Programming Fun

Explanation / Answer


public class MyDate {
  
   int day, m, yr;

   public MyDate(int day, int m, int yr) {
       super();
       this.day = day;
       this.m = m;
       this.yr = yr;
   }

   public int getDay() {
       return day;
   }

   public void setDay(int day) {
       this.day = day;
   }

   public int getM() {
       return m;
   }

   public void setM(int m) {
       this.m = m;
   }

   public int getYr() {
       return yr;
   }

   public void setYr(int yr) {
       this.yr = yr;
   }
  
  

}


public class Day {
  
   int dd;
   String[] d = {"Mon","Tue","Wed","Thu","Fri","Sat","Sun"};
  
  
  
   public Day(int dd) {
       super();
       this.dd = dd;
   }

   public String getDay(){
       if(dd>=0 && dd<7)
           return d[dd];
       else
           return null;
   }

}


public class MyCalendar {
  
   MyDate myDate;
   Day day;
  
  
  
   public MyCalendar(MyDate myDate) {
       super();
       this.myDate = myDate;
      
   }

   public void Convert(){
      
       int q = myDate.getDay();
       int m = myDate.getM();
       int k = myDate.getYr()%100;
       int j = myDate.getYr()/100;
      
       int h=0;
      
       h = (q + (13*(m+1)/5) + k + k/4 + j/4 + 5*j)%7;
       day = new Day(h);
       System.out.println("Day = "+day.getDay());
       int w = (0 | q/7)+1;
       System.out.println("Week of month = "+ w);
   }
  

}