Php Assignment

Order Description

ICS-325-01 Spring 2019Assignment 5For this assignment, will will be running PHP on the command line (CLI). To do so in PHP, right clickon your code window, and then select icon with the text PHP next to it. See the image below:The example code we went over in class is included in the directory example_classes. It shows thebasics of how to write object-oriented PHP program with an abstract class and subclasses.The purpose of this programming assignment is to become comfortable with using the object-orientedfeatures of PHP. You need to create an abstract Report class that 3 other child classes inherit from.Each subclass (child class) will perform an operation on the parameters give to the constructor and willimplement various methods from the abstract class to allow the report information to be extracted viamethod calls from the parent class.See the accompanied code files: assignment_5_given_code.php and Report.phpYou need to use the Report->printToTerminal() method provided in the code file in your Report class.You should also set the timezone to CST which is also shown in the code file. Finally, all your outputshould match that shown in the code file. You will want to comment out parts of the given code thatdon’t work due to missing subclasses. As you add a subclass, uncomment its require_once statementand the given test code that corresponds to that class. I will run the given code file in order to gradeyour program as well as review your source code.Each child class needs to implement various abstract methods which are used to generate the reportresult. Since all the reports should be in the same form, an abstract class Report is used as the parentfor all the children.Abstract Class ReportProperties:• private $generation_time_stampAbstract protected methods:• getTitle(): should return the title of the report as a string• getReportDescription(): should return the description of the report as a string• getParameterString(): should return the parameters given to the report as a string• getReportResultString(): should return the result of the report computationProtected methods:• getGenerationTimeStamp(): returns the value of the private property $generation_time_stampPublic methods:• printToTerminal(): prints all the report information to the terminal. Code is given for thismethod.• __construct(): set the private instance variable $generation_time_stamp to the current timestamp in the DATE_RFC2822 format (an example is given in the given code).printToTerminal: should be implemented as (which is provided in the given code file):public function printToTerminal(){echo "Report title: {$this->getTitle()}\n";echo "Report generated at: {$this->getGenerationTimeStamp()}\n";echo "Report description: {$this->getReportDescription()}\n";echo "Report parameters:\n{$this->getParameterString()}\n\n";echo "Report result:\n{$this->getReportResultString()}\n";}Basics of the Subclasses (child classes)Each child class requires parameters to in order to generate the report. The parameters are passed intothe constructor. A private instance variable should be used to store each parameter. The report resultcan either be generated in the constructor or in the getReportResultString() method.Class RangeReport extends Reporttitle: "Number Range Generation"description: "Prints every integer from START to END separated by a space."parameter string: "START: $this->start\nEND: $this->end" (make your variable names match)report result string: The string of integers separated by a comma a space, example:"3, 4, 5"constructor: first argument is the starting integer, second argument is the ending integerconstructor required validation of the starting and ending integers: Use the filter_var function to ensurethat the start and end values are integers and that they are in the range of 0 to 100. You don't need toperform any more validation than that. For example, it is okay if the end value is less than the startingvalue (that should return an empty string as there is no range value for those parameters).invalid input action: For both the start and end integers, throw an exception if they fail validation.There should be one exception thrown for when the start value fails with the message: "Bad startvalue." and another exception thrown for when the end values fails with the message: "Bad end value."Class SumReport extends Reporttitle: "Sum Calculator"description: "Sums the given integers."parameter string: "INTEGERS: " followed by the list of integers separated by a space and a comma(hint use the array function implode()), example:"INTEGERS: 2, 4, 6"report result string: The sum of the integers give in the input array.constructor: only argument is an array of integersvalidation: no validation requiredClass MinMaxReport extends Reporttitle: "Minimum and Maximum Finder"description: "Find the minimum and maximum of the given integers."parameter string: "INTEGERS: " followed by the list of integers separated by a space and a comma(hint use the array function implode()), example:"INTEGERS: 2, 4, 6"report result: "MINIMUM: $min\nMAXIMUM: $max" (make your variable names match)constructor: only argument is an array of integers (hint, array sorting can be used to find the min/max)validation: no validation requiredGrading4 pts Correct definition of the Report class10 pts Correct definition of the RangeReport class6 pts Correct definition of the SumReport class6 pts Correct definition of the MinMaxReport class6 pts Each report instantiation and printToTerminal call matches the expected output in the given codefile. This code is at the bottom of the file, and the expected output is shown in code comments. Yourcode output should match that could output exactly!32 pts TotalNote: You may collaborate with other students on this assignment, but you should write and turn inyour own code. It is important that you understand the concepts in this assignment in order to do wellin future assignments.