Академический Документы
Профессиональный Документы
Культура Документы
Introduction
• The objectives of this assignment, are to print a series of messages. This includes:
o A name
o The Word ‘Uniform’
o The number greater than the supplied number, which is 7.
Pseudocode
Class MessagePrinter
Class Messages
Method namePrinter
Print “John Pham”
Method wordPrinter
Print “Uniform”
Method incrementPrinter
Print “7+1”
Class Diagram
Class
Class Messages
MessagePrinter
Methods
Methods namePrinter(): void
Main(String[]): void wordPrinter(): void
incrementPrinter():void
Line by Line description for the Class MessagePrinter
copyOfMessages.namePrinter();
This calls the method namePrinter, which can be found from within the object copyOfMessages
copyOfMessages.wordPrinter();
This calls the method wordPrinter, which can be found from within the object copyOfMessages
copyOfMessages.incrementPrinter();
This calls the method incrementPrinter, which can be found from within the object copyOfMessages
Line by Line description for the Class Messages
System.out.println("John Pham");
System.out.println is a method from the default java library which prints out some argument. In
this case, the literal “John Pham” is printed.
System.out.println("Uniform");
The literal “Uniform” is printed.
System.out.println(7+1);
The number 8 is printed, because we are asking Java to perform an arithmetic operation, using the
symbol ‘+’, on the numbers 7, and 1.