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
PLZ HELP I BEG YOU 20 POINTS!!!!
Charra [1.4K]

Answer:

b=\frac{g}{x} + \frac{5}{x^{3} } +\frac{1}{x^{2} }

Step-by-step explanation:

4 0
3 years ago
Read 2 more answers
Anwers : <br> a. dotted<br> b. y=-x+4<br> c. y=x-4<br> d. y=x+1<br> e. solid<br> f. yes<br> g. no
Ksenya-84 [330]

Answer:

Those answers are correct

5 0
3 years ago
28 is what precent of 50
WITCHER [35]

Answer:

56%

Step-by-step explanation:

28/50=56/100

7 0
3 years ago
Read 2 more answers
The next number in the pattern 1 5 25 125 625
chubhunter [2.5K]
5⁰ = 1
5¹ = 5
5² = 25
5³ = 125
5⁴ = 625
5⁵ = 3125
5 0
4 years ago
Evaluate the function at x = -2.
Lera25 [3.4K]

Answer:

B. y=0

Step-by-step explanation:


7 0
3 years ago
Other questions:
  • WILL CROWN BRAINLIEST, GIVE THANKS, AND AMAZING RATING
    11·1 answer
  • a bag contains 57 coins which are only quarters and dimes the total value of coins is $9.45 how many dimes are in the bag​
    5·1 answer
  • Calculate the side lengths a and b to two decimal places.
    13·1 answer
  • A psychologist collects data on the time, w, in minutes, people walk each day and their scores, t ,on a stress test. The scores
    9·2 answers
  • Shawn bough fruit last week, consisting of 2.26 pounds of bananas,1.5 pounds of grapes, and watermelon that weighed 6.78 pounds.
    5·2 answers
  • What is the total surface area of the figure shown?
    8·1 answer
  • Write a mathematical situation to represent the following expression: (-4) x 5
    12·2 answers
  • This is just a gift for armys. i left a kiyoot pic of jimin..
    7·2 answers
  • What is the circumference
    14·1 answer
  • Given the following equation in point-slope form. Identify the slope and the point.
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!