How to add up multiple user inputs for example: If i ask the user How many numbers do you want to add? they say 5 then i out put Enter 5 numbers: how can i get it to add up those 5 numbers that were input.In JAVA

Answers

Answer 1

Answer:

import java.util.Scanner;

class Main {

 public static void main(String[] args) {

   Scanner scanner = new Scanner(System.in);

   System.out.println("How many numbers do you want to add?");

   int numberOfNumbers = scanner.nextInt();

   int arrayNumbers[] = new int[numberOfNumbers];

   System.out.println("Enter " + numberOfNumbers + " numbers:\n");

   for(int i = 0; i < numberOfNumbers; i++){

     int addToArray = scanner.nextInt();

     arrayNumbers[i] = addToArray;

   }

   int sum = 0;

   for(int j = 0; j < arrayNumbers.length; j++){

     sum+=arrayNumbers[j];

   }

   System.out.println("Sum: " + sum);

 }

}

Explanation:


Related Questions

To add a Wrap Text command to your document in Word Online, what is the first step you need to take?

Group of answer choices

Select the Format tab.

Select the image on your document to trigger the Picture Tools Format tab.

Select the Insert tab.

Select the Wrap Text command, and choose how the text will wrap around an image.

Answers

Answer:

Select the Wrap Text command, and choose how the text will wrap around an image.

Explanation:

Does anyone know how to get past this part in Lego Harry Potter it’s the one right after Dobby in year 2? I’m so stuck!!!

Answers

thats a nice game. i dont know how to play it. how are you doing?

What is the difference between conceptual architecture view and module architecture view?

Answers

Answer:

The conceptual architecture view provides a high-level map of how the system performs what it's meant to do, and the module architecture view demonstrates how the software's major parts are translated to modules and subsystems.

Explanation:

What exactly is github?

Answers

GitHub is a code hosting platform for version control and collaboration.

It lets you and others work together on projects from anywhere.

Explanation:

Hope it helps you!!

How do I write this program?

def goingUp(n): # prints the stars from the row with 1 until a row with n

def goingDown(n): # prints the stars from the row with n to the row with 1

If the user enters a negative value, your program should print nothing.

If the user enters 0, your program should print nothing.

If the user enters 1, your program should print a single line with one star.

If the user enters any number greater than 1, your program should print according to the pattern shown above.

The prompt to the user must be Please enter a value

Answers

Answer:

Sorry but I don't know this

do you think film is a great media in exposing information?​

Answers

not really everything don’t need to be on the internet

Answer:I think film is a great media in exposing information

Explanation:Films are great for exposing information for many reasons. Films are long, which increases the chance the watcher will remember, also it makes the watcher more involved and more interactive

Data in the form of digits is called

Answers

Numeric data because it consist of numbers

why do we use case 1 and case 0 in nested switch statement before writing embedded switch statement

Answers

Explanation:

The fundamental difference between if-else and switch statements is that the if-else statement “selects the execution of the statements based upon the evaluation of the expression in if statements”. The switch statements “selects the execution of the statement often according to a keyboard command”.

Have a great day. <3

UCLA Extension's marketing department wants
to study the effectiveness of their email
campaign. The department surveyed 40
students randomly selected from a contact
database. The survey shows 26 of the 40
students surveyed enrolled in one course
because of reading the email. 8 of the 40
enrolled in three courses after reading the
email, and 6 of the 40 did not enroll even after reading the email.

The effectiveness of the email campaign is measured by course enrollment. Can you calculate the mean as a measure of central tendency
reading the email?

Answers

The measure of central tendency to determine the effectiveness can be the mean, median or mode

It is true that you can calculate the mean as a measure of central tendency for reading the email

How to determine the true statement?

The survey result is given as:

Sample size, n = 40Enrolled in one course = 26Enrolled in three courses = 8Not enrolled = 6

To determine if the email is effective or not, we simply carry out a test of significance.

However, if the central of tendency is to be used to determine the effectiveness; it is best to use the mean.

Hence, it is true that you can calculate the mean as a measure of central tendency for reading the email

Read more about measure of central tendency at:

https://brainly.com/question/17631693

In 1972, earlier designers built the
connecting major universities. The broke
communications into smaller chunks, or
and sent them in a first come, first serve
1
basis. The limit to the amount of bytes of data that can be moved is called line capacity, or
When a network is met its capacity the user experiences
When the
network is "slowing down", what is happening is users are waiting for their packet to leave the
To make the queues smaller, developers created
packets to move
L
1
1
data
:: ARPANET
:: bandwidth
:: packets
:: simultaneously
:: queue
:: mixed
:: unwanted pauses

Answers

The exercise is about filling in the gaps and is related to the History of the ARPANET.

What is the History of the ARPANET?

From the text:

In 1972, earlier designers built the ARPANET connecting major universities. They broke communication into smaller chunks, or packets and sent them on a first-come, first-serve basis. The limit to the number of bytes of data that can be moved is called line capacity, or bandwidth.

When a network is met its capacity the user experiences unwanted pauses. When the network is "slowing down", what is happening is users are waiting for their packet to leave the queue.

To make the queues smaller, developers created mixed packets to move simultaneously.

Learn more about the ARPANET at:
https://brainly.com/question/16433876

4. How would you reorder the animation on a slide using the Reorder
Animation tool?

Answers

Answer:

should be an undo button on the top bar

Explanation:

I hope this helps

I act as the provider of electricity in an electromagnet. What am I?" (2 words) D__ C____

Answers

Answer:

loudspeaker and a electric motor

Explanation:

you just needed the answer right?

Mr. Hicks is setting up a wiiſed office network for 10 computers. He needs to use a network topology
devices to be added later as required. Which topology should he use?
A. Star
B.tree
C.mesh
D.ring

Answers

Answer:

C. Mesh

Explanation:

Each device will be connected to the other 9 devices, making it the best topology to use.

Hope this helps!

Answer:

STAR

Explanation:

What app or divice has a filter that you can have blackvalk in real life

Answers

Answer:

look in app store explanation:

look in-app store

does anyone know what blue holler is if so, what are the new tracks?

Answers

Answer:

No

Explanation:

No I don't know about it sorry

Create a file using any word processing program or text editor. Write an application that displays the files, name, containing folder, size, and time of last modification. Save the file as FileStatisits.java

Answers

Answer:

below is a Shell I have ;

1.Import java.nio.file.*;

2.Import java.nio.file attribute.*;

3.Import java.10 Exception;

4.public class FileStatistics

5.{

6.public static void main(string []args)

7.{

8.path file=

9.

paths.get("C:\\Java\\chapter.13\\TestData.txt")

10.try

11.{

12.\\declare count and then display path, file, name and folder name.

13.

14.

15.

16.\\declare a BasicFileAttributes object, then add statements to display the file's size and creation time.

17.

18.}

19.

20.catch (10 Exception e)

21.{

22.\\add display 10 Exception

23.

24.}

25.}

Business Rules constraints falls into two categories:

Answers

Business-rules constraints fall into two categories: field constraints within tables, and. relationship constraints between tables.

Specification which has little effect on the speed of a processor is

Answers

Answer:

Specification which has little effect on the speed of a processor is cache system bus speed clock speed socket type. 

Specification which has little effect on the speed of a processor is cache system bus speed clock speed socket type.

What is Specification?

A specification is frequently used to refer to a list of requirements that must be met by a material, design, good, or service. A specification is frequently a form of technical standard.

There are various forms of technical or engineering specifications (specs), and the term is used in various technical contexts in various ways. They frequently make reference to specific papers or information included in them.

The general definition of the word specification is "to state explicitly or in detail" or "to be particular." A requirement specification is a set of requirements that must be met by a certain type of product, service, design, or other element.

Therefore, Specification which has little effect on the speed of a processor is cache system bus speed clock speed socket type.

To learn more about Specification, refer to the link:

https://brainly.com/question/27900839

#SPJ3

6.1.5: Function definition: Volume of a pyramid.


Define a function calc_pyramid_volume with parameters base_length, base_width, and pyramid_height, that returns the volume of a pyramid with a rectangular base.

Sample output with inputs: 4.5 2.1 3.0
Volume for 4.5, 2.1, 3.0 is: 9.45
Relevant geometry equations:
Volume = base area x height x 1/3
Base area = base length x base width.

Answers

Answer:

def calc_pyramid_volume(base_length, base_width, pyramid_height):

   return (base_length*base_width*pyramid_height*1/3)

The code given below is in Java as it calculates the volume of the pyramid by creating the function. The base length as well as the base width, and the pyramid height has been passed as the parameters to the function.

The function of calc_pyramid_volume with parameters base_length.

//Main.java

public class Main

{

public static void main(String[] args) {

//Initialize the variables

double base_length = 4.5;

double base_width = 2.1;

double pyramid_height = 3.0;

//Call the the function with the given parameters

System.out.printf("Volume for %.1f, %.1f, %.1f is: %.2f", base_length, base_width, pyramid_height

, pyramid_volume(base_length, base_width, pyramid_height));}

Therefore,

//function that takes length, width and height as parameters and returns the volume

public static double pyramid_volume(double base_length, double base_width, double pyramid_height) {

//calculate the base area by multiplying the base length and base width

double base_area = base_length * base_width;

Learn more about pyramid on:

https://brainly.com/question/13057463

#SPJ2

How can I get multiple user inputs in Java ? I want to be able to use it for subtraction, addition,division and multiplication.For example it should run like
How many numbers do you want to subtract?
4
Enter 4 numbers:
1
2
3
4
result:-8

Answers

You can do something like this :

Scanner sc = new Scanner(System.in);
int[] nums = new int[4];

for(int i = 0; i < nums.length; i++) {
System.out.println("Enter next number: ");
nums[i] = sc.nextInt();

List one unprofessional AND one professional example of internet/social media

Answers

Professional: Using social media to advertise a company you created

Unprofessional: Using social media to watch cat videos

The professional use of social media involves the use for job posting, while the unprofessional use involves watching videos.

What is social media?

A social media is given as the network that forms the connections of the individuals over the internet. It enables the user to connect irrespective of borders.

The use of social media has been professional and unprofessional both. The professional use of social media involves the use for job posting, while the unprofessional use involves watching videos.

Learn more about social media, here:

https://brainly.com/question/9564823

#SPJ5

When using [EmployeeID] as the unique identifier of the Employee table, [EmployeeID] is an example of which of the following?

a. Key attribute
b. Foreign key
c. Primary key
d. Composite key

Answers

Using [EmployeeID] as the unique identifier of the Employee table is an example of: c. Primary key.

What is a primary key?

In database management system (DBMS), a primary key can be defined as a field whose value uniquely identifies each record in a table or relational database.

This ultimately implies that, [EmployeeID] is an example of a primary key because it serves as the unique identifier of the Employee table.

In conclusion, a primary key is simply used as a unique identifier of each record in a table or relational database in database management system (DBMS).

Read more on primary key here: https://brainly.com/question/8131854

What is the purpose of linking text boxes?

Answers

The answer that the person answered is the same answer I was gonna answer so Yh it’s correct

What rules should we have about cell phone
the classroom/school?.

THIS IS AN 5 PARAGRAPH ESSAY HELP ME

Answers

Introduction: There are many rules schools should follow when it comes to cell phone use during school hours. Technology can be very distracting and durning school is when kids need to pay attention. Most people see cell phone rules un fair or bad, however it's not like that. The school just wants what's best for the students and so they can learn, which will ultimately help them on later in life.

Body paragraphs (wont write the rest of the paragraphs but heres some ideas) Only using the phone when needed like if it's an emergency, phones have to stay on silent to not disrupt others, during free period you can choose whether to be on your phone

then you write your conclusion based on what you wrote

Most of the Info you would need:

-If we don't allow cellphones many school issues would be solved.

-There is a mistake if they use cellphone, but its a great mistake if they misuse.

- Phones in classes just defeat the point of going to school- for learning.

- There are benefits, yes, but there is no doubt that the privilege will be abused.

-Cell phones are only good for distracting the students from the education that they are at school to obtain.

- we think it is one of the best ways to get distracted during class to use your cellphone.

-Cell phones create massive and on going classroom management issues for teachers.

-There is no need for allowing students to use mobile phones in schools. Ultimately they are not using mobiles for the calling purpose. Thus it is a perfect no from our side.

Please have a good day <3

When you run your Windows Form application, what is the lifespan of a global variable (also known as a "field" or "class" variable)?

Answers

The lifespan of a global variable (also known as a "field" or "class" variable) exist only until any additional classes are initialized.

What is Windows form application?

Windows Forms is defined as a form of UI backbone that is often uused for creating Windows desktop apps.

It is known to help its user in a lot of ways to produce or make  desktop apps using  the visual designer given in Visual Studio. It has a lot of Functionality such as drag-and-drop placement of visual controls and others.

See full question below

When you run your Windows Form application, what is the lifespanof a global variable (also known as a “field” or “class”variable)?

a. during the initial click button event

b. global variables only exist if they are constants

c. only until any additional classes are initialized

d.as long as the form is running

Learn more about Windows  from

https://brainly.com/question/26420125

Question 2:
(5 marks)
According to the following code; you are required to draw the flowchart in details with
clear sequences
message=input("enter yes if there is message in the inbox");
attached=input("\n enter yes if there is attachment");
inbox=eval (input ("enter number of email"));
while inbox > 0:
if message=="yes":
print ("extract the message");
if attached=="yes":
print("extract the message");
email=input("eneter v for valied or not");
if email=="V":
print ("extract attached ");
print("inject Job ");
print("inject Submission");
en email=="N":
print("Inject an error");
print ("Remove the inbox mail ");
inbox-inbox-1;
DIO:
print("stop")

Answers

Flowcharts are visual representations of a code or program segments

How to draw the flowchart?

To draw the flowchart, we make use of the following symbols and figures

Oval: To begin and end the flowchartParallelogram: To accept input for the message, attached, inbox & email variables Parallelogram: To display all outputsRectangle: To perform the arithmetic operation; inbox = inbox - 1Diamond: To make several decisions and to initiate a loop process

See attachment for the flowchart that represents the code

Read more about flowcharts at:

https://brainly.com/question/24735155

Dwayne Alexander is working on a project promoting a fictitious product for his marketing class. He wants to use animation to show the product being used, but the only animations he has created are in PowerPoint presentations. Research three animation apps for beginners: one 2-D animation app, one 3-D animation app, and one of your choice. List the pros and cons of each animation app. Be sure to consider cost, learning curve, and availability.

Answers

The following are examples of animation apps:

Toon Boom Animation (2-D)Prisma3D (3-D) and AnimeTok (3-D)

What are the Pros and the cons of each app listed above?

Toon Boom Animation Pros:

It has a great set of toolsIt has camera angles functionalityHas a vector drawing tool

Cons:

It is expensive.

Prisma3D (3-D) Pros:

It is good for modeling;Easy to use interface

Cons:

It has too many bugs.lacks sculpting tools

AnimeTok (3-D) Pros:

It makes it easy to move the characters easilyIt is easy to understand

Cons:

It has too many adsdoes not have an undo and redo button

Learn more about Animation Apps at:

https://brainly.com/question/7279789

i need answer for multiple choice . Someone help me.....pls.....everyone have online?

Answers

Answer:

I believe that your correct answer to that question is C. Logistics Information System. The Logistics subsystem deals with activities such as purchasing, receiving inventory control, and distribution. This concept sometimes requires certain components of the organization to operate sub-optimally in order to achieve the maximum goals of the system.

Explanation:

I got my information for this answer from www.examveda.com. If there are any further questions, please put them below in the comments, and I will try my best to help you out. If not, please have a great rest of your day/night. :)

Which function can be used to insert the current date into a spreadsheet?
DATE
TODAY
MM/DD/YYYY
DATE&TIME
Help please

Answers

Answer:

its MM/DD/YYYY

Explanation:

what is the instruction phase of the central processing unit​

Answers

Answer:

The instruction cycle (also known as the fetch–decode–execute cycle, or simply the fetch-execute cycle) is the cycle that the central processing unit (CPU) follows from boot-up until the computer has shut down in order to process instructions.

Other Questions
Both plant and animal cells as well as many unicellular organisms contain From left, a large candle A, a point C, a small candle B, a double convex lens D. A line passes below the base of the A and B, through C, and through the center of D. An eye looks left and up from below the line to the right of the lens. Dotted lines pass from the top of the large candle to the dotted center of the lens. Solid lines pass from the top of the small candle to the dotted centerline of the lens and then turn and pass down and right to the eye. Refer to the diagram to the left and use the drop-down menus to identify the parts of a magnifying glass. Label A: Label B: Label C: Thoughts on the diversity of roles for women on TV? Now, read a final article about the itas goal of creating fair trade. based on what you have learned, why does the ita believe that fair trade is important to us businesses and to the world? zinc sulfide with oxygen has (O2) to yield zinc oxide and sulfur oxide.(i need the formula) what is the measure of the space occupied by a solid. (Measured in cubic units) Why is an ecosystem with higher levels of biodiversity more stable than an ecosystem with lower levels of biodiversity?O because species are more adaptableO because they are better able to withstand stresses like disease or climate changebecause changes affect every species the same waybecause species are constantly replacing one another how the media influences people PLEASE HELP!!!With upward speeds of 12.5 m/s, the elevators in the Yokohama Landmark Tower in Yokohama, Japan, are among the fastest elevators in the world. Suppose a passenger with a mass of 70.0 kg enters one of these elevators. The elevator then goes up, reaching full speed in 4.00 s. Calculate the net force that is applied to the passenger during the elevator's acceleration. What prevents the blood in veins from flowing in the wrong direction?. Find the lateral area of a cone. Solve and I will mark brainliest. What is the volume of this cone? Use 3.14 for pi and round your answer to thenearest tenth.In your answer, give the volume of the cone rounded to the nearest tenth, and thenexplain how you calculated it. In making his appeal for wartime mobilization, Lincoln cast the conflict between the Union and the Confederacy as a battle for the triumph of ______. A lake is 85 feet across using scale 1 inch :4 feet how many inches 1. Five types of love exist in Romeo and Juliet: unrequited love, romantic love, parental love, friendship, and love of family honor. Identify the participants in each of these love relationships and explain how they are represented in the play. Does Shakespeare value any of these types-of love more important than the others? Which types of love do you find the most important andwhy? Support your response with evidence from personal experience, and/or quotes orexamnles from the text state first plane of sky PLEASE HELP ILL MARK BRAINLIEST + WORTH 45 POINTS!!Determine the area of the circle Use 3.14 for 16. Round to the nearest hundredth when necessary Why does Rex Tillerson believe the Monroe Doctrine is still important today? This is for American sign languageIf asked the question, "How do I get to the train station from here," you shouldA. begin with a pronoun such as "they," and then provide directionsB. first figure out where you are in relation to the things around youC. give directions first, and then end with "train station"D. raise your eyebrows when you sign "train station"