Jump to content

Recommended Posts

Please can anyone help me with the following 8 questions?!  Need answers for an application I'm creating with a friend!!  Really appreciate it!!

 

1. Using PHP, determine whether the method 'happy_days' exists in the class Test.

class Test{

  public function happy_days(){

    return null;

  }

}

Answer:

 

2. Extract and add together the numeric values from the string $var

$var = '{"val_a":7,"val_b":5,"val_c":4,"val_d":6,"val_e":5}';

Answer:

 

3. Finish the following class to print "Person->name has been frogged" when the following is executed on a Person object: print $person;

class Person{

  private $name = '';

  public function __construct($name){

    $this->name = $name;

  }

}

$person = new Person('john');

 

print $person; // john has been frogged

.

.

.

Answer:

 

4. create a function to replace all instances of 'test' with 'frog' within the values of the following array

$test = array('key1'=>'test1', 'key2'=>'value2', 'key3'=>array('test','test1','test2'));

Answer:

 

5. Get a list of filename and filepaths with the extension '.png' in the following directory structure, your solution should allow further files and directories to be added at any point in the tree:

- folder

  - test1.png

  - test2.png

  - untitled.txt

  - subfolder

    - test3.png

    - untitled1.txt

Answer:

 

6. Edit the following html/javascript so that when a user submits the form, the element with id #container is updated with the value from #name

<form action="" method="post" name="form_name" id="form_name">

<fieldset>

<label for="your_name">Enter Name</label>

<input type="text" name="your_name" id="your_name" />

<input type="submit" />

</fieldset>

</form>

Answer:

 

7. Create javascript so that the following methods produce the output listed next it.

circle = new Circle();

console.log(circle.get_area());  // 3.141592653589793

circle.set_radius(10);

console.log(circle.get_area());  // 314.1592653589793

console.log(circle);            // the radius of my circle is 10 and it's area is 314.1592653589793

Answer:

 

8. Using JQuery fetch the latest 5 tweets and list them inside the dom element identified by #twitter and link them to the original tweet.

<div id="twitter"></div>

<script type="text/javascript">

var twitter_json_feed = "http://twitter.com/statuses/user_timeline/15074090.json?count=5&callback=?";

var twitter_user = "frogtrade";

</script>

Answer:

How can you rightfully judge whether something is too much to ask unless you know how to do it already and are just being lazy?

 

Seriously dude, computer classes are not required courses.  If you're just gonna have someone else do your work, why signup for it in the first place? We are here to help people learn.  You don't learn by having others do stuff for you.

How can you rightfully judge whether something is too much to ask unless you know how to do it already and are just being lazy?

 

Seriously dude, computer classes are not required courses.  If you're just gonna have someone else do your work, why signup for it in the first place? We are here to help people learn.  You don't learn by having others do stuff for you.

 

I understand Dude, just was wondering even a little help i'd appreciate it.  I am learning PHP5 BUT if anyone can give me some help or pointers i'd appreciate it...

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.