0% found this document useful (0 votes)
36 views3 pages

Software Dev Var Homeowrk

The document lists different types of operators in programming including arithmetic, comparison, and logical operators. It provides examples of common operators such as =, <>, ==, <=, *, /, &&, ||, >, ! showing their operation and how they are used. The operators that are the same between different languages are Or and ||, And and &&, <> and !=.

Uploaded by

Domsmasher
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views3 pages

Software Dev Var Homeowrk

The document lists different types of operators in programming including arithmetic, comparison, and logical operators. It provides examples of common operators such as =, <>, ==, <=, *, /, &&, ||, >, ! showing their operation and how they are used. The operators that are the same between different languages are Or and ||, And and &&, <> and !=.

Uploaded by

Domsmasher
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Operator Type of operator (arithmetic, Operation of operator (give an

comparison, logical) example)


= comparison Variable assignment
$a = 1, $b = 2, $c = 3 (used for
other examples)
<> comparison Not Equal
If $a <> $b;
Echo “not equal”;
Else;
Echo “equal”;
== comparison Equal
If $b == 2;
Echo “equal”;
Else;
Echo “not equal”;

<= comparison Less than or equal to


$a<=$a
$a<= $b
All are equal to true
And logical True if both statements are
true
($a > 0 && $b < 10) = false
* arithmetic Multiply
$b*$c = 6
|| logical True if one of the statements
are true
($a > 0 && $b < 10) = true
> comparison Greater than
$a>0 = True
$a> $Wb = False
&& logical True if both statements are
true
($a > 0 && $b < 10) = false
! logical True if the statement is not
true
!($a > 5) is true
/ arithmetic Division
$c/$b = 1.5
Or logical True if one of the statements
are true
($a > 0 && $b < 10) = true
!= comparison Returns true if
$a is not equal to $a
$a != $b = true
1b

The operators that are the same are:


Or and ||, And and ||, <> and !=
Part 2
Task a

Description Data type Justification Variable name


Store a person’s name String This is only letters so a $name
string would be the
easiest way to store it
Store an interest rate Float An interest rate $intrestRate
normally has decimal
places, which floats
are good at dealing
with.
Store a person’s last String This is only letters so a $lastName
name string would be the
easiest way to store it
Store an Australian String This would be stored $postcode
postcode as a string as it is not
going to be modified
through math and
only compared
Store some Australian String This would be stored $worldPostcode
and international post as a string as it is not
codes going to be modified
through math and
only compared
Store someone’s String This would be stored $birthday
birthdate as a string as it is not
going to be modified
through math and
only compared
Store if a light is on or Boolen There are two options $lightSwitch
off for this data, true or
false (on or off)
Part 3
task a

Part b

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy