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]
2 years ago
14

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

Computers and Technology
1 answer:
sladkih [1.3K]2 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
You are looking for a backup that copies only the files that have changes since the last full backup. Which of the following wil
adelina 88 [10]

Answer: d. incremental backup

Explanation:

In incremental backup it copies only the files that have changed since the last full backup. It does not backup all the files just like the full backup. it however backup those copies into the  system which has changed since the last backup.

In doing  so it just increases the efficiency and performance of the backup procedure. This process is basically preferred when the amount of file to be backup is huge and there is not enough time to do a full backup.

Increment backup also use less disk space.

Cloud backup uses most increment backup for its application.

6 0
3 years ago
Describe network in terms of the class computer lab
kobusy [5.1K]
<span>a group or system of interconnected people or things</span>
6 0
3 years ago
In a word processor, Tariq chooses Options from the Tools menu and then selects the Track Changes tab. Which of the following ta
bearhunter [10]

Highlight Changes

Compare Documents

3 0
3 years ago
How do airbags prevent injury?
NARA [144]

honestly i think ur answer would be D because it keeps you from flying out of the window

8 0
3 years ago
A circuit contains two 500 OHM resistors connected in parallel and is supplied with 60 VDC. What is the current in the circuit?
andreyandreev [35.5K]
Remember Ohm's law V=IR. Plugging in the information gives you 60=500\times I \\ \implies I=0.12 amperes of current.
5 0
3 years ago
Read 2 more answers
Other questions:
  • How do you delete text from a slide
    14·2 answers
  • What makes smartphones so fragile?
    7·1 answer
  • Which statement best describes the cut and paste option in a word processor?
    6·2 answers
  • A research team is studying parallel computing. They want to run parallel processes without having to use multiple processors. H
    15·2 answers
  • Importance of availability of mobile devices content that is of interest for users.
    12·1 answer
  • Your team will write a function that reverses a C-string, to practice using pointers. You must use pointers and C-strings for th
    6·1 answer
  • Write a program that has an array of at least 50 string objects that hold people’s names and phone numbers. The program then rea
    12·1 answer
  • MULTIPLE CHOICE:
    15·1 answer
  • Seneca has just applied conditional formatting and realizes that she has made a mistake. Which action should she take to fix the
    12·2 answers
  • true or false hardware diagnostics let you run a quick check of system hardware and can verify that most systems components are
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!