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
vampirchik [111]
3 years ago
9

Design a for loop that gets 6 integer numbers from a user, accumulates the total of them, then displays the accumulated total to

the user. Just write the code segment to show what is asked, not a complete program. However, declare any variables that you need to use. Use a semicolon (;) at the end of each line of code so I can tell when you use a new line in your code.
Computers and Technology
1 answer:
PSYCHO15rus [73]3 years ago
6 0

Answer:

Explanation:

The following loop code is written in Java and asks the user for the 6 integer numbers as mentioned in the question and sums them up. Finally putting them into a variable named total and printing it out.

       int total = 0;

       for (int x = 0; x < 6; x++) {

           Scanner in = new Scanner(System.in);

           System.out.println("Enter an integer: ");

           total += in.nextInt();

       }

       System.out.println("Your total is: " + total);

You might be interested in
Caroline has been asked to find a standard to guide her company’s choices in implementing information security management system
koban [17]

Answer:

ISO 27002

Explanation:

The acronym ISO stand for The International Organization for Standardization. its a non governmental body that is responsible for setting standards guide internationally.

while NIST stand for National Institute of Standards and technology and it is also a body that is responsible for setting up standard guide in the US..

ISO 27002  is a standard code for implementing information security management systems. while  ISO 27017 is for cloud security.  NIST 800-12 is a general security and NIST 800-14 is for policy development. thus option A is correct.

Note :

All code preceded by ISO is from The International Organization for Standardization and are international standard. while those preceded by NIST is from National Institute of Standards and technology  and are not international standard.

7 0
3 years ago
Assuming that a user enters 15 as input, what is the output of the following code snippet? Scanner in = new Scanner(System.in);
snow_tiger [21]

Answer:

The output of the following code is "The number is SMALL!"

Explanation:

When the following java code is executed. Firstly the program will ask for "Please enter a number" after input the number 15 as per the question, than it check the condition which is "number > 20", if the number is greater than 20 it shows "The number is LARGE!", but the given number is smaller than 20.

3 0
3 years ago
Given a long integer representing a 10-digit phone number, output the area code, prefix, and line number using the format (800)
Alexxandr [17]

Answer:

See explanation!

Explanation:

Here we have a program written in C++ language. Each // symbol is a relative comment explaining the reason for each command line (and is not included during the program execution).

<em>The Program: </em>

#include <iostream>

<em>//c++ build in library</em>

using namespace std;

<em>//main code body starts here</em>

int main()

{

 <em> //declare variable to store phone numbers,its area code, prefix and line    number.</em>

  long pnumber;   <em>//declare long variable</em>

  int ac, prefix, lnumber;

 <em> //declare integer variables, where ac: Area Code and lnumber is the Line Number</em>

  cout<<"Enter a 10-digit Phone Number: "<<endl;

  <em>//cout command prints on screen the desired message</em>

  cin>>pnumber;

 <em> //cin command enables the user to interact with the programm and enter information manually</em>

 <em> //main body to obtain the desired output starts below</em>

<em>   //each 'division' is used to allocate the correct value at the correct </em>

<em>   //since prefix is used to get the desired output of ( )    -</em>

  ac = pnumber/10000000;

  prefix = (pnumber/10000)%1000;

  lnumber = pnumber%10000;

 <em> //main body ends here</em>

  cout<<"Based on your 10-digit number"<<endl;

  cout<<"below you have (AreaCode), Prefix, and - line number "<<endl;

  cout<<"("<<ac<<")"<<""<<prefix<<"-"<<lnumber<<endl;

 <em> //Prints on screen the desired output of the long 10 digit Number</em>

  return 0;<em> //ends program</em>

}

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

<em>The Output Sample:</em>

Enter a 10-digit Phone Number:

8019004673

Based on your 10-digit number

below you have (Area Code), Prefix, and - line number

(801) 900-4673

<em>....Programm finished with exit code 0</em>

8 0
3 years ago
How do computers work
solniwko [45]
Computers have an Bios which is the base of the whole OS. (Bios helps to boot up your OS for example Windows on your PC) The Bios has simple hardware settings whilst the OS has system software settings. the Hardware is linked with the system OS software to help make them work. All software in the OS system folder is linked and has permissions to work to help provide a power UI (User Interference)
6 0
3 years ago
What is a foreign key and how does it provide referential integrity?
Step2247 [10]

Answer:

By definition a foreign key of table A is a primary key of another table B, thereby establishing a link between them.

To provide referential integrity you can use these referential actions:

  • <u>Cascade:</u> If rows in table B are deleted, the matching foreign key columns in table A are deleted.
  • <u>Set Null:</u> If rows in table B are deleted, the matching foreign key columns in table A are set to null.
  • <u>Set Default:</u> If rows in table B are deleted, the matching foreign key columns in table A are set with the default value of the column.
  • <u>Restrict:</u> A value in table B cannot be deleted or updated while as it is referred to by a foreign key in table A.

4 0
3 years ago
Other questions:
  • What software refers to the on authorized and illegal duplication or sale of software
    10·1 answer
  • If I put a short clip from a copyrighted video to Facebook and make it only viewable to friends, is that illegal?
    12·1 answer
  • Describe what is meant by the following:
    14·1 answer
  • 1D Array Assignment Outcome: Student will demonstrate the ability to use a one-dimensional array. Student will demonstrate the a
    5·1 answer
  • Microsoft word's spelling checker will offer suggestions on misspelled words.<br> True)<br> False)
    7·2 answers
  • Why is it difficult to convince top management to commit funds to develop and implement SIS
    5·2 answers
  • What in the world is this for and how do you use it
    8·2 answers
  • Select the four bad password ideas.
    13·2 answers
  • Candy Kane Cosmetics (CKC) produces Leslie Perfume, which requires chemicals and labor. Two production processes are available:
    14·1 answer
  • Which of the following is a database concept that allows for storage and analysis for a dozen to billions of data points?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!