Announcements | Last Post | |
---|---|---|
SoC Curricula | 09/30/2017 01:08PM | |
Demarcation or scoping of examinations and assessment | 02/13/2017 07:59AM | |
School of Computing Short Learning Programmes | 11/24/2014 08:37AM | |
Unisa contact information | 07/28/2011 01:28PM |
Chapter 2 - Variables. A twist of the exercise February 14, 2013 11:02PM |
Registered: 11 years ago Posts: 3 Rating: 0 |
Re: Chapter 2 - Variables. A twist of the exercise February 15, 2013 05:16AM |
Registered: 11 years ago Posts: 20 Rating: 0 |
Re: Chapter 2 - Variables. A twist of the exercise February 15, 2013 08:31AM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Re: Chapter 2 - Variables. A twist of the exercise February 15, 2013 02:39PM |
Registered: 17 years ago Posts: 60 Rating: 0 |
Re: Chapter 2 - Variables. A twist of the exercise February 18, 2013 07:40AM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Re: Chapter 2 - Variables. A twist of the exercise February 20, 2013 09:19PM |
Registered: 17 years ago Posts: 60 Rating: 0 |
Re: Chapter 2 - Variables. A twist of the exercise February 25, 2013 03:16PM |
Registered: 11 years ago Posts: 34 Rating: 0 |
Re: Chapter 2 - Variables. A twist of the exercise February 25, 2013 03:48PM |
Registered: 11 years ago Posts: 131 Rating: 0 |
Re: Chapter 2 - Variables. A twist of the exercise February 25, 2013 04:38PM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Re: Chapter 2 - Variables. A twist of the exercise February 26, 2013 04:50PM |
Registered: 11 years ago Posts: 51 Rating: 0 |
Re: Chapter 2 - Variables. A twist of the exercise February 26, 2013 10:43PM |
Registered: 11 years ago Posts: 163 Rating: 0 |
Re: Chapter 2 - Variables. A twist of the exercise February 27, 2013 08:01AM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Language: PHP$value=0; //because you typed a zero, the variable is now an integer type variable. $amount=0.00; //this is now a float $amount=';Arrears"; //now it is a string
Re: Chapter 2 - Variables. A twist of the exercise February 27, 2013 10:38AM |
Registered: 11 years ago Posts: 34 Rating: 0 |
Re: Chapter 2 - Variables. A twist of the exercise February 27, 2013 09:22PM |
Registered: 11 years ago Posts: 51 Rating: 0 |
Re: Chapter 2 - Variables. A twist of the exercise March 20, 2013 09:55PM |
Registered: 11 years ago Posts: 64 Rating: 0 |
Re: Chapter 2 - Variables. A twist of the exercise March 21, 2013 05:25AM |
Registered: 11 years ago Posts: 38 Rating: 0 |
Language: PHP$foo = "0"; // $foo is string (ASCII 48) .... $foo = 5 + "10 Little Piggies"; // $foo is integer (15) ...
Php interprets the variables as integers, because + creates a numerical context, although you declared the variables as strings earlier on.Language: PHPprint($fifth_number+$sixth_number);
Re: Chapter 2 - Variables. A twist of the exercise March 21, 2013 02:39PM |
Registered: 11 years ago Posts: 23 Rating: 0 |
Language: PHP<html> <head> <title> Numbers and Strings </title> </head> <body> <?php $String10 = ';10';; $String20 = ';20';; $StringHat= ';hat';; $PlusTotal= print($String10 + $String20.';</br>';); //prints 30 $PlusTotal= print($String10 + $String20 + $StringHat.';</br>';);//prints 30 and disregards $StringHat $ConcatenateTotal = print($String10.$String20.$StringHat.';</br>';);//prints 1020hat ?> </body> </html>
Re: Chapter 2 - Variables. A twist of the exercise April 02, 2013 12:41AM |
Registered: 11 years ago Posts: 56 Rating: 0 |