ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 29 May 2017 My Price 8.00

MyLogger.java and MyLoggerTest

i am looking to have an answer for this assignment

CST8284_521 - Assignment# 2Due Date: Friday, June 10, 2016What to submit: Two .java files: MyLogger.java and MyLoggerTest.javaChallengeIn this assignment, you will implement what has been covered in class about inheritance and invokingsuper-classes.The purpose of this assignment is to enrich your logging system by adding more details to the displayedmessage and especially the timestamp, with milliseconds, so you can read the logs in chronological wayfor debugging and verification purposes. No need to override toString nor to do anything with toStringmethod.What I need to run, is the following statements (within a main method inside MyLoggerTest.java):// two lines of code hereSystem.out.println("My Name is Michel");intx= 7;System.out.println(x);// … invoking more print or println methods that take other types of// parametersAnd the output I want to see is the following:23:18:40:930 EDT : Some Short Message : My Name is Michel23:18:40:930 EDT : Some Short Message : 7Two lines of code need to be inserted at the beginning of this main method that need to reside insideMyLoggerTest class. Your job is to write MyLogger class and complete the set of print/println statementswithin MyLoggerTest main method to cover all print/println methods that have void as their return value.There should be 9 distinct print/println methods in total that need to be tested within your main method.I will give you the initial version of MyLoggerTest class. You need to complete it to cover all desiredmethod tested. As well, you need to write MyLogger class.What I want you to learn to do is something that is coming from real life experience ofprogramming; so you will earn a new skill through this assignment and maybe use it later on.Now, how can I help you to resolve the problem without revealing the "core how to" :) ... so,here is a summary of what is needed:- You need to override all void print/println to add to their output the line requested- In order to do this, you need to find out the class these print/println reside in, subclass it,override the set of methods requested

public class MyLoggerTest {public static void main(String[] args) {// Initialize MyLogger class appropriately (one line of code)// Use System.setOut method to set your output stream appropriately(one line of code)System.out.println("My Name is Michel");int x = 7;System.out.println(x);// .../** I need to be able to call any of the print/println methods thatare invoked through System.out.* The list is:*voidprint/println(boolean b)void print/println(char c)void print/println(char[] s)void print/println(double d)void print/println(float f)void print/println(int i)void print/println(long l)void print/println(Object obj)void print/println(String s)* and I would expect for any of the print/println methods listedabove, the output be as follows:* <Date/time including milliseconds and timezone> : <Some ShortMessage> : <desired output to display>* Example as output for the code above:* 23:15:11:531 EDT : Some Short Message : My Name is Michel* 23:15:11:531 EDT : Some Short Message : 7** <Some Short Message> can be any appropriate short message or youcan simply keep it as is; i.e. "Some Short Message"** I should be able to test your code by calling print or printlnmethods using System.out.*/}}

Attachments:

Answers

(11)
Status NEW Posted 29 May 2017 09:05 AM My Price 8.00

-----------

Not Rated(0)