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]
3 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]3 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
Is 45.07 x 3.25 an overestimate
vitfil [10]

Answer:

No i dont think it is

Step-by-step explanation:

srry if im wrong :C

8 0
3 years ago
Read 2 more answers
You sell pies at a farmers' market for $7.50 each. A group of 5 kids wants to pitch in equal1y to share one of your pies. How mu
Korolek [52]
Its 5 divided my 7.50 since each decided to pitch in to help by the pie
3 0
3 years ago
Read 2 more answers
Assignme
pishuonlain [190]

Answer:

18

Step-by-step explanation:

5 scores so far + next quiz =6 scores

6 times 16=96

She has to get a quiz score sum of 96 to get an average of 16

18+15+16+14+15=78

96-78=18

5 0
3 years ago
Nikki M and Cardi B are debating about which set of numbers would best describe the temperature in New York on any given day Nik
kompoz [17]

Cardi B

Step-by-step explanation:

It is decreasing in the time interval 0 < x < 2 hours.

7 0
3 years ago
Fifty-five percent of the pupils in a class are
tatyana61 [14]
Answer: it’s 55/100 percent
4 0
3 years ago
Other questions:
  • A shopper uses a department store gift card to pay for 5 sweaters priced at $26 each. What is the change in the value of the gif
    14·1 answer
  • H=39t-5t2 find all the values of t for which the rockets hight is 22 meters
    8·1 answer
  • How to solve this equation: ax² - 5x + 2 = 0
    5·1 answer
  • What value of x is in the solution set of 3(x – 4) 5x + 2?<br> O-10<br> O -5<br> O 5<br> O 10
    6·2 answers
  • Which ratio forms a proportion with 9/15?<br> A. 6/10<br> B. 16/21<br> C. 36/50<br> D. 45/70
    10·2 answers
  • Simplifying radicals!please help and show work!
    8·1 answer
  • Solve this equation.<br> 2/3x-1/5x=x-1
    5·2 answers
  • Find the value of x in the triangle shown below.
    11·1 answer
  • Please help me with this question​<br>please do fast
    10·1 answer
  • Write in expanded form.<br><br> 7,891
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!