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
Which of the following things would you access from the Program &amp; Courses page? Course descriptions Tutorial videos Account
Paraphin [41]

Course descriptions.

5 0
3 years ago
Audra is creating a training document and would like to include an image that she sees on her screen that she has marked up for
kupik [55]

Answer:

the first and last one

Explanation:

give me brainilest

4 0
3 years ago
Read 2 more answers
Modern ancestor of the typewriter
Rashid [163]
I would think Microsoft Word would be the answer. It does everything a typewriter can.
4 0
2 years ago
Read 2 more answers
Identify the flaws / limitations in the following ConvertToNumber method:
lions [1.4K]

Answer:

Flaws and limitations identified in this program includes;

1.There was a not necessary usage of variable retrieval. Would have made use of canConvert.

2. Looking at the program, one will notice numerous typos. One of which is the fact that in JAVA we make use of Boolean instead of bool.

3.We rather use Integer.parseInt in JAVA and not Int16, cant make use of Int16.

4. The exception cant be printed

5. JAVA makes use of checkConversion instead of convertNumber as used in the program.

6. It cant work for decimal numbers, 0 and big integers.

Explanation:

See Answer for the detailed explaination of the flaws and limitations identified in the program.

4 0
2 years ago
In the code below, what's the final value of the variable x?
Lana71 [14]

Answer:

First equation x=4

second equation x=3

Explanation:

The question is telling us that 'X' is equal to 8. It's another way of representing this number using X as the variable replacing it.

We input 8 instead of the X to solve the equation, and here in the picture, you can see where I went from there.

Do the same thing for the other equation.

I hope this helps :)

3 0
2 years ago
Other questions:
  • Paragraph talking about why i chose bill gates
    10·1 answer
  • SQL a. has become the de facto standard database language b. can be used to define database systems c. both a. and b. d. none of
    10·1 answer
  • A type of cpu socket, used with modern intel processors, where the cpu itself has no pins but the contact pads of the cpu line u
    8·2 answers
  • Please answer this I know that no one else does but I can't think right now
    10·1 answer
  • How does LinkedIn differ from other popular social media platforms? What are the similarities?
    6·1 answer
  • Jake was working on an essay for his English class on a stormy Sunday afternoon. Before he could save his document, a big strike
    8·1 answer
  • Define stubs for the functions called by the below main(). Each stub should print "FIXME: Finish FunctionName()" followed by a n
    7·1 answer
  • Introduction to Identity and Fitting In
    7·1 answer
  • Hi there! I am writing a code to make a square using a drone, however I’m having trouble doing so. The website that I’m writing
    8·1 answer
  • What is the function of ALU? <br>​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!