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
11111nata11111 [884]
2 years ago
12

First, allow the user to enter a numeric value representing how many names they would like to enter. Next, create an array with

its size based on that value. Once the array is created, allow the user to enter in names until the array is full. Again, use a for loop to do this

Mathematics
1 answer:
Alexxandr [17]2 years ago
3 0

Answer:

//Scanner class is imported to allow program receive user input

import java.util.Scanner;

//The Solution class is defined

public class Solution {

   // main method that begin program execution is declared

   public static void main(String args[]) {

       // Scanner object scan is created

       Scanner scan = new Scanner(System.in);

       // A prompt is displayed to the user

       // the prompt asked the user to enter a number

       System.out.println("Enter a number: ");

       // the user input is assigned to a variable size

       int size = scan.nextInt();

       // an empty string name is initialized

       String name = "";

       

       // A string array called names is initialized

       // have the inputed number as size

       String names[] = new String[size];

       // A for-loop that allow a user to enter name

       // and fill the array with it

       for(int i = 0; i < size; i++){

           // A prompt is displayed asking the user to enter a name

           System.out.println("Enter a name: ");

           // the received input is assigned to name

           name = scan.next();

           // name is assigned to an index

           names[i] = name;

       }

       

       // A blank line is printed for clarity

       System.out.println();

       // for-loop to loop the array and print the entire element

       for(int i = 0; i < size; i++){

           System.out.println(names[i]);

       }

   }

}

Step-by-step explanation:

The program is well commented and written in Java. A sample image of program output during execution is attached.

You might be interested in
Help with this plz? <br>Topic (Similarity)​
Darina [25.2K]

Answer:

MATH

Step-by-step explanation:

7 0
2 years ago
What is the value of x?​
Hatshy [7]

Answer:

x=84

Step-by-step explanation:

the sum of the angles in a pentagon is always 540 so do

540-131-108-107-110=84

8 0
2 years ago
Read 2 more answers
Find the common ratio r for the geometric sequence and use r to find the next three terms. Enter your answer to four decimal pla
kirza4 [7]

Answer:

the common ration is -0.4. Three terms: 2.56,-1.024, and 0.4096
Step-by-step explanation:

You just keep on multypling the terms by -0.5 ,and you get.

7 0
2 years ago
Luna mixes 3/4 cup of orange juice with 3/8 cup of cranberry juice. She gives 5/8 cup of juice to mags. How much is left in luna
Anuta_ua [19.1K]

Answer:

\frac{1}{2}  \: cup \: of \: juice

Step-by-step explanation:

See the attached picture for explanation.

5 0
3 years ago
Suppose that g(x)=f(x-4) witch statement best compares the graph of g(x) with the graph of f(x)?
Anit [1.1K]
C I think is the answer ?
5 0
2 years ago
Other questions:
  • Cameron classified -18/3 as real, rational, integer and a whole number and a whole number. Is he correct? why or why not?
    11·1 answer
  • In the form of a paragraph, explain the difference between a ray and a segment.
    11·1 answer
  • What is 2212 divided by 85 as a fraction?<br> Thx!!
    10·2 answers
  • What is the area of this circle?
    7·1 answer
  • Find the radius of the circle. Please show work, thank you
    15·1 answer
  • Find the gradient of the function g(x,y)= xy at the point (5. - 1). Then sketch the gradient together with the level curve that
    9·1 answer
  • Heeeeelppp please, :) please
    7·1 answer
  • PLEASE HELP ME! Tysm &lt;3 Have a great day. The Picture is below.
    14·2 answers
  • Find the mean of the following data: 0, 5, 30, 25, 16, 18, 19, 26, 0, 20, 28
    12·1 answer
  • URGENT 30 points I need help
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!