

























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The key points in computer security which should be know as a beginner are given below:Selection, Making Choices, Execution, Days, Relational Operators, Boolean Values, Expressions, True or False, Must Evaluate, Conditional Expressions
Typology: Lecture notes
1 / 33
This page cannot be seen from the preview
Don't miss anything!


























leap year?
February has 29 days
February has 28 days
yes
no
(^) e.g., if it is a leap year then there are 29 days in February – otherwise there are 28
(^) i.e., “Hello” == “Hello” may not work!
(^) “Hello”.compareTo(“Hello”) == 0 (^) “Hello”.equals (“Hello”) (^) aString.compareTo (“somevalue”) == 0 (^) aString.equals (“somevalue”)
if (year < 2000) { fearFactor = 1; } else { fearFactor = 0; } if (fearFactor == 1) { System.out.println (“be afraid – be very afraid”); } else { System.out.println (“it’s OK! no Y2K bug!”); }
year-end?
yes Bonus cheque !!
no
String password = Keyboard.readString(); if (password.equals (realPassword)) { if (name.equals (“admin”)) { loggedIn = superPrivileges = true; } } else { System.out.println (“Error”); }
(^) Multiple conditions, each of which causes a different block of statements to execute. (^) Can be used where there are more than 2 options.
if ( condition1 ) { statements … } else { if ( condition2 ) { statements … } else … }
if (operation == ‘a’) { answer = first + second; } else if (operation == ‘s’) { answer = first – second; } else if (operation == ‘m’) { answer = first * second; }
(^) () (highest precedence – performed first) (^)! (^) * / % (^) + - (^) < <= > >= (^) == != (^) && (^) || (^) = (lowest precedence – performed last)