Create a function called makePositive that accepts a single argument: an integer array. The function should walk through the array and change any negative numbers to positive. You can assume that the array passed to the function will have a 0 at the end of the array. In other words, you do not know the size of the array; you instead know that a certain condition will be true at the end of the array.

Answers

Answer 1

Answer:

This solution is implemented in C++

void makePositive(int arr[]){

   int i =0;

   while(arr[i]!=0){

       if(arr[i]<0){

           arr[i] = abs(arr[i]);

       }

       i++;

   }

   i = 0;

   while(arr[i]!=0){

    cout<<arr[i]<<" ";

    i++;

}  

}

Explanation:

This defines the function makePositive

void makePositive(int arr[]){

This declares and initializes i to 0

   int i =0;

The following iteration is repeated until the last element in the array

   while(arr[i]!=0){

This checks if current array element is negative

       if(arr[i]<0){

If yes, it changes it to positive

           arr[i] = abs(arr[i]);

       }

The next element is then selected

       i++;

   }

This sets i to 0

   i = 0;

The following iteration prints the updated content of the array

   while(arr[i]!=0){

    cout<<arr[i]<<" ";

    i++;

}  

}

See attachment for full program which includes the main


Related Questions

the {blank} view is the working window of a presentation.
A. Outline
B. Handout
C. Notes
D. Slide

Answers

The view which serves as the working window of a presentation is: D. Slide.

The types of view.

On Microsoft PowerPoint, there are three (3) main types of views and these include the following:

Slide sorter viewSlide show viewSlide (Normal) view

What is slide view?

Slide view is also referred to as Normal view and it can be defined as the main working window of a presentation when using Microsoft PowerPoint.

Under the Slide view, the slides are displayed on a computer monitor in full screen. Thus, it is a view which serves as the working window of a presentation.

Read more on slides here: https://brainly.com/question/26187618

#SPJ2

d. slide

cuz i said so lol.

what are the use of computer at office?​

Answers

Answer:

playing games XD

Explanation:

hahahahahahahahhaha

Answer:

Some of the many uses of computers in office work are writing letters, sending emails, scheduling meetings and collaborating with co-workers and clients. This has extended to mobile devices, which professionals now use to read and respond to email, access business files, update social media and more.

Explanation:

Consider the following code segment which makes use of the list deck and the positive integer i: Which of the following could be displayed when this segment of code is executed, assuming that the block will sort the parameter list in alphabetical order from A to Z, and the user responds to each input? Steve Andrew Kevin Alex Joe Matt Sally Heather Barbie Tim Tim Tim

Answers

Answer: A) Steve Andrew Kevin

B) Alex Joe Matt C) Sally Heather Barbie D) Tim Tim Tim

Explanation:

In this exercise we have to use the knowledge of computational language in python to write the following code:

The code can be found in the attached image.

That way, to find it more easily we have the code like:

#Create a list of strings (names).

students = ['Steve" ,"Andrew ","Kevin", "Alex", "Joe ","Matt" , "Sally" ,"Heather ","Barbie" ,"Tim", "Tim", "Tim"]

student_name = "Lupe"

# Add student name to front of the list.

students.insert(0,student_name)

#Show me the new list.

print(students)

See more about python at brainly.com/question/26104476

Which of the following statements shows the relationship between cellular and wireless technology?
Brainliest to the right answer

Both use radio signals to communicate across distances.

Both were built using telephone infrastructure.

The two can be used together
to help people better communicate.

The two can be used together to drive down cost of service.

Answers

Answer:

The two can be used to help people better communicate.

Explanation:

Wireless technology doesn't use only radio signals, it uses Bluetooth, infrared, satellite signals and others.

They are both expensive.

Not that every wireless technology was built using telephone, like radio waves

A feedback loop is:
A. a hyperlink to another part of a story.
B. an endless cycle of creation and response.
C. the excitement people feel about networking.
D. the best method for creating a story.

Answers

Answer:

c

Explanation:

A feedback loop is the excitement people feel about networking

What is feedback loop?

A feedback loop can be used in learning process, where the output or results is used as again as data for another process.

Therefore, A feedback loop is the excitement people feel about networking

Lear more on feedback loop below

https://brainly.com/question/13809355

#SPJ9

Apply Decision Tree Algorithm on the following data:

Answers

Answer:

Sorry can you explain what the question ask

You are running your warehouse using Autonomous Data Warehouse (ADW) service and you noticed that a newly configured batch job is always running in serial even through nothing else is running in the database. All your jobs are configured to run with parallelism enabled.What could be the reason for this batch job to run in serial?A. The batch job depends on only one table and parallelism cannot be enabled on single-table queries.B. The parallelism of batch job depends on the number of ADW databases involved in the queryC. The new batch job is connected to LOW consumer group.D. The new batch job runs on database tables that are not enable for parallel execution.E. Parallelism on the database is controlled by the application, not the database.

Answers

Answer:

C. The new batch job is connected to the LOW consumer group.

Explanation:

Remember, one of the main characteristics of the LOW consumer group database service is that queries would run serially.

Since in this case, we are told that the newly configured batch job is always running in serial, it most likely would be because the new batch job is connected to the LOW consumer group; as queries are designed to always run serially.

Which of these is a good example of a user persona?

a
"Clippy, the Microsoft Word mascot"

b
"Teenage power-gamer who plays competitively 10+ hours a day"

c
"The U.S. government"

d
"Mom"

Answers

Answer:

The answer is "Option a".

Explanation:

The consumer is a sub-personality based on the real customer (or perfect). The people were created to improve marketing activities, through speaking to consumers and dividing up the different demographic and geographic data. In the creation of the user persona, it uses Clippy as the symbol for Microsoft Word.

Answer:

The answer is B

Explanation:

The following program is suppose to use the sin() function in the math library and write out an input's absolute value over an interval. So for example if sine(0.6) is 0.564 then its absolute value is the same (0.564). But if sine(2.4) is -0.675 then its absolute value is 0.675. #include #include /* has sin(), abs(), and fabs() */ int main(void) { double interval; int i; for(i = 0; i <30; i++) { interval = i/10.0; printf("sin( %lf ) = %lf \t", interval, abs(sin(interval))); } printf("\n+++++++\n"); return 0; }

Answers

Answer:

#include <stdio.h>

#include <math.h> /* has sin(), abs(), and fabs() */

int main(void) {

   double interval;

   int i;

   for(i = 0; i <30; i++) {

       interval = i/10.0;

       printf("sin( %.1lf ) = %.3lf \t", interval, abs(sin(interval)));

   }

   printf("\n+++++++\n");

   return 0;

}

Explanation:

The C source code defines a void main program that outputs the absolute value of the sine() function of numbers 0.1 to 3.0.

The program is an illustration of loops.

Loops are used to perform repetitive and iterative operations.

The program statements in C language that completes the program are as follows:

interval = i/10.0;

printf("sin( %.1lf ) = %.3lf \t", interval, abs(sin(interval)));

The flow of the above statements is as follows

The first line determines the intervalThe second line prints the required output

Read more about similar programs at:

https://brainly.com/question/14575844

in spoofing internet attack, the attackers computer assumes false internet address in order to gain access to a network (true or false

Answers

Answer:

True.

Explanation:

Cyber security can be defined as preventive practice of protecting computers, software programs, electronic devices, networks, servers and data from potential theft, attack, damage, or unauthorized access by using a body of technology, frameworks, processes and network engineers.

Some examples of cyber attacks are phishing, zero-day exploits, denial of service, man in the middle, cryptojacking, malware, SQL injection, spoofing etc.

Spoofing can be defined as a type of cyber attack which typically involves the deceptive creation of packets from an unknown or false source (IP address), as though it is from a known and trusted source. Thus, spoofing is mainly used for the impersonation of computer systems on a network.

Hence, in spoofing internet attack, the attacker's computer assumes false internet address in order to gain access to a network.

Once you start designing the processing logic for each function of your software, you might end up throwing out your logical data model design and completely redesigning it.

a
False

b
True

Answers

Answer:

B. True.

Explanation:

Software development life cycle (SDLC) can be defined as a strategic process or methodology that defines the key steps or stages for creating and implementing high quality software applications.

An incremental model refers to the process in which the requirements or criteria of the software development is divided into many standalone modules until the program is completed.

Hence, an incremental method typically involves developing a system through repeated cycles and smaller portions at a time, enhancing and evolving the system over time.

A database schema is a structure which is typically used to represent the logical design of the database and as such represents how data are stored or organized and the relationships existing in a database management system. There are two (2) main categories of a database schema; physical database schema and logical database schema.

Hence, once you start designing the processing logic for each function of your software, you might end up throwing out your logical data model design and completely redesigning it because each function would use a specific processing logic respectively.

which driver must be running and configured to enable a PC to communicate with a CompactLogix PLC on an Ethernet network

Answers

Answer:

EtherNet/Ip

Explanation:

This IP called the EtherNet/IP is an industrial communication network protocol which adapts the CIP fully known as Common Industrial Protocol to standard Ethernet. This is one of the leading industrial protocols in some areas of the world like the US. It is used in industries such as factory, hybrid.

The mode used by this driver is the

Explicitt Messaging of the EtherNet/IP protocol.

What TCP message will be generated for an incoming SYN request for which is there no matching LISTENING port

Answers

Answer:

"Connection Refused"

Explanation:

This is the error message that is returned when the server is not listening on the correct port, or the server is offline.

Cheers.

The TCP message that will be generated for an incoming SYN request for which is there no matching LISTENING port is; “Connection Refused”.

TCP stands for Transmission Control Protocol and in the given situation in the question, the first step of the client application is to send the first packet with “SYN” flag.

Now, when the above situation happens, the server will listen on the specified port and give a response of SYN-ACK packet so that it c an acknowledge the “SYN”packet requested by the client application which will generate a reply with ACK packet response that will make the established connection to end.

Finally, for an incoming SYN request for which is there no matching LISTENING port, the connection will be rejected with an “RST” flag that gives output an error message named “Connection Refused”.

Read more about TCP at; https://brainly.com/question/24967184

Define persuasion. What would you like to persuade your parents to do or think? Explain which of the three goals of persuasive speech you would need to accomplish to achieve this.

Answers

Answer:

Persuasive communication is a form of interpersonal communication that aims to influence the communication partner. The primary goal of persuasive communication is to achieve changes in attitudes, but not understanding or exchanging information. Thus, basically, persuasion seeks to convince the receiver of the message of the idea emitted by the sender of the same.

In my particular case, I would like to persuade my parents to let me drive my father's car, which because it is a new car and of a quality model is restricted to me. To do this, I should use the argumentative and probative method, showing his false mistrust of me and proving that I can drive the car without problems.

Answer:

Answers will vary. Persuasion: – The act of convincing or influencing someone to act or think in a particular way. Answers will vary regarding what students would like to persuade their parent to do or think. An action or some change to beliefs, attitudes, values should be discussed. One of the three goals should be listed.

Explanation:

edge21

For a parking application that lets you pay for parking via your phone, which of these is an example of a functional requirement that would be listed for parking officers?

a
add and store payment information

b
displaying hourly costs

c
transact remote payment for parking

d
register a fine

Answers

Answer:

b. displaying hourly costs

Explanation:

Displaying hourly costs would be very useful for parking staff because it would allow customers to understand how the charge for the service was made, without the need for an employee to have to explain it. In this way, work becomes less stressful and more optimized.

You’re having trouble connecting to the Internet so you call your Internet service provider for help. They need to know the permanent unique identifier of your networking device to help them troubleshoot. What are they asking for?

Answers

answer: from when it stopped working?

Write and test a program that accepts the user’s name (as text) and age (as a number) as input.

The program should output a sentence containing the user’s name and age.

Answers

name = input("Enter your name: ")

age = int(input("Enter your age: "))

print("Your name is",name,"and you are",age,"year(s) old.")

I wrote my code in python 3.8. I hope this helps.

Program description:

Defining header file.Defining the main method.In the next step,  the character array as "name" and an integer variable "age" is declared that uses the input method to the input value.After input value, a print method is declared that prints value with the message.

Program:

#include <stdio.h>//header file

int main()//defining main method

{

   char name[50];//defining character array as name

   int age;//defining integer variable

   printf("Enter name: ");//print message

   scanf("%s",name);//input name

   printf("Enter age: ");//print message

   scanf("%d",&age);//input age

   printf("Hi.. \%s",name); //print value with message

   printf(" your age is %d.",age);//print value with message

   return 0;

}

Output:

Please find the attached file.

Learn more:

brainly.com/question/13160158

Finish the code to search for a 7 in the array.
from array import *
myArr = array('f',[3, 5, 7.3, 10])
location = myArr.
(7)

Answers

Answer:

The complete code is as follows:

from array import *

myArr = array('f',[3, 5, 7,3, 10])

location = myArr.index(7)

print(str("7")+" is at position "+str(location+1))

Explanation:

I made corrections to the third line of the code and I added a line

This line gets the index of 7 from the array myArr using the index keyword

location = myArr.index(7)

This line prints the position of the 7 in the array

print(str("7")+" is at position "+str(location+1))

In this exercise, first run the code as it is given to see the intended output. Then trace through each of the 3 variables to see what is actually going on in memory. Show the values of str1, str2, and str3 and the output after each line of code on a piece of paper.

Answers

Answer:

The memory with variable names str1, str2, and str3 all have equal and the same value after the first if-statement.

Explanation:

The str1 was first assigned a null value while the str2 and str3 were assigned the string value "Karen" with the String class and directly respectively. On the first if-statement, the condition checks if the str1 is null and assigns the value of the variable str2 to str1, then the other conditional statement compares the values of all the string variables.

A data structure to store trees with an arbitrary number of children at each node is: public class TreeNode / Integer data, TreeNode firstChild; TreeNode nextSibling / Write a recursive Java method to return the leaf node with minimum value given the root of the tree. All elements are unique and if there are no leaf nodes you should return null. Your method signature should be: _______

Answers

Answer:

TreeNode minimum(TreeNode root) {

   if (root != null) {

       if (firstChild == null && nextSibling == null) {

           return root;

       } else {

           TreeNode begin = minimum(root.firstChild);

           TreeNode last = minimum(root.nextSibling);

           if (begin == false && (last == false || begin.data < last.data)) {

               return begin;

           } else {

               return last;

           }

   } else {

       return null;

   }

}

Explanation:

The Java program defines a recursive method called minimum that calls itself twice with the first and last leaf of the treenode as the respective arguments. and returns the minimum value of the treenode if the root argument is not undefined.

How do you distinguish between misrepresentation and embellishment of one’s professional accomplishments on a résumé? Provide an example of an embellishment that would not be considered misrepresentation.

Answers

How do you distinguish, well misrepresentation and embellishment of one professional accomplishments

type the correct answer in the box. Spell all words correctly. Which element of the presentation software can you use to add callouts and banners? using ____, you can add callouts and banners to a slide

Answers

Answer:

The element of the presentation software that can be used to add callous and banners is SHAPES

Using the INSERT TAB, you can add callouts and banners to a slide.

Explanation:

If you want to add callouts and banners to a slide, the presentation software that can be used is PowerPoint.

The element that is used to add it is called shapes and can be found in the Insert Tab.

Answer:

using shapes , you can add callouts and banners to a slide

Explanation:

+
Which of the following telecommunications careers requires the completion of a master's degree?

line installer

network risk analyst

computer administrator

network administrator

Answers

Answer:

Network administrator

Answer:

Network Risk Analyst

Explanation:

Edg2021

Its in the AV Tech Notes

before the 20th century how did most people experience computing​

Answers

Answer:

   

Explanation:

Write a program that reads an integer and determines and prints whether it is odd or even.

Answers

num = int(input("Enter a number: "))

print(str(num)+" is even" if num % 2 == 0 else str(num)+" is odd")

I wrote my code in python 3.8. Best of luck.

Assume that x and y are boolean variables and have been properly initialized.(x && y) || !(x && y) The result of evaluating the expression above is best described as (A) always true (B) always false (C) true only when x is true and y is true (D) true only when x and y have the same value (E) true only when x and y have different values

Answers

Answer:

(A) Always true

Explanation:

Given

Boolean variables x and y

Required

What is (x && y) || !(x && y)

Irrespective of what x or y is, the x && y is always true

Take for instance:

x = true;

y = true;

x&&y will also be true because the values of x and y were not altered

And this is true for whatever boolean value x or y assume

Having said that:

x&&y = true

So, the expression is analysed as follows:

(x && y) || !(x && y)

Substitute true for x&&y

(true) || !(true)

!(true) = false

So, the expression becomes:

true || false

|| represents the OR operator; and it returns true if at least one of the conditions is true.

By this:

true || false = true

Option (A) Always true answers the question.

helppp pleassseeeee thank youuuu​

Answers

Answer:

C

Explanation:

Because You don't need indented letters

What is computer virus?​

Answers

Answer:

A piece of code which is capable of copying itself and typically has a detrimental effect, such as corrupting the system or destroying data.

Explanation:

A computer virus is a type of computer program that, when executed, replicates itself by modifying other computer programs and inserting its own code. When this replication succeeds, the affected areas are then said to be "infected" with a computer virus.

Simply, a computer virus is a harmful multiplying code that harms your computer and makes it slower, harder to use, and more vulnerable to other harmful unsafe software, apps, downloads and more.

How to get it?

You can get computer viruses just from going to unsafe websites downloading harmful files downloading harmful images downloading harmful videos clicking unsafe advertisements

and thats just a couple of examples, there's many many more but you get the idea.

Something that really sucks about computer viruses is that its hard to tell if something online is dangerous or not.

That's why people make specific softwares to protect your computer but even those can be unsafe or people could be trying to trick you.

Sometimes the computer will already have some sort of app or software to protect it from these harmful files, but make sure to pay attention when your on websites and check the urls and make sure it doesn't say anything along the lines of "unsafe" if it says that just simply exit the website and dont do anything further.

If your experiencing slowness, files you don't remember saving on your computer or extra files and apps that dont seem to belong, im sure there are places you can call online or in your local area to help with these issues.

Hope this helped!!

When writing code, how can printing be useful?

Answers

Answer:

See Explanation

Explanation:

Printing while writing code can be useful in several ways.

One of which is to determine the progress of your code. Many a times when you write a code and some parts of your codes are not working as expected, you can use the print statement to track where the program stopped working properly.

Take for instance, you write a program of 50 lines of code and you suspect that the program stops working at line 30, you can use the print statement to track this program.

Please note that: the statement to be printed is not specific but you should make use of something unique that you can easily spot.

E.g

print("It worked up till this point")

Three PCs are on an Ethernet LAN, connected by a hub. Describe how the Ethernet protocol deals with collisions in this situation. How would the situation change if the hub were replaced by a switch?

Answers

Answer:

All the ports in a hub are in the same collision domain and a hub sends frames from one host to all other hosts in the network. This makes it prone to collision and poor network throughput. Just like a network switch, it uses the CSMA/CD protocol to detect collision in its network.

A network switch reduces its collision domain to just a port and sends frames from one host to another using its mac table as a route. This makes the network very efficient with high throughput. It also uses the CSMA/CD protocol to detect collision

Explanation:

Switches and hubs are used in networking to connect computer devices in a network. A hub is an obsolete device networking that broadcast a frame to all other ports or host in the network except for the send host port. This increases the rate of collision as all the ports in a hub share the same collision domain. A switch is an efficient frame switching device in a network, which uses its MAC table to decide and find a destination host.

CSMA/CD is a collision detection protocol used in a network to detect and prevent a collision. With this protocol, a host is able to listen, wait, send and resend frames to prevent a collision.

Other Questions
Which body of the federal government has the power to vote to approvetreaties with foreign countries?0A. The Department of StateB. The House of RepresentativesC. The Supreme CourtD. The SenateSUBAN Select two of the following roles performed by U.S. presidents:Chief executiveChief legislatorChief diplomatCommander in chiefBriefly summarize each role and explain specific powers the president can use when assuming this role. Pollen is one-celled, or unicellular. It is used for reproduction in many types of plants. The bee is collecting nectar and, while doing that is transferring the very tiny pollen grains. The bee and the flowering plant are multicellular organisms, but they both have many things in common with the unicellular pollen What is one feature NOT shared by all three? All are made of one or more cells. The cells of each contain genetic material. The cells of each contain exactly the same parts. Read this excerpt from "Rikki-Tikki-Tavi." When Rikki got to the house, Teddy and Teddy's mother (she still looked very white, for she had been fainting) and Teddy's father came out and almost cried over him; and that night he ate all that was given him till he could eat no more, and went to bed on Teddy's shoulder, where Teddy's mother saw him when she came to look late at night. "He saved our lives and Teddy's life, she said to her husband. "Just think, he saved all our lives! What role does Teddys mother play in the story? She provides emotional reactions that move the plot forward. She acts as a role model. She is an antagonist to the human protagonist. She provides a connection to Darzees wife. Using an adjective, explain the behaviour of the men from the novel "the last duty" Ericka observed the total variation in the water level over 6.2 years to be 13.64 mm. She compared this to the average annual trend, which shows the water level rising 1.8 mm/year. Remember, she used 6.2 years as her time period. What is the difference between how much average water levels rose and how much the water level fell in the part of the river she observed? millimeters im sorry for asking questions but i suck at math :/ Read the sentence below and select the appropriate punctuation. My name is Ryan a .b ?c ! what are the scientist doing incorrectly? what could they do to make their work in the lab safer? why is it important to follow these procedures? part E 1.6 as an improper fraction in simplest form. 2) How does matter change? That was a question students wereinvestigating in class. Each group had an experiment to carry out andthen determine if the changes observed indicated a physical orchemical change. Here is one groups experimental procedure andresults.BeforeMixAlerALS1000 mvinegar84Rowe1000 mlsolution34Rece84RP23cChangingTempeTemperTemperatureWhat type of change occurred? Cite any appropriate evidence.A)Chemical; the Alka-Seltzer tablet dissolved anddisappeared.B)Chemical; nothing new was formed.C)Chemical; a gas was produced and the temperaturechanged.D)Physical; the Alka-Seltzer tablet dissolved anddisappeared. How are minor parties different from major parties? WILL GIVE BRAINLIEST PLEASE HELP Mental processes refers toovert actions and reactions.only animal behavior.internal, covert processes.outward behavior. The United States and its allies supported:(Circle One) Mujahideen Communist or GovernmentThe Soviet Union and its allies supported:(Circle One) Mujahideen Communist or Government Andre listed some properties of electromagnetic waves.1) transfer thermal energy by radiation2) can transfer energy over great distances3) need matter to transfer energy through4) are disturbances that carry energyWhich best describes Andres error?Electromagnetic waves transfer thermal energy by conduction. Electromagnetic waves can only transfer energy over short distances. Electromagnetic waves can transfer energy through empty space. Electromagnetic waves are not considered disturbances. How does Macbeth become king scotland? Citizens in most countries have which civic duty?A. Applying for naturalized citizenshipB. Getting married to another citizenO C. Attending school at certain agesD. Serving in the country's government Cassidy's diving platform is 6 ft above the water. One of her dives canbe modelled by the equation d = x2 - 7x + 6, where d is her positionrelative to the surface of the water and x is her horizontal distance fromthe platform. Both distances are measured in feet. How deep did Cassidygo before coming back up to the surface? andWhy the computer is called dilligentVersatile machine?give long answer Steam Workshop Downloader