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
Luda [366]
3 years ago
9

Which code segment results in "true" being returned if a number is odd? Replace "MISSING CONDITION" with the correct code segmen

t.
a) num % 2 == 0;
b) num % 2 ==1;
c) num % 1 == 0;
d) num % 0 == 2;

Computers and Technology
1 answer:
seropon [69]3 years ago
4 0

Answer:

b) num % 2 ==1;

Explanation:

Which code segment results in "true" being returned if a number is odd? Replace "MISSING CONDITION" with the correct code segment.

You might be interested in
Match the context details with the pattern that applies.
tia_tia [17]

Answer:

1. - Observer

2. - iterator

3. - strategy

4. - composite

5. - decorator

Explanation:

An object contains other objects (elements) and must give access to them for clients, without exposing its internal structure. This is an observation.

The subject-object can generate events as an iterable (iterator) and could use different strategic algorithms to achieve a task. Class objects can be used to aggregate other class objects.

In python, the decorator function mimics the outer function of a nested function, but still maintains the functionality of the second function

6 0
3 years ago
import java.util.Scanner; public class TeenagerDetector { public static void main (String [] args) { Scanner scnr = new Scanner(
Sonja [21]

Answer:

import java.util.Scanner;

public class TeenagerDetector {

   public static void main (String [] args) {

       Scanner scnr = new Scanner(System.in);

       boolean isTeenager;

       int kidAge;

       kidAge = scnr.nextInt();

       

       /* Your solution goes here */

       isTeenager = (kidAge >= 13) && (kidAge <= 19);

       if (isTeenager) {

           System.out.println("Teen");

           

       } else { System.out.println("Not teen"); } } }

Explanation:

A condition which check for the teenager age and return a boolean is assigned to isTeenager.

isTeenager = (kidAge >=13) && (kidAge <= 19);

So, if the kidAge is greater than/equal to 13 and less than/19, the boolean isTeenager will be true and the program will output "Teen" else "false" will be output.

The range of age for a teenager is 13 - 19.

5 0
4 years ago
Read 2 more answers
Create a function called biggestNum that returns the largest number in an array of integers. The function is passed only one par
goldenfox [79]

This is for Python

def biggestNum():

   array = []

   for i in range(8):

       number = int(input('Enter number: '))

       array.append(number)

   

   return max(array)

print(biggestNum())

5 0
3 years ago
Write a class named Movie that has fields to hold the following data: Title Studio Name Year produced Rating In the Movie class,
rewona [7]

Answer:

Explanation:

don't know

3 0
2 years ago
Which of the following methods are acceptable for opening the Word application?
Nookie1986 [14]
The word application is used to write documents, to write and edit business letters, to save documents that will be used again...
Selecting the Word application using desktop shortcut is one possible way of opening the Word application. Another method that is acceptable for opening the Word application is selecting the Word application pinned on the task bar.


4 0
3 years ago
Other questions:
  • Suppose the program counter (pc) is set to 0x2000 0000. is it possible to use the jump (j) mips assembly instruction to set the
    15·1 answer
  • What OS is most commonly used by businesses? Linux Macintosh Microsoft Windows
    11·1 answer
  • The hardware that takes the input data and works with it
    7·1 answer
  • how do i create an advanced search using the search criteria in the range K2:S3 and the inventory data where the results will be
    8·1 answer
  • Communications technology and the Internet can be used to reduce the time and costs involved in disseminating financial statemen
    14·1 answer
  • Write a program to compute the sum of digits in a number given by the user. You must use your own function to compute the sum of
    6·1 answer
  • Write a calculate_sq_inches_of_good_pizza function that accepts the diameter of a pizza and returns the area of the pizza minus
    7·1 answer
  • I need help building a computer what are some good parts?
    9·1 answer
  • What command can you use if you accidentally delete a sentence in your document?
    13·2 answers
  • The \t and \n are examples of one of Python's escape characters.<br><br> A. True<br> B. False
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!