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
swat32
3 years ago
5

Create an array of that size and then prompt the user for numbers to fill each position in the array. When all of the positions

are filled, display the contents of the array to the user. Below is a sample transcript of what your program should do. Text in bold is expected input from the user rather than output from the program.Please enter the number of digits to be stored: 5Enter integer 0: -1Enter integer 1: 10Enter integer 2: 15Enter integer 3: -6Enter integer 4: 3The contents of your array:Number of digits in array: 5Digits in array: -1 10 15 -6 3
Computers and Technology
1 answer:
andreyandreev [35.5K]3 years ago
4 0

Answer:

In Java

import java.util.Scanner;

public class Main {

  public static void main(String[] args) {

     Scanner input = new Scanner(System.in);

     int arrsize;

     System.out.print("Please enter the number of digits to be stored: ");

     arrsize = input.nextInt();

     int[] myarr = new int[arrsize];

     for (int kount = 0; kount < arrsize; kount++) {

        System.out.print("Enter integer: ");

        myarr[kount] = input.nextInt();      }

     System.out.println("The contents of your array:\nNumber of digits in array: "+arrsize);

     System.out.print("Digits in array: ");

     for (int kount = 0; kount < arrsize; kount++) {

        System.out.print(myarr[kount]+" ");      }

  }

}

Explanation:

This declares the length of the array

     int arrsize;

This prompts the user for the array length

     System.out.print("Please enter the number of digits to be stored: ");

This gets the input for array length

     arrsize = input.nextInt();

This declares the array

     int[] myarr = new int[arrsize];

The following iteration gets input for the array elements

<em>      for (int kount = 0; kount < arrsize; kount++) { </em>

<em>         System.out.print("Enter integer: "); </em>

<em>         myarr[kount] = input.nextInt();      } </em>

This prints the header and the number of digits

     System.out.println("The contents of your array:\nNumber of digits in array: "+arrsize);

     System.out.print("Digits in array: ");

The following iteration prints the array elements

<em>      for (int kount = 0; kount < arrsize; kount++) { </em>

<em>         System.out.print(myarr[kount]+" ");      }</em>

You might be interested in
Which is an example of a correct citation for a website with an unknown author?
antiseptic1488 [7]
With no author on a website you should name the website.

for example As shown in " Slave Density"------ it didn't have a author so i used the nameof source
7 0
4 years ago
Which are elements involved in diagramming a solution? Choose all that apply.
katovenus [111]

Answer:

1) showing a visual graphic of the solution

3) showing the flow of information through the solution

4) showing decision points

5) showing the path of information to decision points

Explanation:

 I'm sure this is the answer!!

4 0
3 years ago
How you will install an operating system on your computer
defon
Someone can install an operating system by disk or removable storage media.

Disk being floppy, tape or commonly a DVD.

Removable storage being a USBdrive.
5 0
3 years ago
"identify three data types covered in the database programming with sql course."
ankoles [38]

I guess the correct answer is VARCHAR, DATE, CHAR

VARCHAR - Hοlds a variablе lеngth string (can cοntain lеttеrs, numbеrs, and spеcial charactеrs). Thе maximum sizе is spеcifiеd in parеnthеsis. Can stοrе up tο 255 charactеrs.

DATE - A datе. Fοrmat: YYYY-MM-DD

CHAR - Hοlds a fixеd lеngth string (can cοntain lеttеrs, numbеrs, and spеcial charactеrs). Thе fixеd sizе is spеcifiеd in parеnthеsis. Can stοrе up tο 255 charactеrs

6 0
3 years ago
Cooper Technologies is a technology company that offers many IT services in Chicago. The company's services and products include
natima [27]

Answer: Broad needs and many customers.

Explanation:

Broad needs along with many customers is the strategic position technique in which customers are served with the service and product through a certain channel and ways.It is used for fulfilling the numerous needs of customers in a way that other competing companies cannot serve.

  • According to the question,Cooper technologies is using broad needs and many customers strategic positioning to serve its various customers with services like repair, computer training,tracking etc.
  • Thus, they are handling numerous needs of their many customers.
5 0
4 years ago
Other questions:
  • Write a function named print_backward that accepts a String as its parameter and prints the characters in the opposite order. Fo
    12·1 answer
  • Using tracking code, Google Analytics can report on data from which systems? A. E-commerce platforms.B. Mobile Applications.C. O
    11·1 answer
  • LDAP is an industry standard employed by Microsoft, which enables IT departments to use a(n) __________ structure when creating
    7·1 answer
  • Communications technology and the Internet can be used to reduce the time and costs involved in disseminating financial statemen
    14·1 answer
  • If you have a database of books in the library and you would like to find all books published after January 1, 2008, what criter
    7·1 answer
  • Interface elements include but are not limited to:
    8·1 answer
  • What can help you estimate how much money you might get in
    7·1 answer
  • c) If you are at foreign country visit, which banking card would you prefer to keep with you during visit (Debit Card or Credit
    10·1 answer
  • where element is the Hypertext Markup Language (HTML) element and _____ pairs define the styles that are applied directly to tha
    6·1 answer
  • Complete the sentence.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!