Question: I need help with this assignment Write the code for a PHP class named Car that has four private properties: id, model, year, price. The

I need help with this assignment

Write the code for a PHP class named Car that has four private properties: id, model, year, price. The class should have a constructor, and four pairs of get/set methods. This class should be saved in a file named car.php;

The user can enter data in the two textboxes (such as: 5,20000 ; should not be less than four cars). After the button Build the cars! is clicked, the data will be carried to the next web page;

In this page, the first paragraph displays the data it received from the previous page. Then it constructs the required number of Car objects as required using the PHP class created in Step 1). You can make up the model, year, price data yourself, but you must use PHP arrays for all your data. You must build the Car objects first, then send the properties of the objects to the database. After the Build the database! button is clicked, a database named myCarDB which has one table named cars will be created in the MySQL database server. Each car object corresponds to one row in the table.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!