How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask Scott Your Own Question

Scott
Scott, MIT Graduate
Category: Homework
Satisfied Customers: 3040
Experience:  MIT Graduate (Math, Programming, Science, and Music)
3546829
Type Your Homework Question Here...
Scott is online now
A new question is answered every 9 seconds

All tasks should be completed using PHP and/or SQL. purposes

Customer Question

All tasks should be completed using PHP and/or SQL. For the purposes of this exercise, the PHP will be executed on the command line, and all output will be direct to STDOUT.----------------
CODING
----------------1) Create a 'dog' class and a 'cat' class.2) Create any properties and/or methods necessary for a 'dog' object to 'bow-wow' when asked to 'speak.' Also create any properties and/or methods necessary for a 'cat' object to 'meow' when asked to 'speak.'3) Create any properties and/or methods necessary for both the 'dog' and 'cat' objects to set and get a 'name' attribute.4) Create any properties and/or methods necessary for both the 'dog' and 'cat' objects to set and get an 'age' attribute.5) Modify the 'dog' and 'cat' constructors to accept a required initial 'name' and 'age'.6) Add an optional 'sound' argument to the 'speak' method for both the 'dog' and 'cat' classes. If the 'sound' argument is supplied, that argument should be returned; if no 'sound' argument is supplied, then the default sound appropriate to the animal should be returned.7) Modify the 'speak' method for both the 'dog' and 'cat' classes such that their 'age' increments by 1 every 2 times they speak.8) For both the 'dog' and 'cat' object, modify the method that sets the 'name' property such that the objects retain all names ever given to them separately from the object's current name.9) Create a method for both the 'dog' and 'cat' objects which returns the average length of all the names ever given to the object. For example, if the 'dog' object was given the names 'Rover' and 'Clifford', then this method should return 6.5.10) Create a 'run.php' file that includes the 'dog' and 'cat' classes.11) In 'run.php,' instantiate both the 'dog' and 'cat' objects. Make the 'dog' object's initial name be "Santa's Little Helper" and the 'cat' object's initial name be "Snowball II". Make both the 'dog' and 'cat' objects have an initial age that is a random integer between 1 and 5. The steps that follow should be coded sequentially after the objects are instantiated.12) Output the following line:is currently years old.... where is the 'dog' object's current name and is the 'dog' object's current age.13) Output the following line:says ? Nah, says ! Now is .... where is the 'dog' object's current name, is whatever is returned by the 'speak' method of the 'dog' object when 'meow' is passed in as the optional argument, is whatever is returned by the 'speak' method of the 'dog' object when no argument is passed in, and is the current age of the 'dog' object.14) Output the following line:The cat's name is .... where is the current name returned from the 'cat' object.15) Set the name of the 'cat' object to 'Garfield'.16) Output the following line:The cat's name has been changed to . The average length of the cat's name is .... where is the current name returned from the 'cat' object, and is whatever is returned when calling the method created in step #9.The full output of 'run.php' should now be:Santa's Little Helper is currently years old.
Santa's Little Helper says meow? Nah, Santa's Little Helper says bow-wow! Now Santa's Little Helper is .
The cat's name is***** cat's name has been changed to Garfield. The average length of the cat's name is .... where is the 'dog' object's initial random age, is the 'dog' object's age after speaking twice, and is the average of the cat's names.----------------
TESTING
----------------17) Create a PHP unit test that tests step #7 (the test should verify that the 'dog' or 'cat' object increments its age by 1 every 2 times it speaks).18) Create a PHP unit test that tests step #9 (the test should verify that the method that averages all names given to the 'dog' or 'cat' calculates correctly).----------------
SQL
----------------19) Now we want to persist the state of the 'cat' and 'dog' objects to database tables. Write SQL that would create the schema necessary to do so. We need to store not only their current name and age, but also a historical record of previous names for each.----------------
Theory
----------------20) List some ways to abstract the 'dog' and 'cat' objects if you haven't already implemented those abstractions. Also, which columns that you created in step #19 would you index and why?----------------
Please include instructions on how to run the unit tests you created in steps #17 and #18.
Submitted: 9 months ago.
Category: Homework
Customer: replied 9 months ago.
Posted by JustAnswer at customer's request) Hello. I would like to request the following Expert Service(s) from you: Live Phone Call. Let me know if you need more information, or send me the service offer(s) so we can proceed.
Expert:  Mr. Gregory White replied 9 months ago.

Hello, my name is Greg.

I see this might be time sensitive.

Do you still need this answered?

Customer: replied 9 months ago.
please as soon as possible please if you could today reply to me the answer
Expert:  Mr. Gregory White replied 9 months ago.

After going through my resources, I do not have what is necessary to complete at this time.

I am opting out and opening up to the other professionals and messaging a couple who might be able to help.

Someone should be with you shortly.

Customer: replied 9 months ago.
24 hours! guys just cancel it and refund whatever you toke because I passed the deadline because your lazy working and care so I don't need the answer anymore