Jump to content

dakotaboy99

Members
  • Posts

    8
  • Joined

  • Last visited

Profile Information

  • Location
    New Orleans

dakotaboy99's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. I understand that ^^ but again he did not teach us this, thus Im trying to teach myself before Monday, I guess what i really need to know is how to start the algorithm in plain english...
  2. My instructor is very vague also, no one in class understands he teaching method, that why we all were shocked for him to give us a take home exam on something we never covered. He wants us to sort an array with 15 elements in descending order, 1,3,2,4,5,6,7,8,9,10,11,12,13,14,15 He gave us this to turn into the algorithm... function bubbleSort ($items) { $size = count($items); for ($i=0; $i<$size; $i++) { for ($j=0; $j<$size-1-$i; $j++) { if ($items[$j+1] < $items[$j]) { arraySwap($items, $j, $j+1); } } } return $items;}function arraySwap (&$arr, $index1, $index2) { list($arr[$index1], $arr[$index2]) = array($arr[$index2],$arr[$index1]); }
  3. Thats no help, considering my instructor, did not teach us this, basically wanted to see where we stand in the class, just gave us a take home exam and said do this, I dont have issues with the code, just the algorithm.
  4. The class I’m in went from basic PHP to Bubble Sort, the teacher gave us a take home exam to define an algorithm for a bubble sort, I have no idea how to begin this, even after a few hours trying to teach myself from online to the books I have, and any help would be appreciated. Thanks
  5. Thanks for all the help, still a long way to go but, im slowly starting to get some of my code down and the right syntax !
  6. Im really lost, the teacher didnt really teach, that is the first part of the code he gave us and thats the question he wanted answered, so im really not sure how to begin or end, this was our 3rd class meeting Create a PHP program that allows the user to enter in an integer value that represents the score of a test. Valid integer values are from 0 to 100 inclusive. Display the score (integer value) and the corresponding letter grade. The grade scale is 10 points.....
  7. <?php $score = 79; Echo “$score”; IF ($score > 89){ $letter = “A”;}ELSE IF ($score > 79){ $letter = “ B”;}ELSE IF ($score > 69){ $letter = “ C”;}ELSE IF ($score > 59){ $letter = “ D”;>? Not sure, the teacher didnt really teach us much, he basically said to teach yourself this problem, everyone in class didnt understand this
  8. Hello, Im new to the fourm, and just started taking a intro programming class and cant figure this php out, any help? Create a PHP program that allows the user to enter in an integer value that represents the score of a test. Valid integer values are from 0 to 100 inclusive. Display the score (integer value) and the corresponding letter grade. The grade scale is 10 points. 100 – 90 A 89 – 80 B 79 – 70 C 69 -60 D Less than 59 F <?php $score = 79; Echo “$score”; if ($score > 89){ $letter = “A”; }elseif ($score > 79){ $letter = “ B”; } elseif ($score > 69){ $letter = “ C”; } elseif ($score > 59){ or < $letter = “ D”; >? This is how our teacher started it off and whanted us to finish
×
×
  • Create New...