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

Answers

Answer 1

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:

https://brainly.com/question/18318709


Related Questions

One of the Windows workstations you manage has four user accounts defined on it. Two of the users are limited users while the third (your account) is an administrative user. The fourth account is the Guest user account, which has been enabled to allow management employees convenient workstation access. Each limited and administrative user has been assigned a strong password. File and folder permissions have been assigned to prevent users from accessing each other's files. Autorun has been disabled on the system.

Required:
What actions is MOST likely to increase the security of this system?

Answers

Answer:

All users on a Windows workstation are limited users except for one user who is responsible for maintaining the system.Explanation:

Which of these would be the best way to inform an employee that they are losing their job?
Group of answer choices

group email

face-to-face conversation

instant message

personal email

Answers

Answer:

Terminations are a sensitive subject.

Even if you have strong reasons for letting an employee go, sitting them down to explain they are out of a job can be an awkward conversation.  

Some employers might be tempted to fire an employee using an impersonal method ⁠— like a phone call, email, or text ⁠— just to avoid that discomfort. But that is a very bad idea. We strongly recommend that employers should only fire staff during a face-to-face termination meeting.

Michaela has been tracking the temperatures of the dirt, pond water, and air near her home for a science investigation. She is ready to analyze the data to prepare for her science report. Based on each application’s strengths and weaknesses, which one would be the best to choose for this task?

Answers

Answer:

The science of investigation

Explanation:

hope it help

which part lets you point to objects on your screen, click on them, and even move them?

Answers

Mouse lets you point to objects on your screen, click on them, and even move them.

A computer is a machine that can be programmed to carry out sequences of arithmetic or logical operations automatically. Modern computers can perform generic sets of operations known as programs.

A computer mouse is a handheld hardware input device that controls a cursor in a GUI (graphical user interface) for pointing, moving and selecting text, icons, files, and folders on your computer.

Find out more on mouse at: https://brainly.com/question/22247989

What does an arrow after a command indicate

Answers

Answer:

the command still has to be carried out.

The arrows are an interactive continuation prompt. If you enter an unfinished command, the SQL shell (invoked by the mysql command) is waiting for the rest of it.

How to recover permanently deleted photos from gallery?

Answers

Answer:

it's technically impossible to recover permanently deleted photos

but if you have a copy of the photo or maybe have backup that would help.

I'm sorry if my answer isn't much help

This program is an example of:

def factorial(x):

if x == 1:

return x

else:

return x * factorial(x-1)

Group of answer choices

a do while loop.

recursion.

a for loop.

a while loop.

Answers

The program is an example of recursion

In computer programming, recursion is a process in which a function calls itself.

In a recursive program, there is a

base case and a recursive case.

When the condition of recursion is met, the base case is returned, else, the recursive case is continued.

In the function given above,

the base case is 'return x' under the condition 'if x == 1'. The recursive case is 'return x * factorial(x - 1)'.

So, the function runs until the base case it met and then it stops.

So, the program is an example of recursion.

Learn more about recursion here:

https://brainly.com/question/25797503

Computers were originally developed to accomplish various tasks in relative isolation, very different from the collaboration and communication we see today.

A.
True

B.
False

Answers

The answer is A, they were built for work.

please answer ASAP!!!!!!

Answers

Answer:

the first constructor invocation will work.

pet temp("mouse", 5.99);

Explanation:

This will create a pet object on the stack, using the constructor.

If you want to create an object on the heap, you would use the new operator:

pet* pTemp = new pet("mouse", 5.99);

in reference to operating systems, what is spooling? what does it stand for? chegg

Answers

Answer:

Spooling is a process in which data is temporarily held to be used and executed by a device, program or the system. Data is sent to and stored in memory or other volatile storage until the program or computer requests it for execution. "Spool" is technically an acronym for simultaneous peripheral operations online.

relevez le rôle principal de la peau dans l,organime humain. je suis bloquée aidez moi metci​

Answers

Answer:

language?

Explanation:

where deep convolutional neural network is used in real life

Answers

Answer:

Business applications of Convolutional Neural Networks. Image Classification - Search Engines, Recommender Systems, Social Media. Face Recognition Applications of RNN is Social Media, Identification procedures, Surveillance. Legal, Banking, Insurance, Document digitization - Optical Character Recognition.

why is color important for all objects drawn ?​

Answers

Technically, drawing in colored pencil is simply layering semitransparent colors on paper to create vivid paintings. Every color has three qualities

what is a saved link to a particular web page?​

Answers

Answer:

A bookmark

Explanation:

A bookmark is a saved link to a particular Web page. Microsoft Internet Explorer denotes bookmarks as “favourites.” Boolean operators Most search engines (e.g. Go.ogle) allow you to limit your search or make it more specific by using words such as “and”, “or” and “not”.

Complete a flowchart and a Python program to calculate grade of a student based on marks using the following criteria:

Ask a student for their marks and if their marks are:

More than 90 – print “A*”

Between 80 and 90 – print “A”

Between 70 and 80 – print “B”

Between 60 and 70 – print “C”

Between 50 and 60 – print “D”

Between 40 and 50 – print “E”

Under 40 – print “Fail”

Answers

Answer:

grade = int(input("Enter grade: ")

if grade > 90:

   print("A*")

elif grade > 80 and grade < 90:

   print("A")

elif grade > 70 and grade < 80:

   print("B")

elif grade > 60 and grade < 70:

   print("C")

elif grade > 40 and grade < 50:

   print("E")

else:

   print("Fail")

Explanation:

Match each type of Save option on the left with a function on the right.

Answers

Answer:

the above is correct

Explanation:

goal of any user-friendly game should be to create a good what for the player?
A. user experience (UX)
B. user-interface (UI)
C. user intuition (UIT)
D. user skill (US)

Answers

Answer:

A

Explanation:

The goal of user friendly game is to provide UX.

For example a user friendly game will have much different interface than professional CAD program.

Answer:

user friendly.

Explanation:

Arrange the code so that the numbers are swapped.

Answers

Rand.int(your_num , your_num

Sampson runs his own online business, and much of his success depends on the reliability and accuracy of various online data. How does integrity help to ensure that Sampson can trust the online data he is using?

A.
Integrity takes steps to ensure Sampson's information cannot be altered or deleted by unauthorized people.

B.
Integrity refers to a process that makes it impossible for anyone but Sampson to see the data that he is using.

C.
Integrity blocks all hackers from interfering with Sampson's data and what he does with it.

D.
Integrity allows Sampson to access and move data on an unsecured network.

Answers

Answer: because integrity takes steps to ensure Sampson's information cannot be altered or deleted by unauthorized people and that it stays intact, no matter where it goes

Explanation:

many phone fraud scammers are expessily cunning because they approach the target to try to sell

Answers

Answer:

improved computer security programs

Explanation:

Answer:

Improved computer security programs.

Explanation:

Just took the quiz

In the program below, which two variables have the same scope?

def usernameMaker (strFirst, strLast):
return strFirst + strLast[0]

def passwordMaker (strA, numC):
answer = dogName[0:3]
return answer + str(numC)

# the main part of your program that calls the function
username = usernameMaker ('Chris', 'Smith')
dogName = 'Sammy'
favoriteNumber = 7
password = passwordMaker (dogName,favoriteNumber)

strA and

Answers

Answer: numC

Explanation:

strLast and strFirst have their scope up to the function usernameMaker only. They don't have any relation with the variable strA in terms of scope.

numC has the scope same as the variable strA. They both have scope in the function passwordMaker

Therefore, correct answer is numC

Answer: num C

Explanation: got it right on edgen

You've just received an email message that indicates a new serious malicious code threat is spreading across the internet. The message contains detailed information about the threat, its source code, and the damage it can inflict. The message states that you can easily detect whether or not you have already been a victim of this threat by the presence of three files in the \Windows\System32 folder. As a countermeasure, the message suggests that you delete these three files from your system to prevent the code from spreading further.

Required:
Based on the email message, what are the next BEST actions to complete?

Answers

Answer:

The next BEST actions to complete could either be to call 911 or just drive somewhere further from your computer and where you live because the threat might come to your place, or it might already be in your place.

Explanation:

What type of information is appropriate for headers and footers? Check all that apply.

Answers

Answer:

C,  E,F,G  are correct

Explanation:

Answer:

C,E,F,G  are correct.

Explanation:

Which of the following is Tynker an example of?
Group of answer choices

database

flowchart

Integrated Development Environment

binary code

Answers

Answer:\

Integrated Development Environment

hope it help

Answer:

C

Explanation:

i did the test

A bulb has a resistance of 15Ω and is rated at 3A. What is the maximum voltage that can be applied across the bulb?

Answers

Answer:Wheres the option choice??????????????????????

Explanation:

Write any two uses of ruler in word program

Answers

Answer:

1.It is used for draw the table, making results and assignments etc.

2.It is used for lining

Explanation:

Hope it helps

#CARRYONLEARNING

You arrive at school on Friday for a field trip ! What a lucky day!You need to figure out what room you are in before leaving. You notice there are rosters on each door . What do you do to find your correct room?
If the roster were sorted alphabetically by last name , would that change how you found your correct room ?

Answers

Answer:

Look for the first letter of your last name

Explanation:

what is the hack of the cookie clicker

Answers

Answer:

Open Sesame

New Pokemon Games - The Loop. Open Sesame is the control panel for Cookie Clicker. It can be opened with a console command, or by changing the name of your bakery.

Explanation:

Hope this helps you !!

Hacking is a process to exploit a computer network system or a private network within a computer. Simply put, unauthorised access to or control of a computer network security system for unauthorised purposes.

To better explain hacking, we must first understand hackers. It’s easy to a Hacking assume that they are intelligent and highly skilled with computers.

In fact, breaking security systems requires more intelligence and expertise than actually creating them. There are no hard and fast rules that can classify hackers into neat categories. However, in common computer terminology, these are called white hats, black hats, and gray hats. White hat experts audit their own security systems to make them more resistant to hacking.

Learn more about network system here:

brainly.com/question/23294592

#SPJ6

- What is the use of border? Differentiate between changing color of cells and color of data class 6​

Answers

Conditional formatting makes it easy to highlight interesting cells or ranges of cells, emphasize unusual values, and visualize data by using data bars, color scales, and icon sets that correspond to specific variations in the data.

A conditional format changes the appearance of cells on the basis of conditions that you specify. If the conditions are true, the cell range is formatted; if the conditions are false, the cell range is not formatted. There are many built-in conditions, and you can also create your own (including by using a formula that evaluates.

Software that is used to detect and eliminate computer viruses. Question 3 options: Wi-Fi Cable Internet Antivirus Application Browser

Answers

Answer:

Anti Virus

Explanation:

Antiviruses (Windows Defender, McAfee, Avast) scan your computer/device for viruses.

Other Questions
Suppose that 13 inches of a wire cost $.78 at the same rate how much in cents will 31 inches of wire cost HURRY!! SUPER SUPER QUICK!!i have 4,757 points!ILL GIVE CROWN, STARS, and HEARTS if you answer correctly!Problem:6.02 Quiz: One-Step Multiplication or Division InequalitiesOn k12PLEASE ANSWER THEM ALL! VERY LEAST IS ALL YOU KNOW BUT PLEASE DO ALL, AMD CORRECTLY FOR CROWN! Write an equation for the graph Interstate Manufacturing is considering either overhauling an old machine or replacing it with a new machine. Information about the two alternatives follows. Management requires a 10% rate of return on its investments. Alternative 1: Keep the old machine and have it overhauled. This requires an initial investment of $150,000 and results in $50,000 of net cash flows in each of the next five years. After five years, it can be sold for a $15,000 salvage value. Cost of old machine $111,000 Cost of overhaul 158,000 Annual expected revenues generated 106,000Annual cash operating costs after overhaul 43,000 Salvage value of old machine in 5 years 16,000Alternative 2: Sell the old machine for $29,000 and buy a new one. The new machine requires an initial investment of $300,000 and can be sold for a $20,000 salvage value in five years. It would yield cost savings and higher sales, resulting in net cash flows of $65,000 in each of the next five years. Cost of new machine $291,000 Salvage value of old machine now 34,000 Annual expected revenues generated 94,000 Annual cash operating costs 22,000 Salvage value of new machine in 5 years 15,000Required: 1. Determine the net present value of alternative 1. 2. Determine the net present value of alternative 2. 3. Which alternative should management select based on net present value? How much work is done when mass of 3kg(weighing 30N)is lifted vertically through 6m? Change the sentences into wh question1.rosy didn't spend much money2.my father doesn't eat meat3.they weren't coming to a party4.i haven't done my homework5.she has not been cooking can you guys pls help its Multiple Choice i given 25 pointsNO LINKS I WILL REPORT YOU is 4y=16x a Direct variation How did most Roman plebeians make a living?1. as slaves and servants2. as soldiers and generals3. as farmers and traders4. as senators and priests Jonah and Jesse are taking a trip. Jonah left at 7 a.m. and travel at an average of 40 miles per hour. Jesse left at 10 a.m. and travel at average of 50 mph. At what time are they at the same place at the same time? Write a system of equations to represent this situation. Then use the substitution method with that system to determine at what time they will be in the same location. How many miles away from will they be at that time?NO LINKS! Nadia bought 4. 3 pounds of ham on tuesday and 1. 7 pounds of ham on wednesday. She spent a total of $41. 94. What was the price of the ham per pound?. Suppose x and y are positive integers that satisfy the following equation: 7xy + 7y - 9x + 10 = 2019 Find the sum of x and y.A. 15B. 18C. 21D. 34E. No possible values what is the answer, A, B, D, or E? Please Let me know???? the product of seven non-zero factors. of which only three are positive. isa) positive B) negative c) null Approximately what portion of the circle is shaded blue? A grocery store sells steak for $6.10 per pound. What would be the cost of 2 3/5 lb. of steak? (c) It is suggested that one side of the copper sheet cools to a lower temperature than theother side.Explain why this does not happen.[2] what are the electrical signals generated by neurons called? Adam works for an agency.His normal hourly rate is 8.32The agency asks Adam to work 6 hours for a new company.Adam will be paid time and a third of his normal hourly rate.How much will Adam get paid in total when working for the new company a video game system was on sale for $350. if the discount was 10% off, how much money did they take off the price?