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]
4 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]4 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
Easy upgrade from windows xp to windows 7
LenaWriter [7]
Firstly you have to go to opera mini then search for upgrading Windows XP to Windows 7 then it will automatically upgrade to Windows 7
6 0
3 years ago
In a print statement, you can set the ________ argument to a space or empty string to stop the output from advancing to a new li
cluponka [151]
The answer to the question is end
5 0
3 years ago
Read the section, "Junior Year." Why would someone chose to complete an apprenticeship after high school? How many occupations c
Tamiku [17]

An apprenticeship prepares you for a career through a structured program of on-the-job learning with classroom instruction, while you work and earn a salary. The programs can last from one to six years and you can choose careers in areas such as telecommunications, health care, computing, business support and the arts. The most common apprenticeships are in construction and manufacturing. If you like to work with your hands and your mind, you might want to consider an apprenticeship after high school. More than 850 occupations can be learned on the job through an apprenticeship.

7 0
3 years ago
Read 2 more answers
What is autofill in a excel spreadsheet?
Digiron [165]
Autofill is to automaticlly put the information in a spreadsheet
5 0
3 years ago
The fact that the impact of changes in the elements making up an IT (software) project are not proportional or intuitive is rela
Furkat [3]

Answer:

Multidimensionality

Explanation:

Multidimensionality is the ability to exhibit many diverse characteristics thereby giving programs the ability to manipulate the storage and presentation of data in various ways without disrupting the integrity and reliability of the data. It is very important that users have the capability to customize and change their views of data and user information to suit their specific needs and allow users to carry out any type of analysis within the database.

5 0
3 years ago
Other questions:
  • Worms often try to disguise from where they are sending data by using a bogus ip addresses instead of using an authorized ip add
    11·1 answer
  • Describe the importance of prioritizing your focus when designing for multiple purpose
    9·1 answer
  • Ooooooooooooooooooooooooooooh im blinded by the lightssssssssss
    11·1 answer
  • A formula =A1+B2 is in cell D8. If you copy that formula to cell D9, what is the new formula in cell D9? A. '=A1+B2 B. '=A2+B3 C
    8·2 answers
  • Refer to the exhibit. If a hacker on the outside network sends an IP packet with source address 172.30.1.50, destination address
    11·1 answer
  • What are the defenses to protect against these attacks?
    13·1 answer
  • Universal Containers uses a custom object within the product development team. Product development, executives, and System Admin
    11·1 answer
  • Select the correct answer from each drop-down menu.
    12·1 answer
  • If you are going to develop a special computer, what would it be and explain it's purpose.​
    15·1 answer
  • Is there actually a difference between left and right twix
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!