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
Negative one and one-sixth divided by negative six
Sveta_85 [38]

Answer:

Step-by-step explanation:

5 0
3 years ago
Read 2 more answers
What is the measure or PHJ
Elina [12.6K]

Answer: The measure of PB and J* not PHJ is Deliciousness.

Step-by-step explanation:

6 0
3 years ago
The bar diagram represents 24 hours in one day and shows a mark at 30%. If you sleep 30% of the day, how many hours do you sleep
Sedbober [7]
30% = 3/10

Number of hours you sleep = 24hours × 3/10
= 24hours ÷ 10 × 3
= 2.4hours × 3
= 7.2hours

Hope this helps! :)
4 0
3 years ago
John’s mathematics teacher drew a triangle that had a 70° angle and a 20° angle. What is the measure of the third angle in the t
kari74 [83]
All triangles interior angles equal 180
So these 3 angles = 180
7 0
3 years ago
Marty was renting a boat and wanted to get the best plan. Rental plan A charges a fee of
harina [27]

The system of equations that represent the situation are as follows;

  • C = $50 + $25h

  • C = $10 + $35h.

According to the question;

  • Mary was trying to rent a boat and wanted to get the best plan.

  • Let C = Charged fees

  • and h = hours of rental

For Plan A:

  • Rental plan A charges a fee of
  • $50 plus $25 per hour.

  • C = $50 + $25h

For Plan B:

  • Plan B charges a fee of $10 plus $35 per hour.

  • C = $10 + $35h.

Read more on rental charges;

brainly.com/question/1503197

6 0
2 years ago
Read 2 more answers
Other questions:
  • Willow Brook National Bank operates a drive-up teller window that allows customers to complete bank transactions without getting
    14·1 answer
  • Help with this question
    13·1 answer
  • Which is a disadvantage of withdrawing more money than is available in a checking account?
    15·2 answers
  • Randy has pie shaped fraction pieces with an angle of 60.how many fraction pieces does he need to make a circle
    5·1 answer
  • Help would really be appreciated. The question is in the picture.
    7·1 answer
  • A bookstore buys Algebra 1 books at a wholesale price of $23 each. It marks up the price by 92% and then sells the Algebra 1 boo
    8·1 answer
  • Julia studied math for 3 1/3 hours during the 4 days before her last math test. What was the average amount of time she studied
    13·1 answer
  • Sean has some candy bars that he wants to give away. He is going to give each person 1/8 of a bar, and he has 2 3/4 bars to give
    14·1 answer
  • I need help with this radius and diameter
    15·2 answers
  • Solve for x. Will brainlist correct answer
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!