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
What is the perimeter of a parallelogram, if it's area is 36 cm^2 and the distances between the point of intersection of the dia
IgorC [24]

Answer:

The perimeter of a parallelogram is 30cm.

Step-by-step explanation:

From the question , the given area of a parallelogram is 36 cm².

But the area of a parallelogram can be calculated using below formula

Area = base * height

From the question the distances that exist between the point of intersection of the diagonals and the sides are 2cm and 3cm respectively

There is the same distance between point of intersection of the diagonals and the opposite sides then,

The base of the side with 4cm can be calculated as

ha= 2+ 2= 4cm

But area can be calculated as A= base × height

36= b1 × h1

36=b1 × 4

b1= 9cm

The base of the other side can be calculated with 6cm height

h2= 3+3=6cm

A= b2× h2

36= b2 ×h2

36= b2× 6

b2= 6cm

Then the perimeter of the parallelogram can be calculated as

P= 2(b1 + b2)

= 2(6+9)

= 30cm

Hence,the perimeter of the parallelogram is 30cm

4 0
3 years ago
The Point Imperial is the highest point of the Grand Canyon and it is 8,800
Afina-wow [57]

Answer:

1222

Step-by-step explanation:

sorry youve been waiting a minute

3 0
2 years ago
How many ways are
jekas [21]
This link is a trap so sex traffickers can track you then kidnap you. there’s been an influx of these “answers” on this app. if you see them report them immediately. they’re praying on children and it’s so dangerous.
3 0
2 years ago
April has only consumed one glass of wine, so her body isn't affected by the alcohol because short-term effects only begin with
MrMuchimi

ANSWER: False

This is false because alcohol can have effect as soon as the first drink, depending on the type of person you are.

For example, if your parents drank, and you were born early (a preemie) this can affect your ability to drink.

Hope this helps! ^^

4 0
3 years ago
Read 2 more answers
Lian is paid for SR 75 per hour. Using p for her pay and h for the hours of work, which function rule represents
Andru [333]

Answer:

The function p = 75h represents  this situation.

Step-by-step explanation:

We know the equation of linear equation in the slope-intercept form is

y = mx+b

where

m = rate of change = slope

b = y-intercept

  • Let 'h' be the number of hours
  • Let 'p' be the pay

Given that Lian is paid SR 75 per hour.

so the rate of change of slope = m = 75

As there is no initial condition, so b = 0

as

y = mx+b

Now, mapping the information data into the slope-intercept form

  • p = y
  • m = 75
  • h = x
  • b = 0

Thus, the equation becomes

p = 75h

Therefore, the function p = 75h represents  this situation.

VERIFICATION:

Given the equation

p = 75h

for h = 1

p = 75(1)

p = 75

Thus, Liam is paid SR 75 per hour.

4 0
2 years ago
Other questions:
  • miles has 25 coins In his pocket. Some are Nichols and some are dimes. He has a total of $1.65 how many of each type of coin doe
    9·1 answer
  • For dinner you decide to go to eat at a restaurant with your significant other the bill is $32.43 and you would like to leave a
    12·1 answer
  • Solve for u. -2u+2=-7u+17
    11·1 answer
  • ????????????????????
    6·2 answers
  • Consider a production process that produces batteries. A quality engineer has taken 20 samples each containing 100 batteries. Th
    15·1 answer
  • Which number is an integer?<br> -3/4<br><br> 1/5<br><br> 2<br><br> 4/2/3
    12·2 answers
  • Please help asap its timed ( 28 points)
    10·2 answers
  • Emma played two games of miniature golf.Her total score for the two games was 0. Emma’s score in the first game was +3. What was
    8·1 answer
  • Evaluate 3^−1⋅(4⋅6)⋅2^−3
    7·1 answer
  • Plz help!! 30 points!!
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!