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

EXERCISE 7.20 I hava declared and initialized dayCount[28] and monthCount[12] in

ID: 3598891 • Letter: E

Question

EXERCISE 7.20

I hava declared and initialized dayCount[28] and monthCount[12] int arrays in LogAnalyzer class. Provided accessors getDay() , getMonth() and getYear() in LogEntry class. I have witten methods in LogAnalyzer class analyzeDailyData() and analyzeMonthlyData() similar to analyzeHourlyData(). I then provided methods printDailyCount() and printMonthlyCount().

PROBLEM: After creating an instance of LogAnalyzer and analyzing the data. Printing the number of access for each hour works fine but trying to print the number of accesses for each day or each month results in '0' for every entry. e.g. 1: 0 , 2: 0 3:0 ....

I have included the code for the LogAnalyzer class and the LogEntry class. My code is included here.

The LogAnalyzer class.

public class LogAnalyzer

{

// Where to calculate the hourly access counts.

private int[] hourCounts;

// Where to calculate the daily access counts.

private int[] dayCounts;

// Where to calculate the monthly access counts.

private int[] monthCounts;

// Use a LogfileReader to access the data.

private LogfileReader reader;

/**

* Create an object to analyze hourly web accesses.

*/

public LogAnalyzer()

{

// Create the array object to hold the hourly

// access counts.

hourCounts = new int[24];

// Create the array object to hold daily

// access counts.

dayCounts = new int[28];

// Create the array object to hold the

// monthly access counts.

monthCounts = new int[12];

// Create the reader to obtain the data.

reader = new LogfileReader();

}

  

/**

* Create an object to analyze hourly web accesses.

* @param String filename. Analyze this weblog file.

*/

public LogAnalyzer(String filename)

{

// Create the array object to hold the hourly

// access counts.

hourCounts = new int[24];  

// Create the array object to hold the daily

// access counts.

dayCounts = new int[28];

// Create the array object to hold the monthly

// access counts.

monthCounts = new int[12];

// Create the reader to obtain the data.

reader = new LogfileReader(filename);

}

  

/**

* Analyze the hourly access data from the log file.

*/

public void analyzeHourlyData()

{

while(reader.hasNext()) {

LogEntry entry = reader.next();

int hour = entry.getHour();

hourCounts[hour] = hourCounts[hour] + 1;  

}

}

  

/**

* EXERCISE 7.19

* Analyze the daily access data from the log file.

*/

public void analyzeDailyData()

{

while(reader.hasNext()) {

LogEntry entry = reader.next();

int day = entry.getDay();

dayCounts[day] = dayCounts[day] +1;  

}

}

  

/**

* EXERCISE 7.19

* Analyze monthly data from the logfile.

*/

public void analyzeMonthlyData()

{

while(reader.hasNext()){

LogEntry entry = reader.next();

int month = entry.getMonth();

monthCounts[month] = monthCounts[month] + 1;

}

}

  

/**

* EXERCISE 7.10

* Print the hourly counts.

* These should have been set with a prior

* call to analyzeHourlyData .

*/

public void printHourlyCounts()

{

int hour = 0;

while( hour < hourCounts.length){

System.out.println( hour + ": " + hourCounts[hour]);

hour++;

}

  

// System.out.println("Hr: Count");

// for(int hour = 0; hour < hourCounts.length; hour++) {

// System.out.println(hour + ": " + hourCounts[hour]);

// }

}

  

/**

* EXERCISE 7.19

* Print the daily counts.

* These should have been set with a prior call

* to the analyzeDailyData .

*/

public void printDailyCounts()

{

for(int day = 0; day < dayCounts.length; day++){

System.out.println( (day + 1) + ": " + dayCounts[day]);

}

}

  

/**

* EXERCISE 7.19

* Print the monthly counts.

* These should have been set with a prior

* call to analyzeMonthlyCounts

*/

public void printMonthlyCounts()

{

for(int month = 0; month < monthCounts.length; month++){

System.out.println( (month + 1) + ": " + monthCounts[month]);

}

}

  

/**

* Print the lines of data read by the LogfileReader

*/

public void printData()

{

reader.printData();

}

}

// The LogEntry class.

public class LogEntry implements Comparable

{

// Where the data values extracted from a single

// log line are stored.

private int[] dataValues;

// The equivalent Calendar object for the log time.

private Calendar when;

  

// At which index in dataValues the different fields

// from a log line are stored.

private static final int YEAR = 0, MONTH = 1, DAY = 2,

HOUR = 3, MINUTE = 4;

// The number of fields. If more fields are added, e.g. for

// seconds or a status code, then this value must be increased

// to match.

private static final int NUMBER_OF_FIELDS = 5;

  

/**

* Decompose a log line so that the individual fields

* are available.

* @param logline A single line from the log.

* This should be in the format:

* year month day hour minute etc.

*/

public LogEntry(String logline)

{

// The array to store the data for a single line.

dataValues = new int[NUMBER_OF_FIELDS];

// Break up the log line.

LoglineTokenizer tokenizer = new LoglineTokenizer();

tokenizer.tokenize(logline,dataValues);

setWhen();

}

  

/**

* Create a LogEntry from the individual components.

* @param year The year

* @param month The month (1-12)

* @param day The day (1-31)

* @param hour The hour (0-23)

* @param minute The minute (0-59)

*/

public LogEntry(int year, int month, int day, int hour, int minute)

{

// The array to store the data for a single line.

dataValues = new int[NUMBER_OF_FIELDS];

dataValues[YEAR] = year;

dataValues[MONTH] = month;

dataValues[DAY] = day;

dataValues[HOUR] = hour;

dataValues[MINUTE] = minute;

setWhen();

}

/**

* Return the minute.

* @return The minute field from the log line.

*/

public int getMinute()

{

return dataValues[MINUTE];

}

  

/**

* Return the hour.

* @return The hour field from the log line.

*/

public int getHour()

{

return dataValues[HOUR];

}

  

/**

* EXERCISE 7.19

* Return the day.

* @return int The day field from the log line.

*/

public int getDay()

{

return dataValues[DAY];

}

  

/**

* EXERCISE 7.19

* Return the month.

* @return int The month field from the log line.

*/

public int getMonth()

{

return dataValues[MONTH];

}

  

/**

* EXERCISE 7.19

* Return the year.

* @return int The year field from the log line.

*/

public int getYear()

{

return dataValues[YEAR];

}

  

/**

* Create a string representation of the data.

* This is not necessarily identical with the

* text of the original log line.

* @return A string representing the data of this entry.

*/

public String toString()

{

StringBuffer buffer = new StringBuffer();

for(int value : dataValues) {

// Prefix a leading zero on single digit numbers.

if(value < 10) {

buffer.append('0');

}

buffer.append(value);

buffer.append(' ');

}

// Drop any trailing space.

return buffer.toString().trim();

}

  

/**

* Compare the date/time combination of this log entry

* with another.

* @param otherEntry The other entry to compare against.

* @return A negative value if this entry comes before the other.

* A positive value if this entry comes after the other.

* Zero if the entries are the same.

*/

public int compareTo(LogEntry otherEntry)

{

// Use the equivalent Calendars comparison method.

return when.compareTo(otherEntry.getWhen());

}

  

/**

* Return the Calendar object representing this event.

* @return The Calendar for this event.

*/

private Calendar getWhen()

{

return when;

}

/**

* Create an equivalent Calendar object from the data values.

*/

private void setWhen()

{

when = Calendar.getInstance();

// Adjust from 1-based month and day to 0-based.

when.set(dataValues[YEAR],

dataValues[MONTH] -1 , dataValues[DAY] -1 ,

dataValues[HOUR], dataValues[MINUTE]);

}

  

}

// The LogfileReader class

import java.io.File;
import java.io.FileNotFoundException;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.Random;
import java.util.Scanner;

/**
* A class to read information from a file of web server accesses.
* Currently, the log file is assumed to contain simply
* date and time information in the format:
*
* year month day hour minute
* Log entries are sorted into ascending order of date.
*
* @author David J. Barnes and Michael Kölling.
* @version 2016.02.29
*/
public class LogfileReader implements Iterator<LogEntry>
{
// The data format in the log file.
private String format;
// Where the file's contents are stored in the form
// of LogEntry objects.
private ArrayList<LogEntry> entries;
// An iterator over entries.
private Iterator<LogEntry> dataIterator;
  
/**
* Create a LogfileReader to supply data from a default file.
*/
public LogfileReader()
{
this("weblog.txt");
}
  
/**
* Create a LogfileReader that will supply data
* from a particular log file.
* @param filename The file of log data.
*/
public LogfileReader(String filename)
{
// The format for the data.
format = "Year Month(1-12) Day Hour Minute";
// Where to store the data.
entries = new ArrayList<>();
  
// Attempt to read the complete set of data from file.
boolean dataRead;
try{
// Locate the file with respect to the current environment.
URL fileURL = getClass().getClassLoader().getResource(filename);
if(fileURL == null) {
throw new FileNotFoundException(filename);
}
Scanner logfile = new Scanner(new File(fileURL.toURI()));
// Read the data lines until the end of file.
while(logfile.hasNextLine()) {
String logline = logfile.nextLine();
// Break up the line and add it to the list of entries.
LogEntry entry = new LogEntry(logline);
entries.add(entry);
}
logfile.close();
dataRead = true;
}
catch(FileNotFoundException | URISyntaxException e) {
System.out.println("Problem encountered: " + e);
dataRead = false;
}
// If we couldn't read the log file, use simulated data.
if(!dataRead) {
System.out.println("Failed to read the data file: " + filename);
System.out.println("Using simulated data instead.");
createSimulatedData(entries);
}
// Sort the entries into ascending order.
Collections.sort(entries);
reset();
}
  
/**
* Does the reader have more data to supply?
* @return true if there is more data available,
* false otherwise.
*/
public boolean hasNext()
{
return dataIterator.hasNext();
}
  
/**
* Analyze the next line from the log file and
* make it available via a LogEntry object.
*
* @return A LogEntry containing the data from the
* next log line.
*/
public LogEntry next()
{
return dataIterator.next();
}
  
/**
* Remove an entry.
* This operation is not permitted.
*/
public void remove()
{
System.err.println("It is not permitted to remove entries.");
}
  
/**
* @return A string explaining the format of the data
* in the log file.
*/
public String getFormat()
{
return format;
}
  
/**
* Set up a fresh iterator to provide access to the data.
* This allows a single file of data to be processed
* more than once.
*/
public void reset()
{
dataIterator = entries.iterator();
}

/**
* Print the data.
*/   
public void printData()
{
for(LogEntry entry : entries) {
System.out.println(entry);
}
}

/**
* Provide a sample of simulated data.
* NB: To simplify the creation of this data, no
* days after the 28th of a month are ever generated.
* @param data Where to store the simulated LogEntry objects.
*/
private void createSimulatedData(ArrayList<LogEntry> data)
{
LogfileCreator creator = new LogfileCreator();
// How many simulated entries we want.
int numEntries = 100;
for(int i = 0; i < numEntries; i++) {
data.add(creator.createEntry());
}
}
}
// The LogfileCreator class.

Explanation / Answer

If you call any of the Analyse methods(analyzeHourlyData, analyzeDailyData & analyzeMonthlyData) in LogAnalyzer, it moves the iterator in the LogfileReader

public LogfileReader reader;

to the last element of the entries. So, you need to call the "reset()" method in LogFileReader class object after each call to any of the above analyse methods for the iterator to reset to the first element.

(i.e) reader.reset();

The following is a working sample of the code. You can find at the end of the code, how to call the reset() method.

import java.io.*;
import java.util.*;
import java.io.File;
import java.io.FileNotFoundException;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.Random;
import java.util.Scanner;
import java.util.Calendar;
import java.util.StringTokenizer;

public class Simple
{  
public class LogAnalyzer
{
// Where to calculate the hourly access counts.
private int[] hourCounts;
// Where to calculate the daily access counts.
private int[] dayCounts;
// Where to calculate the monthly access counts.
private int[] monthCounts;
// Use a LogfileReader to access the data.
public LogfileReader reader;
/**
* Create an object to analyze hourly web accesses.
*/
public LogAnalyzer()
{
// Create the array object to hold the hourly
// access counts.
hourCounts = new int[24];
// Create the array object to hold daily
// access counts.
dayCounts = new int[28];
// Create the array object to hold the
// monthly access counts.
monthCounts = new int[12];
// Create the reader to obtain the data.
reader = new LogfileReader();
}
  
/**
* Create an object to analyze hourly web accesses.
* @param String filename. Analyze this weblog file.
*/
public LogAnalyzer(String filename)
{
// Create the array object to hold the hourly
// access counts.
hourCounts = new int[24];  
// Create the array object to hold the daily
// access counts.
dayCounts = new int[28];
// Create the array object to hold the monthly
// access counts.
monthCounts = new int[12];
// Create the reader to obtain the data.
reader = new LogfileReader(filename);
}
  
/**
* Analyze the hourly access data from the log file.
*/
public void analyzeHourlyData()
{
while(reader.hasNext()) {
LogEntry entry = reader.next();
int hour = entry.getHour();
hourCounts[hour] = hourCounts[hour] + 1;  
}
}
  
/**
* EXERCISE 7.19
* Analyze the daily access data from the log file.
*/
public void analyzeDailyData()
{
while(reader.hasNext()) {
LogEntry entry = reader.next();
int day = entry.getDay();
dayCounts[day] = dayCounts[day] +1;  
}
}
  
/**
* EXERCISE 7.19
* Analyze monthly data from the logfile.
*/
public void analyzeMonthlyData()
{
while(reader.hasNext()){
LogEntry entry = reader.next();
int month = entry.getMonth();
monthCounts[month] = monthCounts[month] + 1;
System.out.println("anlays: "+month );
}
}
  
/**
* EXERCISE 7.10
* Print the hourly counts.
* These should have been set with a prior
* call to analyzeHourlyData .
*/
public void printHourlyCounts()
{
int hour = 0;
while( hour < hourCounts.length){
System.out.println( hour + ": " + hourCounts[hour]);
hour++;
}
  
// System.out.println("Hr: Count");
// for(int hour = 0; hour < hourCounts.length; hour++) {
// System.out.println(hour + ": " + hourCounts[hour]);
// }
}
  
/**
* EXERCISE 7.19
* Print the daily counts.
* These should have been set with a prior call
* to the analyzeDailyData .
*/
public void printDailyCounts()
{
for(int day = 0; day < dayCounts.length; day++){
System.out.println( (day + 1) + ": " + dayCounts[day]);
}
}
  
/**
* EXERCISE 7.19
* Print the monthly counts.
* These should have been set with a prior
* call to analyzeMonthlyCounts
*/
public void printMonthlyCounts()
{
for(int month = 0; month < monthCounts.length; month++){
System.out.println( (month + 1) + ": " + monthCounts[month]);
}
}
  
/**
* Print the lines of data read by the LogfileReader
*/
public void printData()
{
reader.printData();
}
}

public class LogEntry implements Comparable<LogEntry>
{
// Where the data values extracted from a single
// log line are stored.
private int[] dataValues;
// The equivalent Calendar object for the log time.
private Calendar when;
  
// At which index in dataValues the different fields
// from a log line are stored.
private static final int YEAR = 0, MONTH = 1, DAY = 2,
HOUR = 3, MINUTE = 4;
// The number of fields. If more fields are added, e.g. for
// seconds or a status code, then this value must be increased
// to match.
private static final int NUMBER_OF_FIELDS = 5;
  
/**
* Decompose a log line so that the individual fields
* are available.
* @param logline A single line from the log.
* This should be in the format:
* year month day hour minute etc.
*/
public LogEntry(String logline)
{
// The array to store the data for a single line.
dataValues = new int[NUMBER_OF_FIELDS];
// Break up the log line.
LoglineTokenizer tokenizer = new LoglineTokenizer();
tokenizer.tokenize(logline,dataValues);
setWhen();
}
  
/**
* Create a LogEntry from the individual components.
* @param year The year
* @param month The month (1-12)
* @param day The day (1-31)
* @param hour The hour (0-23)
* @param minute The minute (0-59)
*/
public LogEntry(int year, int month, int day, int hour, int minute)
{
// The array to store the data for a single line.
dataValues = new int[NUMBER_OF_FIELDS];
dataValues[YEAR] = year;
dataValues[MONTH] = month;
dataValues[DAY] = day;
dataValues[HOUR] = hour;
dataValues[MINUTE] = minute;
setWhen();
}
/**
* Return the minute.
* @return The minute field from the log line.
*/
public int getMinute()
{
return dataValues[MINUTE];
}
  
/**
* Return the hour.
* @return The hour field from the log line.
*/
public int getHour()
{
return dataValues[HOUR];
}
  
/**
* EXERCISE 7.19
* Return the day.
* @return int The day field from the log line.
*/
public int getDay()
{
return dataValues[DAY];
}
  
/**
* EXERCISE 7.19
* Return the month.
* @return int The month field from the log line.
*/
public int getMonth()
{
return dataValues[MONTH];
}
  
/**
* EXERCISE 7.19
* Return the year.
* @return int The year field from the log line.
*/
public int getYear()
{
return dataValues[YEAR];
}
  
/**
* Create a string representation of the data.
* This is not necessarily identical with the
* text of the original log line.
* @return A string representing the data of this entry.
*/
public String toString()
{
StringBuffer buffer = new StringBuffer();
for(int value : dataValues) {
// Prefix a leading zero on single digit numbers.
if(value < 10) {
buffer.append('0');
}
buffer.append(value);
buffer.append(' ');
}
// Drop any trailing space.
return buffer.toString().trim();
}
  
/**
* Compare the date/time combination of this log entry
* with another.
* @param otherEntry The other entry to compare against.
* @return A negative value if this entry comes before the other.
* A positive value if this entry comes after the other.
* Zero if the entries are the same.
*/
public int compareTo(LogEntry otherEntry)
{
// Use the equivalent Calendars comparison method.
return when.compareTo(otherEntry.getWhen());
}
  
/**
* Return the Calendar object representing this event.
* @return The Calendar for this event.
*/
private Calendar getWhen()
{
return when;
}
/**
* Create an equivalent Calendar object from the data values.
*/
private void setWhen()
{
when = Calendar.getInstance();
// Adjust from 1-based month and day to 0-based.
when.set(dataValues[YEAR],
dataValues[MONTH] -1 , dataValues[DAY] -1 ,
dataValues[HOUR], dataValues[MINUTE]);
}
  
}

public class LogfileReader implements Iterator<LogEntry>
{
// The data format in the log file.
private String format;
// Where the file's contents are stored in the form
// of LogEntry objects.
private ArrayList<LogEntry> entries;
// An iterator over entries.
private Iterator<LogEntry> dataIterator;
  
/**
* Create a LogfileReader to supply data from a default file.
*/
public LogfileReader()
{
this("weblog.txt");
}
  
public LogfileReader(ArrayList<LogEntry> myentries)
{
entries = myentries;
}
/**
* Create a LogfileReader that will supply data
* from a particular log file.
* @param filename The file of log data.
*/
public LogfileReader(String filename)
{
// The format for the data.
format = "Year Month(1-12) Day Hour Minute";
// Where to store the data.
entries = new ArrayList<>();
  
// Attempt to read the complete set of data from file.
boolean dataRead;
try{
// Locate the file with respect to the current environment.
URL fileURL = getClass().getClassLoader().getResource(filename);
if(fileURL == null) {
throw new FileNotFoundException(filename);
}
Scanner logfile = new Scanner(new File(fileURL.toURI()));
// Read the data lines until the end of file.
while(logfile.hasNextLine()) {
String logline = logfile.nextLine();
// Break up the line and add it to the list of entries.
LogEntry entry = new LogEntry(logline);
entries.add(entry);
}
logfile.close();
dataRead = true;
}
catch(FileNotFoundException | URISyntaxException e) {
System.out.println("Problem encountered: " + e);
dataRead = false;
}
// If we couldn't read the log file, use simulated data.
if(!dataRead) {
System.out.println("Failed to read the data file: " + filename);
System.out.println("Using simulated data instead.");
createSimulatedData(entries);
}
// Sort the entries into ascending order.
Collections.sort(entries);
reset();
}
  
  
/**
* Does the reader have more data to supply?
* @return true if there is more data available,
* false otherwise.
*/
public boolean hasNext()
{
return dataIterator.hasNext();
}
  
/**
* Analyze the next line from the log file and
* make it available via a LogEntry object.
*
* @return A LogEntry containing the data from the
* next log line.
*/
public LogEntry next()
{
return dataIterator.next();
}
  
/**
* Remove an entry.
* This operation is not permitted.
*/
public void remove()
{
System.err.println("It is not permitted to remove entries.");
}
  
/**
* @return A string explaining the format of the data
* in the log file.
*/
public String getFormat()
{
return format;
}
  
/**
* Set up a fresh iterator to provide access to the data.
* This allows a single file of data to be processed
* more than once.
*/
public void reset()
{
  
dataIterator = entries.iterator();
}
/**
* Print the data.
*/   
public void printData()
{
for(LogEntry entry : entries) {
System.out.println(entry);
}
}
/**
* Provide a sample of simulated data.
* NB: To simplify the creation of this data, no
* days after the 28th of a month are ever generated.
* @param data Where to store the simulated LogEntry objects.
*/
private void createSimulatedData(ArrayList<LogEntry> data)
{
LogfileCreator creator = new LogfileCreator();
// How many simulated entries we want.
int numEntries = 100;
for(int i = 0; i < numEntries; i++) {
data.add(creator.createEntry());
}
}
  
  
}

public class LoglineTokenizer
{
/**
* Construct a LogLineAnalyzer
*/
public LoglineTokenizer()
{
}

/**
* Tokenize a log line. Place the integer values from
* it into an array. The length of the array must match
* the number of tokens on the line.
*
* @param logline The line to be tokenized.
* @param dataLine Where to store the values.
*/
public void tokenize(String logline, int[] dataLine)
{
StringTokenizer tokens = new StringTokenizer(logline);
if(tokens.countTokens() == dataLine.length) {
String number = "";
try{
StringTokenizer tokenizer = new StringTokenizer(logline);
int numTokens = tokenizer.countTokens();
for(int i = 0; i < numTokens; i++) {
number = tokenizer.nextToken();
dataLine[i] = Integer.parseInt(number);
}
}
catch(NumberFormatException e) {
System.out.println("Badly formatted number: " + number);
System.out.println("In log line: " + logline);
}
}
else {
System.out.println("Invalid log line: " + logline);
}
}
}

public class LogfileCreator
{
private Random rand;

/**
* Create log files.
*/
public LogfileCreator()
{
rand = new Random();
}
  
/**
* Create a file of random log entries.
* @param filename The file to write.
* @param numEntries How many entries.
* @return true if successful, false otherwise.
*/
public boolean createFile(String filename, int numEntries)
{
boolean success = false;
  
if(numEntries > 0) {
try {
FileWriter writer = new FileWriter(filename);
LogEntry[] entries = new LogEntry[numEntries];
for(int i = 0; i < numEntries; i++) {
entries[i] = createEntry();
}
Arrays.sort(entries);
for(int i = 0; i < numEntries; i++) {
writer.write(entries[i].toString());
writer.write(' ');
}
  
writer.close();
success = true;
}
catch(IOException e) {
System.err.println("There was a problem writing to " + filename);
}
  
}
return success;
}
  
/**
* Create a single (random) entry for a log file.
* @return A log entry containing random data.
*/
public LogEntry createEntry()
{
int year = 2011;
int month = 1 + rand.nextInt(12);
// Avoid the complexities of days-per-month.
int day = 1 + rand.nextInt(28);
int hour = rand.nextInt(24);
int minute = rand.nextInt(60);
return new LogEntry(year, month, day, hour, minute);
}

}

  
LogEntry le1, le2, le3, le4, le5;
  
public Simple()
{
le1 = new LogEntry(2017, 1, 1, 1, 2);
le2 = new LogEntry(2017, 10, 23, 11, 2);
le3 = new LogEntry(2017, 10, 23, 11, 2);
le4 = new LogEntry(2017, 11, 23, 11, 2);
le5 = new LogEntry(2017, 11, 23, 11, 2);
  
ArrayList<LogEntry> data = new ArrayList<LogEntry>();
data.add(le1);
data.add(le2);
data.add(le3);
data.add(le4);
data.add(le5);
  
LogfileReader lr = new LogfileReader(data);
//lr.createSimulatedData(data);

//Reset is called here to initiate the Iterator as we have given manual input. No need to call here if .txt file is used as input
lr.reset();

LogAnalyzer la = new LogAnalyzer();
la.reader = lr;

la.analyzeMonthlyData();
la.reader.reset();//Called to reset iterator
la.analyzeHourlyData();
la.reader.reset();//Called to reset iterator
la.analyzeDailyData();
  
la.printHourlyCounts();
la.printDailyCounts();
la.printMonthlyCounts();


}
public static void main(String args[]){
Simple s = new Simple();
}  
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote