MSc IT Programming Methodology (2). Oblong EasyScanner BankAccount.

Slides:



Advertisements
Similar presentations
Classes and objects Learning objectives By the end of this lecture you should be able to: explain the meaning of the term object-oriented; explain the.
Advertisements

Programming Methodology (1). Implementing Methods main.
MSc IT Programming Methodology (2). number name number.
IMPLEMENTING CLASSES Chapter 3. Black Box  Something that magically does its thing!  You know what it does but not how.  You really don’t care how.
Implementing Classes Learning objectives By the end of this lecture you should be able to: design classes using the notation of the Unified Modeling Language.
SD1042 Introduction to Software Development. Extending classes with inheritance Robot DancingRobot Sharing attributes and methods.
Introduction to Object-Oriented Programming CS 21a: Introduction to Computing I First Semester,
Big Java by Cay Horstmann Copyright © 2009 by John Wiley & Sons. All rights reserved. Chapter Three - Implementing Classes.
Chapter 9 – Inheritance Big Java by Cay Horstmann Copyright © 2009 by John Wiley & Sons. All rights reserved.
Arrays Horstmann, Chapter 8. arrays Fintan Array of chars For example, a String variable contains an array of characters: An array is a data structure.
COMP 110 Introduction to Programming Mr. Joshua Stough October 8, 2007.
1 Classes and Objects Overview l Classes and Objects l Constructors l Implicit Constructors l Overloading methods this keyword l public, private and protected.
Chapter 9: Classes with Instance Variables or Classes=Methods+Variables Asserting Java © Rick Mercer.
Using Objects Object: an entity in your program that you can manipulate Attributes Methods Method: consists of a sequence of instructions that can access.
© The McGraw-Hill Companies, 2006 Chapter 7 Implementing classes.
Inheritance and Subclasses in Java CS 21a: Introduction to Computing I Department of Information Systems and Computer Science Ateneo de Manila University.
MSc IT Programming Methodology (2). MODULE TEAM Dr Aaron Kans Dr Sin Wee Lee.
COMP More About Classes Yi Hong May 22, 2015.
GETTING INPUT Simple I/O. Simple Input Scanner scan = new Scanner(System.in); System.out.println("Enter your name"); String name = scan.nextLine(); System.out.println("Enter.
Extending classes with inheritance Learning objectives By the end of this lecture you should be able to: explain the term inheritance; design inheritance.
Chapter 6: A First Look at Classes
(c) University of Washington04-1 CSC 143 Java Inheritance Example (Review)
CMP-MX21: Lecture 6 Objects & Methods 1 Steve Hordley.
Writing Classes (Chapter 4)
College Board A.P. Computer Science A Topics Program Design - Read and understand a problem's description, purpose, and goals; Apply data abstraction.
Programming Methodology (1). import java.util.*; public class FindCost3 { public static void main(String[] args ) { Scanner sc = new Scanner(System.in);
Introduction to Object-Oriented Programming
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Java: Early Objects Third Edition by Tony Gaddis Chapter.
Spring 2008 Mark Fontenot CSE 1341 Principles of Computer Science I Note Set 2.
ACO 101: Introduction to Computer Science Anatomy Part 2: Methods.
Classes All Java code must be inside classes Class types – Utility classes Used to store constants, utility methods, etc. – Driver classes – Abstract Data.
Arrays Chapter 8. What if we need to store test scores for all students in our class. We could store each test score as a unique variable: int score1.
Chapter 3: Developing Class Methods Object-Oriented Program Development Using Java: A Class-Centered Approach.
Inheritance CSC 171 FALL 2004 LECTURE 18. READING Read Horstmann, Chapter 11.
Java™ How to Program, 10/e © Copyright by Pearson Education, Inc. All Rights Reserved.
JAVA Classes Review. Definitions Class – a description of the attributes and behavior of a set of computational objects Constructor – a method that is.
Ch 23 Java in context Learning objectives By the end of this lecture you should be able to:  explain the difference between a reference and a pointer;
CSC1401 Classes - 2. Learning Goals Computing concepts Adding a method To show the pictures in the slide show Creating accessors and modifiers That protect.
RECITATION 4. Classes public class Student { } Data Members public class Student { private String name; public String id; }
SE-1010 Dr. Mark L. Hornick 1 Java Programming Basics.
Classes. Student class We are tasked with creating a class for objects that store data about students. We first want to consider what is needed for the.
IT108 Objects and Classes Part I George Mason University Revised 4/3/2012.
Some odds and ends about Classes and Objects. 6-2 Object-Oriented Programming Object Data (Fields) Methods That Operate on the Data.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Getting Started with Java: Object declaration and creation Primitive.
Object-Oriented Programming in C++ Lecture 4 Constants References Operator overloading.
Copyright © 2015 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 3 A First Look at Classes and Objects.
Quick Review of OOP Constructs Classes:  Data types for structured data and behavior  fields and methods Objects:  Variables whose data type is a class.
Classes and Objects. Object Software objects are modeled after real-world objects in that they, too, have state and behavior. A software object maintains.
Classes CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
Topics Instance variables, set and get methods Encapsulation
Class Everything in Java is in a class. The class has a constructor that creates the object. If you do not supply a constructor Java will create a default.
©2000, John Wiley & Sons, Inc. Horstmann/Java Essentials, 2/e Chapter 3: An Introduction to Classes 1 Chapter 3 An Introduction to Classes.
JAVA METHODS (FUNCTIONS). Why are they called methods? Java is a strictly object-oriented programming language Methods are functions inside of objects.
Introduction to Constructors Lecture # 4. Copyright © 2011 Pearson Education, Inc. 3-2 Arguments Passed By Value In Java, all arguments to a method are.
Copyright © 2011 Pearson Education, Inc. Starting Out with Java: Early Objects Fourth Edition by Tony Gaddis Chapter 3: A First Look at Classes and Objects.
Methods Matthew Harrison. Overview ● There are five main aspects of methods... ● 1) Modifiers – public, private ● 2) Method Name ● 3) Parameters ● 4)
Lecture 3 John Woodward.
Java OOP Overview Classes and Objects, Members and Class Definition, Access Modifier, Encapsulation Java OOP Overview SoftUni Team Technical Trainers.
Exceptions, Interfaces & Generics
Implementing Classes Yonglei Tao.
CLASS DEFINITION (> 1 CONSTRUCTOR)
Chapter Three - Implementing Classes
The Basics of Class Diagrams for a single class
Defining Your Own Classes Part 1
An Introduction to Java – Part II
د.سناء الصايغ الفصل الأول البرمجة الشيئية
JAVA CLASSES.
Introduction to Object-Oriented Programming
Agenda About Homework for BPJ lesson 15 Overloading constructor
Introduction to Computer Science and Object-Oriented Programming
Presentation transcript:

MSc IT Programming Methodology (2)

Oblong EasyScanner BankAccount

Implementing Classes Learning objectives design classes using the notation of the Unified Modelling Language (UML); write the Java code for a specified class; explain the difference between public and private access to attributes and methods; explain the use of the static keyword; pass objects as parameters.

Structured programming…

// switch on light // get building // check if passed main boolean light; int mark; String roomNumber;

Object-oriented programming…

String roomNumber; int mark; // switch on light // get building // check if passed Room Student Projector boolean light;

Looking inside a class….

Student

data Student

name number marks data

name number marks Student data methods

name number marks Student data methods getName getNumber setMarks Student

Oblong

data

Oblong data length height

Oblong data length height methods

Oblong data length height methods getLength calculateArea Oblong

The notation of the Unified Modelling Language (UML)

Oblong length height Oblong( ) setLength( ) setHeight( ) getLength( ) getHeight( ) calculateArea( ) calculatePerimeter( ) Class Name data methods attributes

Oblong length : ? height : ? Oblong( ? ) setLength( ? ): ? setHeight( ? ): ? getLength( ? ): ? getHeight( ? ): ? calculateArea( ? ): ? calculatePerimeter( ? ): ?

Oblong length : double height : ? Oblong( ? ) setLength( ? ): ? setHeight( ? ): ? getLength( ? ): ? getHeight( ? ): ? calculateArea( ? ): ? calculatePerimeter( ? ): ?

Oblong length : double height : double Oblong( ? ) setLength( ? ): ? setHeight( ? ): ? getLength( ? ): ? getHeight( ? ): ? calculateArea( ? ): ? calculatePerimeter( ? ): ?

Oblong length : double height : double Oblong( double, double ) setLength( ? ): ? setHeight( ? ): ? getLength( ? ): ? getHeight( ? ): ? calculateArea( ? ): ? calculatePerimeter( ? ): ?

Oblong length : double height : double Oblong( double, double ) setLength( double ) setHeight( ? ): ? getLength( ? ): ? getHeight( ? ): ? calculateArea( ? ): ? calculatePerimeter( ? ): ?

Oblong length : double height : double Oblong( double, double ) setLength( double ) setHeight( double ) getLength( ? ): ? getHeight( ? ): ? calculateArea( ? ): ? calculatePerimeter( ? ): ?

Oblong length : double height : double Oblong( double, double ) setLength( double ) setHeight( double ) getLength( ): double getHeight( ? ): ? calculateArea( ? ): ? calculatePerimeter( ? ): ?

Oblong length : double height : double Oblong( double, double ) setLength( double ) setHeight( double ) getLength( ): double getHeight( ): double calculateArea( ? ): ? calculatePerimeter( ? ): ?

Oblong length : double height : double Oblong( double, double ) setLength( double ) setHeight( double ) getLength( ): double getHeight( ): double calculateArea( ): double calculatePerimeter( ? ): ?

Oblong length : double height : double Oblong( double, double ) setLength( double ) setHeight( double ) getLength( ): double getHeight( ): double calculateArea( ): double calculatePerimeter( ): double

Oblong length : double height : double Oblong( double, double ) setLength( double ) setHeight( double ) getLength( ): double getHeight( ): double calculateArea( ): double calculatePerimeter( ): double public class Oblong { // attributes // methods }

public class Oblong { } double length; double height; Attributes declared outside of any methods

public class Oblong { } double length; double height;

public class Oblong { } double length; double height; Attributes should be hidden inside the class

public class Oblong { } double length; double height; private

Implementing the Oblong methods…

public class Oblong { } double length; double height; private Oblong ob1 = new Oblong (12.5, 7.5);

public class Oblong { } double length; double height; private Oblong ob1 = new Oblong (12.5, 7.5); Oblong(double ?, double ?) { } // more methods here

public class Oblong { } double length; double height; private Oblong ob1 = new Oblong (12.5, 7.5); Oblong(double ?, double ?) { } // more methods here Methods should be visible outside of the class

public class Oblong { } double length; double height; private Oblong ob1 = new Oblong (12.5, 7.5); Oblong(double ?, double ?) { } // more methods here Methods should be visible outside of the class public

public class Oblong { } double length; double height; private Oblong ob1 = new Oblong (12.5, 7.5); Oblong(double ?, double ?) { } // more methods here public A constructor has no return type

public class Oblong { } double length; double height; private Oblong ob1 = new Oblong (12.5, 7.5); Oblong(double ?, double ?) { } // more methods here public

public class Oblong { } double length; double height; private Oblong ob1 = new Oblong (12.5, 7.5); Oblong(double lengthIn, double ?) { } // more methods here public

public class Oblong { } double length; double height; private Oblong ob1 = new Oblong (12.5, 7.5); Oblong(double lengthIn, double ?) { } // more methods here public

public class Oblong { } double length; double height; private Oblong ob1 = new Oblong (12.5, 7.5); Oblong(double lengthIn, double heightIn) { } // more methods here public

public class Oblong { } double length; double height; private Oblong ob1 = new Oblong (12.5, 7.5); Oblong(double lengthIn, double heightIn) { // set the values of length and height } // more methods here public

public class Oblong { } double length; double height; private Oblong ob1 = new Oblong (12.5, 7.5); Oblong(double lengthIn, double heightIn) { // set the values of length and height } // more methods here public

public class Oblong { } double length; double height; private Oblong ob1 = new Oblong (12.5, 7.5); Oblong(double lengthIn, double heightIn) { length = lengthIn; } // more methods here public

public class Oblong { } double length; double height; private Oblong ob1 = new Oblong (12.5, 7.5); Oblong(double lengthIn, double heightIn) { length = lengthIn; height = heightIn; } // more methods here public

What happens if you don’t write a constructor?

A default constructor is added for you!

public class Oblong { } double length; double height; private Oblong() { } public // more methods here

public class Oblong { } double length; double height; private Oblong() { } public // more methods here A default constructor has no code inside it.

public class Oblong { } double length; double height; private Oblong() { } public // more methods here Oblong ob1 = new Oblong ( );

public class Oblong { } double length; double height; private Oblong() { } public // more methods here Oblong ob1 = new Oblong (12.5, 7.5);

public class Oblong { } double length; double height; private Oblong ob1 = new Oblong (12.5, 7.5);

public class Oblong { } double length; double height; private public Oblong(double lengthIn, double heightIn) { } // more methods here length = lengthIn; height = heightIn; Oblong ob1 = new Oblong (12.5, 7.5);

public class Oblong { } double length; double height; private System.out.println( ob1.getLength() ); getLength() { } publicdouble return length; // more methods here

public class Oblong { } double length; double height; private System.out.println( ob1.getHeight() ); getHeight() { } publicdouble return height; // more methods here

public class Oblong { } double length; double height; private ob1.setLength( 14.75); setLength( double ?) { } public // more methods here

public class Oblong { } double length; double height; private ob1.setLength( 14.75); setLength( double ?) { } public // more methods here void

public class Oblong { } double length; double height; private ob1.setLength( 14.75); setLength( double ?) { } public // more methods here void

public class Oblong { } double length; double height; private ob1.setLength( 14.75); setLength( double lengthIn) { } public // more methods here void

public class Oblong { } double length; double height; private ob1.setLength( 14.75); setLength( double lengthIn) { // reset length } public // more methods here void

public class Oblong { } double length; double height; private ob1.setLength( 14.75); setLength( double lengthIn) { } publicvoid length = lengthIn; // more methods here

public class Oblong { } double length; double height; private ob1.setHeight( 5.9 ); // more methods here

public class Oblong { } double length; double height; private ob1.setHeight( 5.9 ); setHeight( double heightIn) { } publicvoid height = heightIn; // more methods here

public class Oblong { } double length; double height; private System.out.println( ob1.calculateArea() ); // more methods here

public class Oblong { } double length; double height; private System.out.println( ob1.calculateArea() ); // more methods here calculateArea() { } publicdouble return length * height;

public class Oblong { } double length; double height; private System.out.println( ob1.calculatePerimeter()); // more methods here

public class Oblong { } double length; double height; private System.out.println( ob1.calculatePerimeter()); // more methods here calculatePerimeter() { } publicdouble return 2 * (length + height);

The BankAccount class….

BankAccount accountNumber : String accountName : String balance : double BankAccount (String, String) getAccountNumber() : String getAccountName() : String getBalance() : double deposit(double) withdraw(double)

public class BankAccount { private String accountNumber; private String accountName; private double balance; }

public class BankAccount { private String accountNumber; private String accountName; private double balance; }

public class BankAccount { private String accountNumber; private String accountName; private double balance; } public BankAccount(String numberIn, String nameIn) { accountNumber = numberIn; accountName = nameIn; balance = 0; }

public class BankAccount { private String accountNumber; private String accountName; private double balance; } public String getAccountName() { return accountName; }

public class BankAccount { private String accountNumber; private String accountName; private double balance; } public String getAccountNumber() { return accountNumber; }

public class BankAccount { private String accountNumber; private String accountName; private double balance; } public String getABalance() { return balance; }

public class BankAccount { private String accountNumber; private String accountName; private double balance; } public void deposit(double amountIn) { balance = balance + amountIn; }

public class BankAccount { private String accountNumber; private String accountName; private double balance; } public void withdraw(double amountIn) { balance = balance – amountIn; }

public class BankAccountTester { public static void main(String[ ] args) { BankAccount account1 = new BankAccount(" ","Susan Richards"); account1.deposit(1000); System.out.println("Account number: " + account1.getAccountNumber()); System.out.println("Account name: " + account1.getAccountName()); System.out.println("Current balance: " + account1.getBalance()); } }

Amending the BankAccount class…

“ ” “Funmi Odulopo” £ “ ” “Mary Stephenson” £ “ ” “Dilraj Mann” £ acc1 acc2 acc3 1.25% 1.25% 1.25% acc1.getBalance(); acc1.getInterestRate(); acc2.addInterest ();

“ ” “Funmi Odulopo” £ “ ” “Mary Stephenson” £ “ ” “Dilraj Mann” £ acc1 acc2 acc3 1.25% acc1.getBalance(); acc1.getInterestRate(); acc2.addInterest ();

“ ” “Funmi Odulopo” £ “ ” “Mary Stephenson” £ “ ” “Dilraj Mann” £ acc1 acc2 acc3 1.25% acc1.getBalance(); acc1.getInterestRate(); acc2.addInterest (); acc2.getInterestRate();

“ ” “Funmi Odulopo” £ “ ” “Mary Stephenson” £ “ ” “Dilraj Mann” £ acc1 acc2 acc3 1.25% acc1.getBalance(); acc1.getInterestRate(); acc2.addInterest (); acc2.getInterestRate(); acc3.deposit( 500 );

“ ” “Funmi Odulopo” £ “ ” “Mary Stephenson” £ “ ” “Dilraj Mann” £ acc1 acc2 acc3 1.25% acc1.getBalance(); acc1.getInterestRate(); acc2.addInterest (); acc2.getInterestRate(); acc3.deposit( 500 );

“ ” “Funmi Odulopo” £ “ ” “Mary Stephenson” £ “ ” “Dilraj Mann” £ acc1 acc2 acc3 1.25% acc1.getBalance(); acc1.getInterestRate(); acc2.addInterest (); acc2.getInterestRate(); acc3.deposit( 500 ); acc3.setInterestRate(1.5);

“ ” “Funmi Odulopo” £ “ ” “Mary Stephenson” £ “ ” “Dilraj Mann” £ acc1 acc2 acc3 1.25% 1.5% acc1.getBalance(); acc1.getInterestRate(); acc2.addInterest (); acc2.getInterestRate(); acc3.deposit( 500 ); acc3.setInterestRate(1.5);

“ ” “Funmi Odulopo” £ “ ” “Mary Stephenson” £ “ ” “Dilraj Mann” £ acc1 acc2 acc3 acc1.getBalance(); acc1.getInterestRate(); acc2.addInterest (); acc2.getInterestRate(); acc3.deposit( 500 ); acc3.setInterestRate(1.5); 1.5%

“ ” “Funmi Odulopo” £ “ ” “Mary Stephenson” £ “ ” “Dilraj Mann” £ acc1 acc2 acc3 1.5% acc1.getBalance(); acc2.addInterest (); acc3.deposit( 500 );

“ ” “Funmi Odulopo” £ “ ” “Mary Stephenson” £ “ ” “Dilraj Mann” £ acc1 acc2 acc3 1.5% acc1.getBalance(); acc2.addInterest (); acc3.deposit( 500 ); BankAccount.setInterestRate(1.4);

“ ” “Funmi Odulopo” £ “ ” “Mary Stephenson” £ “ ” “Dilraj Mann” £ acc1 acc2 acc3 1.4% acc1.getBalance(); acc2.addInterest (); acc3.deposit( 500 ); BankAccount.setInterestRate(1.4);

“ ” “Funmi Odulopo” £ “ ” “Mary Stephenson” £ “ ” “Dilraj Mann” £ acc1 acc2 acc3 1.4% acc1.getBalance(); acc2.addInterest (); acc3.deposit( 500 ); BankAccount.setInterestRate(1.4); BankAccount.getInterestRate( );

“ ” “Funmi Odulopo” £ “ ” “Mary Stephenson” £ “ ” “Dilraj Mann” £ acc1 acc2 acc3 1.4% acc1.getBalance(); acc2.addInterest (); acc3.deposit( 500 ); BankAccount.setInterestRate(1.4); BankAccount.getInterestRate( ); This is a class attribute.

“ ” “Funmi Odulopo” £ “ ” “Mary Stephenson” £ “ ” “Dilraj Mann” £ acc1 acc2 acc3 1.4% acc1.getBalance(); acc2.addInterest (); acc3.deposit( 500 ); BankAccount.setInterestRate(1.4); BankAccount.getInterestRate( ); This is a class method.

How do we create class attributes and class methods?

Use the static keyword!

private static double interestRate; public static void setInterestRate(double rateIn) { interestRate = rateIn; } public static double getInterestRate() { return interestRate; } public class BankAccount2 { // attributes and methods as before plus addInterest }

The addInterest method ….

public class BankAccount2 { private String accountNumber; private String accountName; private double balance; } private static double interestRate; public void addInterest() { balance = balance + (balance * interestRate)/100; }

The BankAccount2 constructor ?

public class BankAccount2 { private String accountNumber; private String accountName; private double balance; } private static double interestRate; public BankAccount2(String numberIn, String nameIn) { accountNumber = numberIn; accountName = nameIn; balance = 0; }

What about the interestRate attribute?

Java does not give an initial value to local variables but does initialize attributes!

Initializing attributes int double char Objects 0 boolean false null

public class BankAccount2 { private String accountNumber; private String accountName; private double balance; private static double interestRate ; // methods here } = 0;

The EasyScanner class…

Remember how we used EasyScanner? int x; System.out.println(“Enter number”); X = EasyScanner.nextInt() ; This must be a class method!

import java.util.*; public class EasyScanner { public static int nextInt() { Scanner sc = new Scanner(System.in); int i = sc.nextInt(); return i; } // more methods here }

Sending objects as parameters….

public class ParameterTest { public static void main(String[ ] args) { BankAccount acc = new BankAccount("1", "Samsun Okoyo"); test(acc); System.out.println("Account Number: " + acc.getAccountNumber()); System.out.println("Account Name: " + acc.getAccountName()); System.out.println("Balance: " + acc.getBalance()); } private static void test(BankAccount accIn) { accIn.deposit(2500); } }

Account Number: 1 Account Name: Samsun Okoyo Balance:

Effect on computer memory of sending an object as a parameter…

public static void main (String[] args) { BankAccount acc = new BankAccount(…) ; } Computer MemoryJava Instructions acc a BankAccount object private static void test(BankAccount accIn) { } accIn test(acc); accIn.deposit(2500);

Practical Work

Student studentNumber : String studentName : String markForMaths : int markForEnglish : int markForScience : int Student(String, String) getNumber() : String getName() : String enterMarks(int, int, int) getMathsMark() : int getEnglishMark() : int getScienceMark() : int calculateAverageMark() : double public class Student { // attributes // methods } Implement this class in your practical

Student studentNumber : String studentName : String markForMaths : int markForEnglish : int markForScience : int Student(String, String) getNumber() : String getName() : String enterMarks(int, int, int) getMathsMark() : int getEnglishMark() : int getScienceMark() : int calculateAverageMark() : double public class Student { // attributes // methods } Implement this class in your practical

Student studentNumber : String studentName : String markForMaths : int markForEnglish : int markForScience : int Student(String, String) getNumber() : String getName() : String enterMarks(int, int, int) getMathsMark() : int getEnglishMark() : int getScienceMark() : int calculateAverageMark() : double public class Student { private int markForMaths; // more attributes here // methods } Implement this class in your practical

Student studentNumber : String studentName : String markForMaths : int markForEnglish : int markForScience : int Student(String, String) getNumber() : String getName() : String enterMarks(int, int, int) getMathsMark() : int getEnglishMark() : int getScienceMark() : int calculateAverageMark() : double public class Student { private int markForMaths; // more attributes here // methods } Implement this class in your practical

Student studentNumber : String studentName : String markForMaths : int markForEnglish : int markForScience : int Student(String, String) getNumber() : String getName() : String enterMarks(int, int, int) getMathsMark() : int getEnglishMark() : int getScienceMark() : int calculateAverageMark() : double Implement this class in your practical public class Student { private int markForMaths; // more attributes here public int getMathsMark( ) { return markForMaths; } // more methods here }

Student studentNumber : String studentName : String markForMaths : int markForEnglish : int markForScience : int Student(String, String) getNumber() : String getName() : String enterMarks(int, int, int) getMathsMark() : int getEnglishMark() : int getScienceMark() : int calculateAverageMark() : double Then write a tester to check your class

Student studentNumber : String studentName : String markForMaths : int markForEnglish : int markForScience : int Student(String, String) getNumber() : String getName() : String enterMarks(int, int, int) getMathsMark() : int getEnglishMark() : int getScienceMark() : int calculateAverageMark() : double Then write a tester to check your class public class StudentTester { public static void main(String[ ] args) { } }

Student studentNumber : String studentName : String markForMaths : int markForEnglish : int markForScience : int Student(String, String) getNumber() : String getName() : String enterMarks(int, int, int) getMathsMark() : int getEnglishMark() : int getScienceMark() : int calculateAverageMark() : double Then write a tester to check your class public class StudentTester { public static void main(String[ ] args) { /* code to create at least two Student objects and call their methods */ } }