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
MaRussiya [10]
3 years ago
9

Use the arr field and mystery () method below.

Computers and Technology
1 answer:
kolezko [41]3 years ago
7 0

Answer:

The sum of all positive even values in arr

Explanation:

We have an array named arr holding int values

Inside the method mystery:

Two variables s1 and s2 are initialized as 0

A for loop is created iterating through the arr array. Inside the loop:

num is set to the ith position of the arr (num will hold the each value in arr)

Then, we have an if statement that checks if num is greater than 0 (if it is positive number) and if num mod 2 is equal to 0 (if it is an even number). If these conditions are satisfied, num will be added to the s1 (cumulative sum). If num is less than 0 (if it is a negative number), num will be added to the s2 (cumulative sum).

When the loop is done, the value of s1 and s2 is printed.

As you can see, s1 holds the sum of positive even values in the arr

You might be interested in
Which. Option tilts the image both horizantly and vertically be degrees
Anit [1.1K]
Aaaaaaaeeeeeeeeiiiiiioooooouuuuuu
3 0
3 years ago
If you’d like to have multiple italicized words in your document, how would you change the font of each of these words
Alex787 [66]

Answer:

Use styles and modify the font of the default style

Explanation:

4 0
2 years ago
Using social media and sending e-blasts are examples of?
Murrr4er [49]

The answer would be

A.) Digital Marketing

The reason why B. is not the answer is because workplace safety in being in an actual area with others working, while social media could be anywhere, even at home. C. sounds like a reasonable answer but it is not due to the e-blasts part of the question. D. Teamwork means you are working with others, but being online could also mean that you are working alone.

6 0
2 years ago
Define an __init__ method that has all the field names as parameters (in the order they appear in the second argument to pnamedt
mario62 [17]

<!DOCTYPE html PUBLIC "-//IETF//DTD HTML//EN">

<html><head>

<meta http-equiv="content-type" content="text/html; charset=UTF-8">

 <title>Program 3</title>

</head>

<body bgcolor="white">

<center>

<h1>Program 3</h1>

<h1>

Programs that Write Programs: pnamedtuple

</h1>

<p>

</p><h2>ICS-33: Intermediate Programming<br>

</h2>

<p>

</p></center>

<!-- Introduction -->

<a name="Introduction">

<hr align="left" width="33%">

<table rules="none" border="0" cellpadding="5" cellspacing="0" width="100%">

<tbody>

<tr valign="top">

<td width="20%"><b>Introduction</b></td>

<td width="80%">

This programming assignment is designed to show how Python functions can define

 other Python code (in this case, a class) in an unexpected way: the function

 can build a huge string that represents the definition of a Python class and

 then call <b>exec</b> on it, which causes Python to define that class just as

 if it were written in a file and imported (in which case Python reads the

 file as a big string and does the same thing).

Your code will heavily rely on string formatting operations: I suggest using

 the <b>str.format</b> method to do the replacements: now is a good time to

 learn about this function if you don't know already know it; but you are free

 to use whatever string processing tool(s) you want.

<p>

I suggest that you first read the description below and define/test/debug as

 much of the <b>Point</b> class as you can, writing it directly in Eclipse

(especially the<b>__getitem__</b>, <b>__eq__</b>, and <b>_replace__</b>

 methods).

You might want to write a small batch file to help you test this class.

</p><p>

Once you have written/debugged the code for the <b>Point</b> class, define the

 general <b>pnamedtuple</b> function, which when given the appropriate

 arguments (for the <b>Point</b> class: <b>pnamedtuple('Point', 'x y')</b>)

 constructs a huge string containing the same code as the <b>Point</b> class

 you wrote.

Much of the code from your <b>Point</b> class will be turned into strings and

 made generic: generalized for calls to <b>pnamedtuple</b> with different

 arguments.

Use the <b>.format</b> method to replace the generic parts with the actual

 strings needed for the class being defined.

5 0
2 years ago
Investigations involving the preservation, identification, extraction, documentation, and interpretation of computer media for e
Goryan [66]

Answer:

The correct answer to the following question will be "Digital Forensics".

Explanation:

  • Digital forensics is a field of forensics that involves the analysis and retrieval of materials found in electronic devices, sometimes related to cybercrime.
  • The objective of digital forensics methodologies would be to check, maintain and evaluate evidence on computing systems to find possible evidence for a trial. In the initial days of computing, an individual investigator could process files because the power consumption was so small.

Therefore, Digital Forensic is the right answer.

7 0
3 years ago
Other questions:
  • Helllllp: Virtual private networks require a secure remote connection.<br> True or False?
    10·2 answers
  • Which of these might be an example of an advertisers target group
    9·1 answer
  • You are given a data set with information from 1,000 high school students (of which the following is a part of the data) and ask
    6·1 answer
  • Which computer is the best for video cutting?
    11·2 answers
  • WILL DO A BRIANLY! Use an algorithm to help the Python Turtle get to the finish line in 10 steps by using only the 3 commands be
    12·1 answer
  • Describe some ways that you personally use information technologies differently than you did just a few years ago
    11·1 answer
  • What data unit is addressed based on the IP address of the recipient?
    8·1 answer
  • 1. What does MS-DOS use for input?
    5·1 answer
  • In science class, Patricia is giving a presentation on the different types of flowers in her community. As part of her presentat
    5·1 answer
  • Discussion Topic
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!