Logical operators, JAVA Programming

Assignment Help:

Logical Operators

Operator

Functionality

Example/ Explanation

 

 

&&

Looks at 2 expressions & returns a value of "true" if the expressions on the left & right of the operator are both true

If day = 'friday' && date=13 then alert("do You believe in astrology?") Compares the value of the day and the date. If it is true that today is

a Friday and if it is also true that the date is the 13th, then an alert box pops up with the message "Are You believe in astrology?"

 

 

 

 

 

||

Looks at two expressions & returns a value of "true" if either one -- although not both -- of the expressions are true.

if day='friday'&&date=13  then alert("do you believe in astrology?") else if day='friday'||date=13  then alert("Aren't you glad it isn't Friday the 13th?") Compares the value of the day & the value of the date. If it is true that today is a Friday & if it is also true that the date

is the 13th, then an alert box pops up with

the message " do You believe in astrology?" If both are not true, the script moves onto the next line of code...  Which compares the value of the day & the value of the date? If either one -- however not both -- is true, then an alert box pops up with the message "Aren't you glad it isn't Friday the 13th?"


Related Discussions:- Logical operators

Arrays, 1. Arrays and working with arrays

1. Arrays and working with arrays

Compression, 1 occurrence of "oog", and 1 occurrence each of "goog", "oogo"...

1 occurrence of "oog", and 1 occurrence each of "goog", "oogo",

Explain code and document bases, Explain Code and Document Bases ? If ...

Explain Code and Document Bases ? If you don't know the exact URL of the image, but you do know its name and in which it's in the similar directory as the applet, you can use

A new dynamic website, A NEW Dynamic Website I have the subsequent requi...

A NEW Dynamic Website I have the subsequent requirement which needs to be designed in 30 days (Max). 1) Construct a website which is a dynamic, means allow me to change conte

Program implement class which have main string method, Implement the Money ...

Implement the Money class discussed in class. This class should represent a dollar and cents amount with 0-99 cents and the cents being the same sign as the dollars. The class shou

Create an android application., We need to create an Android application. T...

We need to create an Android application. The application is about registering courses in a university, viewing grades, available courses and evaluating faculty members. Advisor

Explain jar archives, Explain JAR Archives ? HTTP 1.0 uses a separate ...

Explain JAR Archives ? HTTP 1.0 uses a separate connection for every request. When you're downloading several small files, the time required to set up and tear down the connec

SMALLTALK PROGRAMING, YOUR EXPERT CAN DEAL WITH SMALLTAK PROGRAMMING AND BP...

YOUR EXPERT CAN DEAL WITH SMALLTAK PROGRAMMING AND BPMN AND DoME BECAUSE I HAVE PROJECT RELATED WITH THIS PROGRAMING

Programing, A servey is done in M.P. by forest department finding different...

A servey is done in M.P. by forest department finding different types of species of birds the servey data covered four major cities indore,Bhopal,Gwalior,vidhisa. The result they o

Create an embedded javascript function, Given the following XHTML page: ...

Given the following XHTML page:   Create an embedded JavaScript function named getUserInfo that prompts the user with the following two questions after the XHTML page has loa

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd