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
Bingel [31]
3 years ago
6

Assume that an int variable is Quadrilateral has been declared, and that another int variable, number Of Sides has been declared

and initialized. Write a statement that assigns the value 1 if number Of Sides is exactly 4 and 0 otherwise.
Computers and Technology
1 answer:
kondor19780726 [428]3 years ago
4 0

Answer:

The answer to this question can be given as:

Statement:

isQuadrilateral = (numberOfSides == 4) ? 1 : 0;

//check condition using ternary operator.

Explanation:

we know that both(Quadrilateral, numberOfSides) is already declared in the program. So the statement for check condition is (isQuadrilateral = (numberOfSides == 4) ? 1 : 0;). To check this condition we use the ternary operator. In this operator, we also check another condition. The syntax of ternary operator (condition ? value_if_true : value_if_false).In this statement on the lift side we use the variable for check condition and right side we check condition if the value is true it prints 1 else it will print 0.

You might be interested in
What will be displayed after the following statements execute? int funny = 7, serious = 15; funny = serious % 2; if (funny != 1)
Reika [66]

Answer:

1 1

Explanation:

First we have funny = 7 and serious = 15 .Then after that remainder when serious is divided by 2 is stored in funny that is 1.if condition will be false because funny is equal to 1.else if condition will also be false because it is not 2.So else will be executed and funny =1 and serious =1.

Output=1 1

8 0
4 years ago
Read 2 more answers
g Create a public non-final generic class called YourSimpleLinkedList. You should extend SimpleLinkedList which is parameterized
larisa86 [58]

Answer:

See explaination

Explanation:

class YourSimpleLinkedList<E> extends SimpleLinkedList<E> {

public boolean search(E value) {

if (value == null)

throw new IllegalArgumentException();

Item temp = start;

while (temp != null) {

if (temp.value.equals(value))

return true;

temp = temp.next;

}

return false;

}

}

3 0
3 years ago
Select three physical forms of storage. USB drive Primary cache Magnetic storage Secondary cache Dynamic RAM Optical drive
Elis [28]

Answer:USB drive

Magnetic storage

Optical drive

Explanation:

hope this helps

6 0
3 years ago
Read 2 more answers
Suppose you are choosing between the following three algorithms:
Pavel [41]

Answer:

Algorithm C is chosen

Explanation:

<u>For Algorithm A </u>

T(n) = 5 * T ( n/2 ) + 0(n)

where : a = 5 , b = 2 , ∝ = 1

attached below is the remaining part of the solution

6 0
3 years ago
Module 7: Input and Output, 7-13d: Checkpoint
Oksi-84 [34.3K]

Answer:

F

Explanation:

6 0
4 years ago
Other questions:
  • What benefit does internet have​
    11·1 answer
  • Riley is using access to collect data for a science project. he is creating a report and wants to apply predefined color and fon
    6·1 answer
  • An app for a hair styling stop needs a form for the various services that they offer. What control should be used to display all
    6·1 answer
  • "Two technicians are discussing FWD driveshaft service. Technician A says that removal of the driveshaft usually requires partia
    15·1 answer
  • At the Transport layer of the OSI, what is used to find and communicate with a particular application running on a host?
    7·1 answer
  • You use the ____ button if you want to specify subtotals or other calculations within the wizard.
    12·1 answer
  • c) If you are at foreign country visit, which banking card would you prefer to keep with you during visit (Debit Card or Credit
    10·1 answer
  • A user calls the help desk to report that a mobile device exhibits very slow performance. What could cause this problem
    9·1 answer
  • A(n) _____ is a data validation rule that should be applied to mandatory data items.
    15·1 answer
  • Characteristics of partial copy sandboxes versus full sandboxes? choose 2 answers
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!