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

Answer 1
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();

Related Questions

You have been asked to write a program for the Duckie's Obstacle Race. The program calculates the total number of racers, the fastest race time, the slowest race time, and the overall average race time.

Ask user to enter the maximum number of racers allowed for the race
Use repetition structure (loop) to ask the user to enter race times (in minutes)
Exit the loop if the user specifies there are no more times to enter (sentinel value) or if the maximum number of racers allowed has been reached
At a minimum, within the loop, you should keep track of how many race times are entered, the fastest race time and the slowest race time.
After the loop is exited, display how many race times were entered, the fastest race time, the slowest race time and the overall average race time.
Format your output appropriately
Be sure to include all appropriate documentation at the start of the program and within the program body

Answers

The program illustrates the use of loops and conditional statements

Conditional statements are used to make decisionsLoops are used for operations that must be repeated until a certain condition is met.

The race program

The program written in Python, where comments are used to explain each action is as follows:

#This initializes the variables to 0

totalRaceTime = 0; minRaceTime = 0; maxRaceTime = 0; countTimes = 0

#This gets input for the number of race times

numTimes = int(input("Number of times: "))

#This opens a sentinel controlled loop

while countTimes < numTimes:

   #This gets the race time

   raceTime = int(input("Race time: "))

   if countTimes == 0:

       minRaceTime = raceTime

       maxRaceTime = raceTime

   #This determines the highest race time

   if raceTime > maxRaceTime:

       maxRaceTime = raceTime

   #This determines the leest race time

   if raceTime < minRaceTime:

       minRaceTime = raceTime

   #This determines the total race time

   totalRaceTime+=raceTime

   countTimes+=1

#This prints the highest race time

print("Maximum: ",maxRaceTime)

#This prints the least race time

print("Minimum: ",minRaceTime)

#This prints the average race time

print("Average: ",round(totalRaceTime/numTimes,2))

Read more about while loops and conditional statements at:

https://brainly.com/question/24833629

How many bit positions to borrow from the host address field to subnet the network address 169.67.0.0 exactly into 5 subnets

Answers

Answer:

send me the opportunity to work with you and your family and friends and family are doing well and that you are not the intended recipient you are not the intended recipient you are not the intended recipient you are not the intended recipient you are not the intended recipient you are not the intended recipient you are not the intended recipient you are not the intended recipient you are not the intended recipient you are not the intended recipient

RAM is like a computer’s ______________, while a hard drive is like a computer’s ______________

Answers

Explanation:

RAM is what the computer and the applications run on and hard drive is the type of memory all your files and apps are located on

2. Choose four organizations in a particular industry and compare their strategies and analyze how the information system could be used for each organization to gain competitive advantage. 9.1 The first organization should follow the competitive strategy of lower cost across the industry,

Answers

The four organizations in a particular industry (Food industry) are:

Cargill Archer Daniels Midland (ADM) Company Nestle Sysco Corporation

What is Low-cost strategy?

The food industry is one that has been dominated by a lot of big companies. It is competitive in nature and it is advisable to have a Low-cost strategy.

This Low-cost strategy is one that helps the firm to sell its product or its service using a lower price when compared to its competitors as this will help them to have or win a competitive edge in the industry.

Learn more about Food industry from

https://brainly.com/question/11900425

how has education technology evolved in schools over the past years​

Answers

More sophisticated software given to students

Why do you want to work for Rev?

Answers

People do have reasons why they want to work for a particular company. It may be due to what they company stands for, what they make or about your dream.

I can therefore say that I want to work for Rev because they are revolutionizing the industry and I want to be part of the change process.

How do you answer why do you want to work?

Note that when looking for a job, job experience do matter. When ask the reason for looking for this job.

One can answer that they have the experience or the needed expertise and skills required for this job as they want to be aligned with what the company stands for.

Learn more about work  from

https://brainly.com/question/25573309

s to write a Python-program that uses training data to choose the four ideal functions which are the
best fit out of the fifty provided (C) *.
i) Afterwards, the program must use the test data provided (B) to determine for each and every x-ypair of values whether or not they can be assigned to the four chosen ideal functions**; if so, the
program also needs to execute the mapping and save it together with the deviation at hand
ii) All data must be visualized logically
iii) Where possible, create/ compile suitable unit-test
* The criterion for choosing the ideal functions for the training function is how they minimize the sum of all ydeviations squared (Least-Square)
** The criterion for mapping the individual test case to the four ideal functions is that the existing maximum
deviation of the calculated regression does not exceed the largest deviation between training dataset (A) and
the ideal function (C) chosen for it by more than factor sqrt(2

Answers

Use the knowledge in computational language in python is possible write the data about a function and the summation.

How to define function in Python?

In Python, a function is a sequence of commands that performs some task and that has a name. Its main purpose is to help us organize programs into chunks that correspond to how we envision a solution to the problem.

So in an easier way we have that the code is:

def plus(a,b):

 return a + b  

class Summation(object):

 def sum(self, a, b):

   self.contents = a + b

   return self.contents

sumInstance = Summation()

sumInstance.sum(1,2)  

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

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

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!!

help meeeeeeeeeeeeeeeee

Answers

Answer:

The advantages include much access to photos, digital functions like games and contacts with friends, videos, and you can search questions to anything you like. Disadvantages include things like too much screen time affecting sleep, health, and other physical problems. There is also exposure to explicit content and hatred from strangers.

There are hundreds of editing software for you to try, and many are free to use and are even compatible offline. They can make content related to or look like something in a movie or can be used to make things look nicer and cooler.

what is the answer to 7.4.4: Length of User's Name codehs

Answers

The program that ask the user to type there first name and then print out how many letters that is in there name is as follows:

x = input("what is your first name: ")

y = len(x)

print(f"There are {y} letters in your name")

Code explanation;

The code is written in python.

Firstly, we store the users name in the variable x.Then, we find the length of the users inputted name and store it in a variable y.Finally, we print the length of the users name using the print function.

learn more on python here: https://brainly.com/question/26738945

Which statement best characterizes under what circumstances you should add your social media profile to a resume? You should add your profile even if it is not entirely professional. You should add your profile even if it is not entirely professional. You should add your profile, but it should be entertaining and help you stand out. You should add your profile, but it should be entertaining and help you stand out. You should not add your profile under any circumstances—it is unprofessional. You should not add your profile under any circumstances—it is unprofessional. You should add your profile, but it should be professional and positive.

Answers

Answer:

You should add your profile, but it should be professional and positive.

Explanation:

this is the most reasonable response... resumes are for careers and professions.. so you must be professional and positive (if it is for example linkedin)

Write the pseudocode for the following scenario. The final exam marks for 10 students are 65, 45, 78, 65, 89, 65, 79, 67, 75, and 63. The marks are stored in an array. Find: • The student with the highest mark. • The student with the lowest mark. • The total marks for all the students. • The overall average.

Answers

The pseudocode of the program serves as a prototype of the program

How to determine the pseudocode?

The pseudocode of the program is as follows:

StartDeclare array MARKSInput MARKS[0] to MARKS[9]Sort MARKSPrint MARKS[9] ----- this prints the highest markPrint MARKS[0] ----- this prints the least markFOR I = 0 TO 9; ADD MARK[I] TO TOTALPrint TOTALPrint TOTAL/10Stop

The above pseudocode gets input for the array; then sorts the array before performing the required operations

Read more about pseudocodes at:

https://brainly.com/question/24735155

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:

Which string method returns true if the character is a lowercase letter?

letter = input("Enter a letter: ")

islower(letter)

isLower(letter)

letter.islower() * is correct

letter.isLower()

Answers

The right answer is : is.lower(letter)

Answer: islower(letter)

Explanation: got it right on edgen

how do you create 2 dimensional array with c++?

Answers

2 dimensional arrays in C++ are arrays that have 2 dimensions i.e. rows and columns

How to create the array?

To create a 2-dimensional array in C++, you make use of the following syntax

data_type array_name[rows][columns];

Assume the following parameters:

The data type of the array is integerThe array name is StudentsThe array has 10 rows and 20 columns.

The declaration of an array with the above properties would be:

int Students[10][20];

Read more about arrays at:

https://brainly.com/question/22364342

13. In cell B16, use the SUMIF function and structured references to display the total wins for teams in the Youth league.

Answers

Using the SUMIF function and structured references to display the total wins for teams in the Youth league is gotten as; 65

How to make use of the SUMIF Function?

The SUMIF function in excel combines a condition and a sum of the values which meets the stated condition. That is; SUMIF(row_range, condition)

From the attached image we can see the number of times youth won the league in column D. Also, we can see the total number of youth wins in column H under Total.

Thus, using SUMIF function for the total number of wins, we have;

B6 = SUMIF(SwimTeams[League], "youth",H3:H12

B6 = 21 + 16 + 12 + 9 + 7

B6 = 65

Read more about the SUMIF Function at; https://brainly.com/question/19595606

An IT infrastructure manager is reviewing his company's computer assets, particularly the mean time to failure (MTTF) of the PC and server hard drives. The manufacturer of the hard drives typically used in the company states that the MTTF is approximately 11 years. Because servers and some high-priority workstations must operate continuously except for brief periods of maintenance, how many hours, on average, can these hard drives be expected to operate before failure

Answers

The numbers of  hours, on average, can these hard drives be expected to operate before failure is 24 hours a day, also seven days a week and 365 days a year.

How many hours can Hard drive last?

The total life-time of a hard disk is said to be 5 years" that is about 43,800 hours of been in constant use.

Note that a key  reliability-linked criterion for the selection of storage components is based on its operating duty that is the numbers of  many hours in a day a drive can be active for.

A lot of HDDs used by Enterprise-class applications are said to be optimized for constant use that is 24 hours a day, seven days a week, and 365 days a year.

Note that a Managed Service Provider (MSP) have to plan for a failure in every 1000 hours that is about 42 days.

Learn more about hard drives from

https://brainly.com/question/1558359

My computer has been running slow for a few days I’m sure it’s a virus

Answers

Answer:

You try to clean it, dipping it in water 2-3 times will be fine.

Explanation:

ha ha I'm indian boy F...

Answer:

Don't put some water on it it will be break just clean it and tell your parents to fix it if you have a money you can fix it

How might the project team recommending an ERP design strategy justify its recommendation as compared with other types of design strategies?

Answers

The project team recommending an ERP design strategy by stating that in all, most of the attributes of a specific plan will bring about a good, quick and full return on that investment.

The project team can legitimize their ERP strategy by inputting the main preferred viewpoint to reengineering the proposed business procedure.

What is a ERP strategy?

The term  ERP strategy is a term that connotes the use of a technology strategy that often helps to integrates a combination of business functions.

The functions includes finance, HR and purchasing and linked  with operational areas, such as manufacturing  via a tight rope from operational business works to financial records.

Learn more about design strategy  from

https://brainly.com/question/5971614

please answer this question​

Answers

The salary calculator program is an illustration of a sequential program

What are sequential programs?

Sequential programs are programs that do not require loops, iterations or conditional statements

How to write the main program

The program written in Python, where comments are used to explain each action is as follows:

#This initializes the base number of hours

baseHours = 40

#This initializes the base payment

basePay = 600

#This initializes the overtime payment

overtimePay = 300

#This initializes the total hours worked

hoursWorked = 45

#This calculates the total payment

totalPay = baseHours * basePay + (hoursWorked - baseHours) * overtimePay

#This prints the total payment

print(totalPay)

Read more about sequential programs at:

https://brainly.com/question/26642771

In C, What is the #line used for?

Answers

The #line is mainly used to reset the line number and also the filename in the code.

What does a line in C mean?

The c in code is written in lower-case. The c that has a line over it means "with".

The C preprocessor is known to be macro processor that is often used often by the C compiler to change one's program before actual compilation. This   #line means that one can do any reset any line of code to an arbitrary line number or a filename that is said to have been stated by the user.

Learn more about code from

https://brainly.com/question/25605883

Networking essentials

Answers

Answer:

Gain the essential knowledge and skills required to configure, troubleshoot, manage and protect a data network.

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

A timer is set after each frame is sent before waiting an ACK for that frame, how long does the timer take to be expired?

Answers

A timer needs to be set after each frame is sent before waiting an ACK for that frame. The length of time it takes for a  timer take to be expired depends on only when the first outstanding frames has expires first.

Some do take 5 min., 10 minutes, or even 48 hours while others depends on what the sender has set.

What is A timer is set after each frame about?

A sender is one that is not entitled  to hold a timer for each frame. It has to hold a single timer.

When a  the timer expires, the sender can then  resends all the frames whose ACK has not been seen or received yet. The sender often starts the timer at the time it is sending the first frame , and because of that, it is only when the timer for the first set frames expires before the sender can resend any other outstanding frames.

Learn more about timer from

https://brainly.com/question/25800303

You have been asked to investigate a web server for possible intrusion. You identify a script with the following code. What language is the code in and does it seem likely to be malicious? import os, sockets, syslog def r_conn(ip) s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM) s.connect(("logging.trusted.foo",514))

Answers

The code below is written in JavaScript and does not seem malicious.

What is a Malicious Code?

A Malicious code is one that is not designed for any productive end but to cause disruptions in the computer with the objective of

harming the workstation; or destroying the data stored therein.

There are numerous classifications of malicious codes and they can be identified and removed by an application called an Anti-Virus or malicious app remover.

Learn more about JavaScript at:
https://brainly.com/question/16698901

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

Examples of ________, which is hosted on a web site, include e-mail, word processing, tax preparation, and game programs.

Answers

Answer:Web Application

Explanation:Web hosting is more or less like having an ordinary computer in the cloud in order share information and resources with others world wide.One cannot make effective use of a computer without software applications . Similarly hosting just normal html pages and documents on a server cannot help increase productivity,hence the creation of cloud computer applications also known as "Web Apps (Web Applications)" to aid boost productivity and information dissemination via quality task automations.

When purchasing a security program, you must make sure that _____. Select 2 options.

it can be implemented quickly

it can be easily adopted

it hinders operational efficiency

the employees are not involved

it is complex and complicated

Answers

Answer:

1 ans 3

Explanation:

Answer:

- it can be implemented quickly

- it can be easily adopted

Explanation:

When selecting a security program to purchase, you should want to ensure its efficiency. Correct on Edge.

I hope this helped!

Good luck <3

Use Advanced Filtering to restrict the data to only display full-time employees with at least one dependent. Place the results in cell A37. Use the criteria in the range H24:M25 to complete the function.

Answers

Answer:

Click cell H10, and enter an AVERAGEIFS function to determine the average salary of full-time employees with at least one dependent. Format the results in Accounting Number Format. Step 1: Open the excel and go to Insurance worksheet

Other Questions
What is fiber, where is it found, and how does it consumption maintain and improve health what is the square root of 6 Rewrite each expression below using the Distributive Property :a. 5 (2x + 1)b. 34 (x - 1)c. 9 (x + 3) TuesdaySharon gets paid every other week.She worked 19.5 hours one week and20 hours the other week. How muchdid she get paid, if she makes $9.25per hour? Identify the Gerund in the following sentence: Getting up early in the morning is sometimes a challenge. You have just completed an interview at CVS. Send a thank you email to the person who you did the email with. And let them know that you are interested in working with them, if given the opportunity. Please fill out the boxes in this template, and note this must be a formal email with a greeting and closing. What would the nosotros command be forhablar ->hablemos or hablamos How many atoms of N are in 137. 0 grams of N2O3? A. 1. 085 1023 B. 1. 802 1023 C. 5. 985 1023 D. 2. 171 1024 E. 3. 604 1024. Suppose that 25 inches of wire costs 75 cents.At the same rate, how much (in cents) will 21 inches of wire cost? When hydrogen is used in a fuel cell, the only waste product is/are __________ what mass of sulfurous acid is produced when 245g of sulfur dioxide is reacted with water?HO + SO = HSO Which angles are alternate interior angles? Do you believe that people can truly be "the master of [their] fate"? Is there really nosuch thing as destiny? Cite evidence from this text, your own experience, and otherliterature, art, or history in your answer.THE TEXT is in the photo- ( + 2b) (2 b) HELP ME PLEASE I need help ASAP, first one to get it correct gets 100 points. Which of the following best characterizes the early period of the experiment? let f(x)=3x+4 and g(x)=2x-5 find (f-g)(x) A triangle has two sides of length 4 and 2. What is the smallest possible whole-number length for the third side? The product of 2 positive integers is 78. The greaterinteger is 1 more than twice the lesser integer. What isthe greater integer? What are the three compositional layers of the earth.