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
Multiple 24 by 8.95 I need to show the work. I don’t know the steps
hjlf

Answer: 214.8

Step-by-step explanation:

First move the decimal to the right, in this case 8.95 = 895., then multiply the 24 by 895. to get 21480., you then move the decimal to the left and you get 214.80 or 214.8.

3 0
2 years ago
What's a rational number between 7.7 and 7.9?
svet-max [94.6K]
A rational number is a number that can be expressed as the relationship between two integers. Fractions and decimals will either repeat or end. An example is 5. Maybe 7. 53573 is an example as well. So is 5/1, because 5 and 1 are both integers. so is 7.5, because 7 and 5 are both integers, and it ends (the numbers after the decimal doesn't keep going). Your answer is 7.8, because it ends. 
6 0
3 years ago
Read 2 more answers
Is (-7,2) a point on the line?​
Gala2k [10]

Answer:

what line i swear if u tell me i can answer just comment

Step-by-step explanation:

7 0
3 years ago
An ant travels at a constant rate of 30 cm every 2 minutes at what pace does the ant travel per centimeter
Rama09 [41]

Answer:

Answer: 15 cm in one minute. Step-by-step explanation: If the ant travels at 30 cm every two minutes, then divide both numbers by two to get the unit rate, which is 15 I'm per minute

6 0
3 years ago
Decide if the following is a true or false statement - explain how you know
Sophie [7]

Answer:

False

Step-by-step explanation:

The equation equals -1/2 - 4.25 which is -4.75, which is negative.

Hope that helps!

5 0
3 years ago
Other questions:
  • Pencils cost $.30 an I have five dollars how many can I by
    14·1 answer
  • The revenue, in dollars, of a company that produces video game systems can be modeled by the expression 5x2 + 2x – 80. The cost,
    11·2 answers
  • Taylor can make one banner out of yards of fabric. How many banners can he make with yards of fabric?
    9·1 answer
  • what is an expression for the total cost of a meal where the tax is 8% and the tip is 15%? select all that apply A. c+0.08+0.15
    12·1 answer
  • Consider the following formula:<br><br> ax-bc+y=z<br><br> What represents the formula for x?
    5·2 answers
  • These are 256 in a box.these are composed of apples,oranges,and ponkans. If their ratio is 3:5:6 respectively.how many apples ar
    5·1 answer
  • 5. A rock is dropped off of a bridge that is 50 feet above a river. How long will it take the rock to hit the
    7·1 answer
  • Part A.
    9·1 answer
  • What is answer for 1.88 x 10 to the seventh power
    11·1 answer
  • Solve the equation
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!