1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
murzikaleks [220]
2 years ago
10

How can I get multiple user inputs in Java ? I want to be able to use it for subtraction, addition,division and multiplication.F

or example it should run like
How many numbers do you want to subtract?
4
Enter 4 numbers:
1
2
3
4
result:-8
Computers and Technology
1 answer:
Evgesh-ka [11]2 years ago
7 0
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();
You might be interested in
_________________ is the logical operator if either conditions is True, then the whole statement is TRUE.
Rus_ich [418]

Answer:

Assuming your using the language python, The 'or' operator

Explanation:

To explain this further, or is used in python to describe another condition whether the first one was true or false. Here is a list of what they all briefly mean:

Object-Oriented Programming allows you to create objects with specific characteristics. Ex. you could have a dog class that describes a dogs name and breed. You can make an instance and call it Max with its breed being a golden retriever etc.

----------------------------------------------------------------------------------------------------------------

Procedures independant code that just has simple instructions

----------------------------------------------------------------------------------------------------------------

Functions like object oriented programing but instead of having attributes it is a block of code that does an action. In python, unless the function is called, however, it won't do anything

----------------------------------------------------------------------------------------------------------------

'or' allows someone to give another condition whether the other conditions were True or False.

hope this helped :D

8 0
3 years ago
There are 55 registers, and total 60 instructions available in a general-purpose computer. The computer allows only 2-address in
Andrei [34K]

Answer:

31 bits.

Explanation:

Given, total number of registers = 55

Total instructions = 60

Size of memory = 16 KB

Now, no of registers are 55. We find the next greater or equal power of 2 which is 64 = 26. Hence, 6 bits are required to represent a register operand.

Number of instructions = 60. We find the next greater or equal power of 2 which is 64 = 26. Hence, 6 bits are required to represent a instruction.

Size of memory = 64 KB = 26 * 210 * 23 bits = 219 bits. Hence, 19 bits are required to represent a memory location.

Now, an instruction has 2 parts, opcode and operand. As given there are only two address instructions which are memory operand and register operand.

Hence, total bits would be: 6 bits (opcode) + 6 bits (register operand) + 19 (memory operand) = 31 bits.

7 0
3 years ago
How can I crack a computer password?
Irina18 [472]
Try to use easy passwords first like the persons birthday fav color etc then move on to harder passwords
7 0
3 years ago
Which firewall has a network interface located in a unique network segment that allows for true isolation of the segments and fo
elixir [45]

Answer:

DUAL - HOMED FIREWALL

Explanation:

Dual-home firewall refer to an Ethernet device that has more than one network interface that sits between an untrusted network and trusted network in other to provide secure access.

In dua homed firewall one connection is an internal network and the second connection is to the Internet and works as firewall provided in which there is no direct IP traffic between the Internet and the internal network. In such a case, all Internet applications are run only on the dual-homed host.

4 0
3 years ago
Select the correct answer.
GrogVix [38]

Answer:

png or jpg

Explanation:

7 0
3 years ago
Other questions:
  • Like Tess, Brina has a fascinating job! She works as a software engineer with Instagram. She says that Computer Science is a way
    10·2 answers
  • Write a definition of the function printDottedLine, which has no parameters and doesn't return anything. The function prints to
    14·1 answer
  • Two advantages of Internet are ?​
    7·2 answers
  • Green field country is planning to conduct a cricket match between two teams A and B. a large crowd is expected in the stadium a
    6·1 answer
  • The Python print function
    9·1 answer
  • What is the range of addresses for conditional branches in MIPS (K = 1024)?
    6·1 answer
  • The index used by the OS to manage computer files is called _____.
    13·2 answers
  • How do you think the blitz might have affected civilian morale in london
    15·1 answer
  • What was the first computer name brand
    12·2 answers
  • Q.3.1 Explain why devices on a network need addresses. (5)​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!