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
A ___ is a type of computer that is small and portable?
geniusboy [140]

Answer:

laptop

Explanation:

laptops are small and they can be taken anywhere.

5 0
1 year ago
The term for an operator that may not evaluate one of its subexpressions is
Xelga [282]

Answer:

short-circuit

Explanation:

3 0
2 years ago
in Google, how should you phrase your search if you want to exclude a certain word from your results(for example,"chocolate")?
dusya [7]
I found this:
ou can exclude words from your search by using the - operator; any word in your query preceded by the - sign is automatically excluded from the search results. Remember to always include a space before the - sign, and none after

I found it here:
http://www.informit.com/articles/article.aspx?p=675274&seqNum=3
3 0
2 years ago
If we have the following array/list:
oee [108]

Answer:

The correct answer is A) "red"

Explanation:

Using arrays and lists are very helpful when writing programs. They help simplify programs by storing <u>related data</u> under one name.

In the question above the general name is <u>myList</u>. <em>The related data are red, orange, yellow, green, blue, indigo, and violet.</em>

This means that myList contains values a,b,c,d,e,f, and g. However myList[1] only contains value "red".

Cheers!

4 0
3 years ago
Read 2 more answers
The blank one is a close up of what logo?
fredd [130]

Answer:

These are company brand logo

Explanation:

These are company brand logo, and you will find it on all products of that company, plus generally you will find them on each page of their website as well as mobile application.

6 0
3 years ago
Other questions:
  • How do i start makeing a Character in the Unreal Game Engine
    14·2 answers
  • What is the height of the tallest possible red-black tree containing 31 values?
    7·1 answer
  • At an uncontrolled intersection, you should yield to the car on the right. True or false.
    10·2 answers
  • Given the lists list1 and list2, not necessarily of the same length, create a new list consisting of alternating elements of lis
    10·1 answer
  • What is the least number of bits you would need to borrow from the network portion of a Class B subnet mask to get at least 130
    10·1 answer
  • "You are working on a Debian distribution of Linux. You need to install a package, but you do not want to manually install all t
    8·1 answer
  • Write a C++ program that produces a simple personalized adventure game called Lost Fortune about a band of explorers that finds
    12·1 answer
  • E-mail has made it very easy to send a message to more than one person at any time of day from just about anywhere. If you wante
    7·1 answer
  • What is an example of a device that commonly use Linux today
    7·2 answers
  • A common attack in which a client's cookies, security tokens, or other personal information is obtained and used to impersonate
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!