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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started