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
Naddik [55]
3 years ago
14

Given a scanner reference variable named input that has been associated with an input source consisting of a sequence of integer

s and an int variable named total, write the code necessary to add all the integers in the input source and place their sum into total.
Computers and Technology
2 answers:
DedPeter [7]3 years ago
7 0
The answer is total = 0;while(input.hasNextInt()){total += input.nextInt( );}   Given a scanner reference variable named input that has been associated with an input source consisting of a sequence of integers and an int variable named total, The code necessary to add all the integers in the input source and place their sum into total is :                                                  total = 0;while(input.hasNextInt()){total += input.nextInt( );}   
liq [111]3 years ago
7 0

Answer:

Following are the code written in the Java Programming Language.

total = 0;   //set integer type variable and initialize to 0

while(input.hasNextInt()){   //set the while loop

total += input.nextInt( );  //code is here

}

Explanation:

Here, in the following code create the reference scanner class object i.e., "input".

  • Then, we set integer data type variable "total" and initialize 0 in it.
  • then, we set the while loop and pass the following condition "input.hasNextInt()".
  • Then, we add all integer values and store their sum in the variable "total".
You might be interested in
What are some ways to rename a worksheet? Check all that apply.
Mamont248 [21]

Answer:

Click the Home tab, click Format, click Rename Sheet, type the name, and press Enter

Explanation:

im  not really sure but i think this is the answer

have a good day

3 0
2 years ago
________ flows consist of data related to demand, shipments, orders, returns, and schedules, as well as changes in any of these
Alexxx [7]

Answer: Information

Explanation:  Information flows consist of data related to demand, shipments, orders, returns, and schedules, as well as changes in any of these data.

\textit{\textbf{Spymore}}

3 0
2 years ago
Add a subclass FillInQuestion to the question hierarchy of Section 10.1. Such a question is constructed with a string that conta
sattari [20]

Answer:

class Question:

   def __init__(self):

       self.text = ""

       self.answer = ""

   def setText(self,text):

       self.text = text

   def setAnswer(self,answer):

       self.answer = answer

   def display(self):

       print(self.text)

   def checkAnswer(self,response):

       ans = self.answer.replace(' ','')

       ans = ans.lower()

       response = response.replace(' ','')

       response = response.lower()

       if(response == ans):

           return "Correct answer"

       else:

           return "Wrong answer"

class FillInQuestion (Question):

   def __init__(self):

       super(Question, self).__init__()

   def setText(self,text):

       temp = text.split("_")

       temp[0] = temp[0] + "_______"

       super(FillInQuestion,self).setText(temp[0])

       super(FillInQuestion, self).setAnswer(temp[1])

def main():

   # Create the question and expected answer.

   q = FillInQuestion()

   q.setText("The inventor of Python was _Guido van Rossum_")

   # Display the question and obtain user's response.

   q.display()

   response = input("Your answer: ")

   print(q.checkAnswer(response))

main()

Explanation:

The python program defines two classes, a parent class called Question and a child class called FillInQuestion. The screen shot of the output is seen below.

3 0
2 years ago
"If an architecture has a move instruction with more than one word and at most one of the two operands may be an indirect memory
Citrus2011 [14]

Answer:

6

Explanation:

An instruction set architecture (ISA) can be defined as series of native memory architecture, instructions, addressing modes, external input and output devices, virtual memory, and interrupts that are meant to be executed by the directly.

Basically, this set of native data type specifies a well-defined interface for the development of the hardware and the software platform to run it.

Also, the set of instructions that defines the computer operation to perform (operand specifier) such as the addition of memory contents to a register, conditional move is referred to as an opcode. Thus, the number of operands in an instruction is grouped with respect to the maximum number of operands stated in the particular instruction such as 0, 1, 2, 3, etc.

In a processor, the minimum number of frames needed by a process depends on its instruction set architecture (ISA), as well as the number of pages used by each instruction.

<em>Hence, if an architecture has a move instruction with more than one word and at most one of the two operands may be an indirect memory reference, the minimum number of frames needed to run a process on this architecture is 6.</em>

6 0
2 years ago
7. Which of these statements is true? Agile is a programming language MySQL is a database HTML stands for "Hypertext Markup Link
timurjin [86]

Answer:

None of them is correct, but it seems one of the option has missing words.

The exact definition is, MySQL is a database management system.

Explanation:

Agile is not a programming language, it is a software development methodology.

HTML stands for "Hypertext Markup Language"

Java and JavaScript are different languages.

Actually,  MySQL is a database management system. It is used to deal with the relational databases. It uses SQL (Structured Query Language).

5 0
3 years ago
Other questions:
  • The rules and guidelines for appropriate computer mediated communication are called?
    9·1 answer
  • Cloud resources are​ ________ because many different organizations use the same physical hardware.
    12·1 answer
  • Programming CRe-type the code and fix any errors. The code should convert non-positive numbers to 1.
    12·1 answer
  • Which button, when pressed, allows light from the subject to fall on the sensor?
    8·1 answer
  • Which of the following is an advantage of batch processing?
    8·1 answer
  • A(n) ____ is software that can be used to block access to certain Web sites that contain material deemed inappropriate or offens
    11·1 answer
  • Coordinate with
    12·1 answer
  • Match the following technologies with their applications.
    11·1 answer
  • Overnight Delivery Service delivers a package to Pam. At the request of Overnight's delivery person, to acknowledge receipt Pam
    13·1 answer
  • Which of the following would most likely be the target audience for a product
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!