Scroll Top
19th Ave New York, NY 95822, USA

CS代写|COMP9103 JAVA

MY-ASSIGNMENTEXPERT™可以为您提供sydney COMP9103 JAVA课程的代写代考辅导服务!

这是维多利亚大学 JAVA课程的代写成功案例。

CS代写|COMP9103 JAVA

COMP9103课程简介

Programming in a legible, maintainable, reusable way is essential to solve complex problems in the pervasive computing environments. This unit will equip students with foundation of programming concepts that are common to widely used programming languages. Students will be progressively guided in this introductory unit from necessary and important building blocks of programming to the object-oriented approach. Java, one of the most popular programming languages, is used in this unit. It provides interdisciplinary approaches, applications and examples to support students from broad backgrounds such as science, engineering, and mathematics.

Prerequisites 

At the completion of this unit, you should be able to:

  • LO1. demonstrate an understanding of the concept of Object-Orientation: understand and explain key concepts of object-oriented programming, including classes as encapsulating data, object instances, memory model of references, methods and calling them across objects
  • LO2. read and interpret an object oriented design document
  • LO3. demonstrate an understanding of the memory model and differences between locations of variables
  • LO4. derive a computer program from a design document that uses concepts of OO and memory model, trace and write small examples of code including the following elements: inheritance, polymorphism, abstract classes and interfaces, variables and their type and the relationship between static and dynamic type, exception
  • LO5. demonstrate experience in testing Object-Oriented programs, write tests for standalone objects, be able to generate and handle exceptions, create invariants for classes, methods and objects, pre- and post-conditions for methods, and assertions
  • LO6. create appropriate class/data structure including the data types and methods for simple problems
  • LO7. read, trace and write recursive Object-Oriented programs to perform an operation in a related set of classes that support some nested structure
  • LO8. demonstrate an understanding of Object-Oriented programming language : reading, tracing and writing competence with the following elements of Java programming language: classes, methods, object creation; instance and local variables, parameters and scope; basic types; simple I/O; control flow primitives and understand, modify and add functionality to Java programs
  • LO9. demonstrate experience writing code with common interfaces and collections in Object-Oriented programming language
  • LO10. demonstrate experience in testing and debugging Object-Oriented programs, write tests for stand-alone object code, to be run automatically.

COMP9103 JAVA HELP(EXAM HELP, ONLINE TUTOR)

问题 1.

1) The Java class called Holiday is started below. An object of class Holiday represents a holiday during the year. This class has three instance variables:

  • name, which is a string representing the name of the holiday
  • day, which is an int representing the day of the month of the holiday
  • month, which is a String representing the month the holiday is in
    public class Holiday $\mid$
    private String name;
    private int day;
    private String month;
    // your code goes here
    public class Holiday 1
    private String name;
    private int day;
    private string month;
    // your code goes here

a) Write a constructor for the class Holiday, which takes a String representing the name, an int representing the

An answer:
public Holiday (String $\mathrm{n}$, int $\mathrm{d}$, String $\mathrm{m}){$
name $=\mathrm{n} ;$
day $=\mathrm{d} ;$
month $=\mathrm{m} ;$
}$\quad 1$
public Holiday(String $\mathrm{n}$, int d, String $\mathrm{m}$ )
name $=\mathrm{n}$;
day $=d$;
month $=\mathrm{m}$;
}

问题 2.

b) Write a method inSameMonth, which compares two instances of the class Holiday, and returns the Boolean value true if they have the same month, and false if they do not.

An answer:
public boolean insameMonth(Holiday hol) {
return this.month. equals (hol.month);
public boolean inSameMonth(Holiday hol) {
return this.month.equals (hol.month);
}

问题 3.

c) Write a method avgDate which takes an array of base type Holiday as its argument, and returns a double that is the average of the day variables in the Holiday instances in the array. You may assume that the array is full (i.e. does not have any null entries).

An answer:
public static double avgDate (Holiday[] hol)
int sum $=0$;
for(int $i=0 ; i<$ hol. length; i++)
sum $=$ sum + hol [i].day;
return ( double) sum)/hol.length;
public static double avgDate(Holiday[] hol) {
int sum $=0$;
for (int $i=0$; $i<$ hol.length; $i++)$ i
sum $=$ sum + hol $[i] \cdot$ day ;
}
return ((double) sum)/hol.length;
}

问题 4.

d) Write a piece of code that creates a Holiday instance with the name “Independence Day”, with the day ” 4 “, and with the month “July”.

An answer:
Holiday hol = new Holiday (“Independence Day”, 4, “July”);

MY-ASSIGNMENTEXPERT™可以为您提供sydney COMP9103 JAVA数据库课程的代写代考辅导服务!

Leave a comment