Question: My current code is as follows, this is for a demo I'm presenting to some friends. Here's what I need to do. Declare a class

My current code is as follows,

this is for a demo I'm presenting to some friends. Here's what I need to do.

Declare a class called "Book" that will allow the addition of new books.

Include public properties (variables inside a class) for:

Title

Author

Blurb

Image location(for now you can just use a placeholder, C:\Program Files\Ampps\www\bookst\imgs)

Price

Then, Add a constructor that accepts 5 input parameters (one for each property).

Use it to assign values on creation to those properties.

Now, use the new class to create book objects.

Using the following book names, "Test 1", "Test 2", "Test 3", "Test 4" - create 4 book objects 1 for each of the 4 books listed on the index page

(index page is separate, so test names work fine)

Copy/paste "title", "author", "blurb", "image location", and "price" as placeholders in the values section. Add each book to an array called $books as you create it; this is so new books can be added later.

Please make the array indexed.

Thank you!

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!