1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
sammy [17]
3 years ago
9

Analyze the following code (in both cases number has been declared and initialized): Code 1: boolean even; if (number % 2 == 0)

even = true; else even = false; Code 2: boolean even = (number % 2 == 0);
Computers and Technology
1 answer:
shusha [124]3 years ago
8 0

Answer:

Both codes are correct.The value of even is true when the number is even.

Explanation:

Code 1:

number %2 ==0 means that when dividing number by 2 is the remainder coming out is zero.If it is true then even becomes is true if it is false then else statement is executes in which even becomes false.Means the number is odd.This code is simple and easy to understand.

Code 2:-

This code is a bit tricky and takes time to understand.even becomes true

when the number is divisible by 0 and false when it is not.

You might be interested in
Which layer in the Transmission Control Protocol/Internet Protocol (TCP/IP) model is responsible for delivering data between two
s2008m [1.1K]

Answer:

Network.

Explanation:

The Transmission Control Protocol/Internet Protocol (TCP/IP) model is a standard networking protocol which allows network devices such as routers, switches, and host computers to interconnect and communicate with one another over a network. The Transmission Control Protocol/Internet Protocol (TCP/IP) model comprises of four (4) layers and these includes;

I. Application layer.

II. Transport layer.

III. Internet layer.

IV. Network layer.

The network layer in the Transmission Control Protocol/Internet Protocol (TCP/IP) model is responsible for delivering data between two nodes.

Basically, this layer known as network layer is the fourth layer of the Transmission Control Protocol/Internet Protocol (TCP/IP) model and it is typically responsible for the transmission of packets from one network device to another.

4 0
3 years ago
How to work a computer cause i don't know how to
VladimirAG [237]

Answer:

power on, connect to internet, download games

6 0
3 years ago
Can someone answer this for me will award brainliest lol
Natasha2012 [34]

Answer: Without GUI's being developed, we most likely would still be using terminal systems. Terminals require command/text input rather than mouse or  other input. The invention of GUI's enabled people to use simpler input methods, rather then clunky text input systems. To sum, GUI's simplified the computer experience as we know today.

Hope this helped :)

6 0
3 years ago
Read 2 more answers
Does anyone go to connections acadomy​
Komok [63]

Answer:

no I dont where is that at

7 0
3 years ago
Read 2 more answers
Of the choice below,access to with tab will start a power point presentation
kow [346]

the menu and the toolbars
4 0
3 years ago
Other questions:
  • ​ If a class is reusable, that is to say that it can be used in several different applications, then it has been designed using
    5·1 answer
  • What short (two letters!) but powerful boolean operator can check whether or not one string can be found in another string?
    12·1 answer
  • An aircraft departs an airport in the mountain standard time zone at 1615 MST for a 2-hour 15-minute flight to an airport locate
    14·1 answer
  • When microsoft introduced its zune mp3 player, many people thought it would capture the mp3 player market by pricing its product
    8·1 answer
  • Is backing up computer files done on the hard drive?
    14·2 answers
  • What is ambiguous grammar, explain in maximum 50words.
    5·1 answer
  • write a script to check command arguments. Display the argument one by one (use a for loop). If there is no argument provided, r
    6·1 answer
  • Using a third-party package of your choice, write a program that reads the contents of a csv file and saves it to an Excel file.
    10·1 answer
  • How can I hide my cracked phone screen? or How can I fix it myself without my parent finding out? or How can I fix my phone with
    14·1 answer
  • How to execute python code in command prompt *window*?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!