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
svp [43]
3 years ago
14

Unit 6: Lesson 2 - Coding Activity 1 AP Computer science

Computers and Technology
1 answer:
sladkih [1.3K]3 years ago
8 0

The complete program is to define a boolean method that returns true if all elements of an array are negative, or return false, if otherwise

The method in java, where comments are used to explain each line is as follows:

//This defines the method

public static boolean chkNegative (double[] myArr) {

   //This initializes a boolean variable

   boolean isNeg = true;

   //This iterates through the array

   for (int i = 0; i < myArr.length; i++) {

     //If the array element is 0 or positive

     if (myArr[i] >= 0) {

         //Then the boolean variable is set to false

       isNeg = false;

       //And the loop is exited

       break;

     }

   }

   //This returns true or false

   return isNeg;

 }

Read more about boolean methods at:

brainly.com/question/18318709

You might be interested in
Which term describes encryption that protects the entire original ip packet's header and payload?
mario62 [17]
The answer is <span> tunnel mode encryption.   This</span><span> describes encryption that protects the entire original ip packet's header and payload.  A tunnel mode encryption </span><span>protects the internal routing information by encrypting the IP header of the original packet. The original packet is encapsulated by a another set of IP headers. .<span>Additional headers are added to the packet; so the payload MSS is less.</span></span>
7 0
3 years ago
Read 2 more answers
Which line of code will use the overloaded division operation?
DerKrebs [107]

Answer:

B. result = numA/numB

Explanation:

__truediv__ overloads the / operator in Python. Since that has been defined in the class "num" and numA and numB are both objects of type "num" (numA / numB) will call num.__truediv__ using numA as "self" and numB as "b".

7 0
3 years ago
How to add a bill using the reciept capture?
HACTEHA [7]

Answer: add up all the numbers and then add the tax and then 30% of the total for the tax

Explanation:

like 3+6+8+10=26

26 30%=whatever that is and then add it all up againg and thta is your answer.

5 0
3 years ago
<img src="https://tex.z-dn.net/?f=%20%5C%3A%20" id="TexFormula1" title=" \: " alt=" \: " align="absmiddle" class="latex-formula"
Effectus [21]

Answer:

\tt \green{The \: elements }  \: of \:  \red{computer }  \: \blue{are:}

•Hardware

•Software

•Data

•Procedures

•Input Unit

•Output Unit

•CPU(Central Processing Unit)

•Connectivity

•Primary Memory

•Motherboard

•GPU(Graphics Processing Unit)

•Solid State Drive (SSD) or Hard Disk Drive (HDD)

•RAM

Explanation:

\tt \pink{HeavenMistress}

5 0
2 years ago
Read 2 more answers
When an application contains just one version of a method, you can call the method using a(n) ____ of the correct data type.
faltersainse [42]

Answer:

Parameter

Explanation:

q: When an application contains just one version of a method, you can call the method using a(n) ____ of the correct data type.

a: Parameter

3 0
3 years ago
Other questions:
  • What does it mean for a school to be “accredited”?
    5·1 answer
  • Prodeff, an online project management software, is available at a price of $1 per use. The software requires the user to enter t
    13·1 answer
  • A card ____ is a device that reads data, instructions, and information stored on flash memory cards.
    8·1 answer
  • A user is connecting to an e-commerce server to buy some widgets for a company. the user connects to the site and notices there
    10·1 answer
  • In chapter 3, we discussed syntax and semantics, in general there are two types of grammars for programming languages, regular a
    14·1 answer
  • To convince the server that a user is authentic, the authentication server creates a _________ that contains the user's ID and n
    13·1 answer
  • USE THIS CODE ON FETCH REWARDS FOR BRAINLIEST​
    10·1 answer
  • What is data and information
    9·1 answer
  • Please help 2 lazy to do! easy question
    10·1 answer
  • How do i copy a canvas course from old class to new course.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!