We have written a method called sum with an int[] parameter nums. We want our sum method to compute the sum of nums, but our code has a bug (or perhaps bugs?) in it.

Fix the bugs.

We Have Written A Method Called Sum With An Int[] Parameter Nums. We Want Our Sum Method To Compute The

Answers

Answer 1

Answer:

Following are the code to this question:

public class Main//defining a class-main  

{

public static int sum(int[] nums)//defining a method sum that accepts array  

{

int total = 0;//defining integer variable total

for(int num : nums) // use for-each loop

{  

total += num;//add array value in total variable

}

return total;//use return keyword to return the total value

}

public static void main(String []ar )//defining a main method  

{

int[] nums={1,2,3,4,5};//defining 1-D array nums

System.out.println(sum(nums));//use print function to call sum method  

}

}

Output:

15

Explanation:

In the class "Main", a static method, "sum" is defined, that accepts array in its parameter and inside the method, an integer variable "total" is define, that uses the for each loop to add array value in a total variable and use a return keyword to return its value.  

Inside the main method, an integer array nums are defined, that holds store some values and use the print function to call the sum method.


Related Questions

Which of these graphic elements combine text, illustrations, and color? Word Art Smart Art Clip Art none of the above

Answers

Answer:

I believe it's Word Art

Explanation:

What is the purpose of the Chart feature in Word?
O A chart can be used to draw and format a Word table.
O A chart can be used to paste information from a graph.
O Information can be typed into a chart to create a graph.
O Information can be typed into a chart to insert a Word table.

Answers

Answer:

Its the third option.

Explanation:

Answer: its c Information can be typed into a chart to create a graph

Explanation:

what makes the young love tec

Answers

On their computers or mobiles. There essential communication and ind info tools.

Answer:

because it distracts them from realitiy plus its entertaining

Explanation:

When people need information, they typically turn to:
A. WiFi
B. Consumers
C. Media
D. Shopping
(Will give brainlist!!!!!)

Answers

Answer:

c -media

Explanation:

Answer:

The answer is C. Media

Explanation:

Which is a characteristic of an effective problem statement? It is based on research. It contains outside information. It contains technical language. It is reviewed by competitors.

Answers

Answer:

It is based on research

Explanation:

An effective problem statement is a term often used in research operation to describe a statement that practically deals with the current issue that needs to be solved, situations or circumstances that require enhancement, or a drawback that must be solved, which demands critical insight and conscious analysis.

There are various characteristics of Effective problem statement, some of which are:

1. It should focus on the need for solving the problem

2. The ways in which the problem will be solved should be stated in a precise and concise manner

3. It should be based on the main objective of the statement.

Hence, in this case, the correct answer is "It is based on research."

Answer:

A

Explanation:

Correct on Edge 2021:)

Your welcome

Pleaseee answer number 9 I’m having trouble ❤️

Answers

Answer:

I think it is C but sorry if it wrong

Answer: A

Explination:

Which is true regarding diagramming? It involves writing an algorithm. It presents the programming code. It shows the flow of information and processes to solve the problem. It models solutions for large problems only.

Answers

Answer:

It shows the flow of information and processes to solve the problem.

Explanation:

Answer:

C

Explanation:

Got it right on Edge 2021:)

Your welcome

in a print staement what happens if you leave out one of the parentheses, or both

if you are trying to print a string what happens if you leave out one of the quotation marks or both

Answers

Answer:

The answer is that it will most likely error out.

Explanation:

The reason it will error out is that if you leave either 1 or more of the parentheses or quotation marks, it will be an improper statement which the compiler will not understand.

What is one thing the ADDIE model does NOT account for?
O An investigation of the problem and audience
O The need for end users to receive training in the use of the product
O The existence of various types of media that could be used to deliver the content
O New discoveries and needs that come up in the process of the design step

Answers

Answer:

O An investigation of the problem and audience

Explanation:

ADDIE stands for Analysis, Design, Development, Implementation, and Evaluation which is defined as an instructional systems design framework that helps to develop training courses.

The main idea behind the development of ADDIE was to provide a good learning experience through structured training methods. But there was a limitation of ADDIE that is, it is not able to recognise or investigate the problems and unable to solve the issues.

Hence, the correct option is "An investigation of the problem and audience".

Answer:

It should be the last option

Explanation:

You have been using an app on your mobile device for a 30-day trial period. Now that the 30 days have expired, the app is requesting that you to pay to continue accessing your data. What are your next steps? What steps could you have taken to preserve your data before the trial period expired?

Answers

Answer: Is there anyone choices A,B,C or D?

IF theres not. the answer is you could have canceled your trial early. Screenshots

not much i can help without choices

How to sync songs from desktop to mobile device spotify.

Answers

Answer:

The answer is below

Explanation:

In order to sync songs from desktop to mobile device Spotify. This following must be followed:

1. From the Spotify PC app, add Local Files in toe synchronized ed to a phone list.

2. Ensure to log into Spotify on mobile phone on the same WiFi network as PC.

3. Click on the menu button

4. Click on Music.

5. Click on Playlists and access folder with local music files

6. Click on the Available Offline switch at the top.

7. A green arrow is shown to depict successful synchronization.

10) What are some advantages of being able to see an image right after
you've taken it (such as with an instant camera or being able to reven the
image on a digital camera)?

Answers

If you get to see the image right after you take it you can tell if it’s worth it to take more photos or decide if you’re happy with the photo you just took.

allows you to add several types of formatting at once

layout

theme

design

style

Answers

Answer:

Layout

Explanation:

The one that allows you to add several types of formatting at once is layout. The correct option is A.

What is layout?

Layout is the process of calculating the position of objects in space under various constraints in computing. This functionality can be packaged as a reusable component or library as part of an application.

Page layout is the arrangement of visual elements on a page in graphic design. It generally involves organizational composition principles in order to achieve specific communication goals.

The primary function of layout is to assemble and arrange the various parts or elements of an advertisement - illustrations, headings, sub-headlines, slogans, body text and the identification mark, and so on - into a unified presentation of the any message.

Layout is the one that allows you to add multiple types of formatting at once.

Thus, the correct option is A.

For more details regarding layout, visit:

https://brainly.com/question/1327497

#SPJ5

Does software fall under Fair Use Guidelines?
Yes or No

Answers

Answer: Yes they do use

What is it called when you want to see database records in a certain order?

Answers

It’ll be a data sheet view

what is Doppler shift

Answers

Answer:

When a body that is emitting radiation has a non-zero radial velocity relative to an observer, the wavelength of the emission will be shortened or lengthened, depending upon whether the body is moving towards or away from an observer. This change in observed wavelength, or frequency, is known as the Doppler shift.

Should the use of hacktivists by a country against enemy organizations be considered an act of war? Why or why not? How about the use of cyberterrorists?

Answers

Explanation:

Hacktivist comes from the combination of two words --- "Hack" and " Activism" .

Hacktivist perform hacktivism that means they make use of technology and knowledge to support as well as promote the political agenda and any kind of change in the social event.

Cyberterrorism, on the other hand uses internet and technology and conduct terrorism and other anti national activities like to coerce the societies or the governments in pursuit of their goals which are  religious, ideological or political.

While Hacktivism is used for a political cause, and is done in a peaceful manner; whereas cyber terrorism tries to grab the attention of the public through their aggressive ways, specifically by putting fear among the public.

But there is no instance of any person of getting killed by a cyber-attack or cyber terrorism. The larger damage is however done by those viruses or malware which gets into other persons computers or enemy organization computer system and weakens them and steals information and data. They damage and harm the economy in a larger scale.

When Chinese government first introduced the Trojan virus on the computer systems of their opponents abroad, is that can be called as Hacktivism? In  essence, this act may be called as cyber terrorism and not hacktivism. Because the Chinese Government intend to cause major economic damage and harm to their opponents or enemy organization by targeting the software giants in the West.

These companies crashed and and many left jobless and unemployment, they caused economic problems and damage to the technologies.  However, the Chinese Government's perspective on this is that they addresses such a thing as hacktivism as it advocates the state censorship by filtering the politically or the socially-unacceptable ideas in their e-mail.

Thus, the answer is relative as to whose perspective we are looking. Either we are taking the perspective of the Chinese government or that of the enemy organization which is affected by the act of the state censorship and targeting the Western software giants.

Cyberterrorism will somehow become a serious threat to the society when people adept at hacking will sympathize and also align with terrorists activities and cause. It has become appealing since some of computer programs have the features that are easily exploited and conducive for committing cyber terrorism.

Which of the following is a tool HR managers can use to improve commincations between workers of different generations in the same workplace? A)recruitment pools B)l-9 forms C) mentoring programs D)work/life balance

Answers

Answer:

Mentor Programs

Explanation:

This is because it is talking about different ages which is a mentor type thing

Answer: mentoring programs

Explanation:

A p e x

IP is an unreliable, connectionless protocol, as it does not establish a session to send its packets.
A.True
B. False

Answers

Answer:

a. true

Explanation:

IP is a unreliable protocol because it does not guarantee the delivery of a datagram to its destination. The reliability must be provided by the upper layer protocols like TCP. IP does not support flow control, retransmission, acknowledgement and error recovery.

Write the name of the tab, the command group, and the icon that you need to use to justify
text in a Word document.
Tab:
Command group:
Icon:

Answers

Answer:

Tab: Home Tab

Command Group: Paragraph

Icon: Justify Icon

The icon has no name; rather it is represented by 4 horizontal lines that are aligned on both edges

Explanation:

To answer this question, I'll make use of the following attachment

Where

1- represents the home tab

2 - represents the paragraph

3 - represents the justify icon

Answer:

Tab: Home Tab

Command Group: Paragraph

Icon: Justify Icon

Explanation:

the font size sets the size of text​

Answers

Answer:

Yup thats correct

Explanation:

Question 1 (1 point)
Which word means "many different kinds?"
a
b
variety
vertigo
extraordinary
с
d
vast

Answers

Answer:

Variety is many different kinds.

Variety is the answer. It means different kinds

Write a memo to the vice president, outlining the steps an employee might have taken to create an e-mail message and make it appear to come from another employee's account. Be sure to include some SMTP commands the culprit might have used.

Answers

Answer:

Following are the memo to the vice president:

Explanation:

In this question, the president claims, that he got a threatening e-mail from the Maui worker. HR acknowledged that all of the workers should always be dismissed, in its protection, that worker claims that he did not send the message but he does not recognize why the message implies him return address. Here is a note for the vice president, who explains how an employee could have produced an email and made it look to be from another worker's account. That stuff we want will be progressively explained as follows:

a) The manipulating and e-mail used only by spammers and attackers were called this technique. In the SMTP server, it sends messages, that you can set up to send your spammer to the email addresses. Instead of a mail confirmation, I d the forger requires the receiver to see the next employee I d email. that recipient doesn't understand who sent the message.

b) The e-mail Systems information allowing for accessible transfer is used by the intruder or forger. It  must use an attacker order to verify communication with the SMTP server command:  

telnet smpt.server.name 25    

Its name of the SMTP server is smpt.domain.name, and the port is 25.

c) when the last stage is successful as well as a link created, this order to imitate an email account only with command can be entered:

MAIL from: Email-id

It creates a problem for the worker that sends the e-mail with the same id

d) Hacker sets the email of the receiver to:  

RCPT to: boss email-id  

It sets the beneficiary as the e-mail above.  

e) By entering an order, you can create the email data:  

DATA It may also adjust the date by using command and Any date we would like to use.  

Date: (date you would like)  

We should settle on the following:  

Subject: (your topic)

f) We press Insert after the topic is written. In this body can then be e-mail forms. It produces the text.  

g) its email forged is forwarded.

HELPPPP
Question #4
Multiple Choice
Which part of a network controls the flow of information among computers within a network?
•switch
•client
•server
•router

Answers

Answer:

Switch

Explanation:

A network switch (also called switching hub, bridging hub, officially MAC bridge) is a computer networking device that connects devices together on a computer network by using packet switching to receive, process, and forward data to the destination device.

The part of a network that controls the flow of information among computers within a network is router. The correct option is D.

What is router?

A router is a physical or virtual gadget that links two or more packet-switched computer networks.

A router examines a data packet's destination Internet Protocol address (IP address), calculates the best path for it to take, and then forwards it.

On computer networks, a router receives and sends data. Routers are frequently mixed up with network hubs, modems, and network switches.

Routers, on the other hand, can combine the functions of these components and connect with these devices to improve Internet access or assist in the creation of business networks.

A router, similar to a switch, routes data packets based on their IP addresses.

Thus, the correct option is D.

For more details regarding router, visit:

https://brainly.com/question/15851772

#SPJ5

What is the act of working with someone to produce or create something?

A. Collaboration
B. Decision-making
C. Non-verbal communication
D. Problem solving

Answers

Answer:

A

Explanation:

Answer: A

Explanation:

What type of data uses numbers that can be used in the arithmetic operations?

Answers

Answer:

Numerical data uses numbers that can be used in arithmetic operations.

My study background is business. I am doing a bachelor of business administration. My major course is management information of the system. But I want to do data science. I know the journey is typically hard for me. In future , it will be demandable if I do data science in master's . Have I made a good decision?

Answers

Answer:

Yes,I think your going on right path! Keep up the hard work ! You got this!

Which are types of online resources that students can use for help? Check all that apply. simulated labs web-based educational games educators classmates discussion forums

Answers

Answer:

Simulated Labs

Web-Based Educational Games

Discussion Forums

Explanation:

Did a test with the same question.

Online resources that students can use for help are simulated labs, web-based educational games, and discussion forums.

What are online sources in education?

Online sources in education refer to any resource available on the Internet in an internet instructional environment.

It is probably HTML files including course or chapter objectives, lecture notes, assignments, and many more. These are probably audio or video lessons, interactive exercises or exams, or files that provide hyperlinks to different websites.

Hence, Online resources that students can use for help are simulated labs, web-based educational games, and discussion forums.

Learn more about online sources in education here:

https://brainly.com/question/14591988

#SPJ2

What statement best describes operating systems?

Answers

Answer:

An operating system, or "OS," is software that communicates with the hardware and allows other programs to run

Answer:

c

thats what i put

what tool should you use to look for information on a network?
A. A social network
B. A magnifying glass
C. A search engine
D. A consumer report

Answers

The answer is C. a search engine
Other Questions
Question 3 of 10Which of the following elements shows little reactivity?A. Potassium (K)B. Sulfur (S)C. Fluorine (F)O D. Argon (Ar) Using the order of operations, what should be done first to evaluate 6 + StartFraction (negative 5 minus 7) over 2 EndFraction minus 8 (3)? Subtract 7 from 5. Multiply 8 and 3. Divide 7 by 2. Add 6 and 5. can yall pls hurry i need this right now What is most important in Elie's life at the beginning of Night? Book: Night by Elie Wiesel What is the simplified answer? Click on the best question to ask before reading the rest of the passage. Vector: colorful checkered circle frame background When did people start making kaleidoscopes? How do kaleidoscopes work? Are kaleidoscopes still popular? Who invented kaleidoscopes? Oxidation state of N in n2(g) Which chracteristic is used for cell-cell conmunication i need to know the answer as soon as possible. Just about adding or subtracting same signs, dont understand what exactly those 2 words are supposed to be... Josiah bought 22 chicken wings for $26.40. How much would it cost for 9 wings? A used car is for sale for $8,950. If Jenny will pay for the car over a 5 year period, what will be her monthly payment, to the nearest dollar? 3,729/month1,790/month149/month60/month Which word in this sentence is a transition? take park because program Explain the formation of sedimentary rocks?Plz help me The pizza dough recipe recipe shown makes one batch of dough charlie wants to make a half batch she has 1 cup of flour how much more flour does she need Which of the following statements concerning a valid study is correct?A. A valid study allows the researcher to draw accurate conclusions.B. A valid study does not have to be reliable. C. A valid study is inadequate in predicting a specific outcome. D. A valid study utilizes a poorly designed measure. what do you think the difference between simple and complex carbohydrates is? 1) Name the three major divisions of the Himalayas from north to south.2) Which plateau lies between the Aravali and the vindhya ranges3) Name the island group of India having coral origin4) Distinguish between a) Bhangar and Khadarb) Western ghats and eastern ghats5) Write the short note on the following a) the Indian desert b) the central highlands c) the island group of IndiaPLEASE ANSWER THIS IN 5 MINUTES... What is 3.142 rounded to the nearest hundredth? Evaluate the expression 3x - 8 when x = 2Someone help me There are nine water bottles in devins refrigerator.