Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Desktop/DCSP/DCSP Spring 19.Lab1.pdf Objective Use PHP classes to code a temperature converter PHP Class Definition: Temperature -celsiusTemp: float fahrenTemp: float - kelvin Temp: float +

image text in transcribed
image text in transcribed
Desktop/DCSP/DCSP Spring 19.Lab1.pdf Objective Use PHP classes to code a temperature converter PHP Class Definition: Temperature -celsiusTemp: float fahrenTemp: float - kelvin Temp: float + temperature(float temperature, string type) void + incrementTemp(float interval, string type): void + getCelsius): float +getFahren0: float + getKelvinO: float + isBoiling0: string +isFreezingO: string Class specifications: .Your constructor should take in an initial temperature and a type (C for Celsius, K for Kelvin, and F for Fahrenheit) o The constructor should store the temperature to the appropriate variable and also perform the appropriate conversions to initialize the other two temperature types incrementTemp should take in a interval to alter your temp and the type it's incrementing incrementing a Celsius temperature by 10 is way different than incrementing a Fahrenheit temperature by 10) o The other temperature types should be incremented based on the appropriate interval through conversion getCelsius, getFahren, and getKelvin should all return number values format to two decimal places . isBoiling should check if the current temperature is at or above the boiling point-since the Celsius, Fahrenheit, and Kelvin temperatures should be equivalently the same temperature, you should only have to check one value (Celsius for example)- return ea string "True" or "False": this allows to printing a value more easily readable by a user isFreezing checks is the current temperature is at or below the freezing point-return a string "True" or "False": this allows printing a value more easily readable by a user e/Desktop/DCSP/DCSP Spring 19 Lab1.pdf Program specifications: Implement the class within its own PHP file (called Temperature php) The function names should match those given in the class definition-it must work with my test file Implement a second PHP file that imports the class and tests it (caled testTemperature php) testTemperature php should implement one of the example tables found below o Additionaly, there should be a second table that uses a different incrementer (so, for instance, 25 instead of 10) and start point (so, maybe 100 instead of 0) o o The styling for the tables is included in the test file o testTemperature php should validate through w3school's validator remember, PHP doesn't validate, so you must get the code from the source in the browser and validate that Deliverables . Temperature php . testTemperature.php . Link to your testTemperature php on Pluto Both of these files should be submit through Cenvas and uploaded to Pluto. The link provided to testTemperature php should be submit via comment on Canvas Point Breakdown: Assignment submit correctly - 10pts . o This includes Pluto upload, Canvas upload, and the link to where your file is located Temperature php-50pts o Naming conventions and functions match those of the class definition (must work with the provided test file) o Returns rounded numbers o Math is correct o isBoilinglisFreezing only checks one temperature set testTemperature.php-40pts Includes both requested tables Source validates property o o

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions