help with this assignment :\


what u posted looks ok, and if i understood u right u have creaded this class.
so where is ur prob.

we’d realy like to help, but i have no idea what u are expecting us to tell u? what u have written looks good to me.

im supposed to do what it says up there. i cant figure out how you make a table with all the above to show up… but then you can have only certain ones show up like comm

could u post the relavent code u already have?

i just don’t know where to start. what do u have alredy?

do u have the class working?

do u have the array containing objects?

i have the table with all the information
but i dont know how to do the part that says

**Produce a function, showClass, which will take in an argument, $prefix, and produce a class list that matches the class prefix supplied by $prefix. For example, when you call the function showClass(‘CTEC’), only CTEC classes will be listed.
**To demonstrate the functionality of your script, call the showClass function with the argument set to $_GET[‘prefix’] at the end of your script.


sry i coudn’t reply earlyer. hope it’s not to late. u havn’t said when it has to be finished.

try to build the function as explained in

in there u need to access the array

then u need a foreach loop loopin throu the first-dimention.

and inside the foreach loop u need to compare $var[‘Course’] with $prefix.

and then just echo the info out

oh its due tomorrow…
okay i started working on it some more… this is what i have…
i still dont know what to fill in the blanks with… could you help me

COMM 2350 Intro to Comm Tech FAB 412
COMM3350 Website Communication FAB 411
BCMN 3319 Broadcast Managemen FAB 327
BCMN 3340 Electronic News FAB 112
ADVT 3305 Advertising Media FAB 409
<?php $classList = array (); $classList[0] = array(); $classList[0]['Course'] = "Comm 2350"; $classList[0]['Title'] = "Intro to Comm Tech"; $classList[0]['Room'] = " 412"; $classList = array (); $classList[1] = array(); $classList[1]['Course'] = "Comm 3350"; $classList[1]['Title'] = "Website Comm"; $classList[1]['Room'] = " 411"; $classList = array (); $classList[2] = array(); $classList[2]['Course'] = "BCMN 3319"; $classList[2]['Title'] = "Broadcast Management"; $classList[2]['Room'] = " 327"; $classList = array (); $classList[3] = array(); $classList[3]['Course'] = "BCMN 3340"; $classList[3]['Title'] = "Electronic News"; $classList[3]['Room'] = " 112"; $classList = array (); $classList[4] = array(); $classList[4]['Course'] = "ADV 3305"; $classList[4]['Title'] = "Media Advertising"; $classList[4]['Room'] = " 409"; echo "
    "; foreach($classList as $item) { echo "
  • ".$item. "
    "; } echo "
"; ?>

// go through course list
foreach ( ) {

// for each course, find out if its _____ course
if(0==$x) {

// yes, print it out

// no,ignore

//to test

<?php function showClass($X) { } showClass('CTEC'); showClass($_GET['prefix']); //end ?>

the foreach looks good but echo out $item[‘Course’] a.s.o.

and put it inside the function as u have to.

Sponsor our Newsletter | Privacy Policy | Terms of Service