Create a Java program which asks the user how many names they want to enter. The program should then instantiate an array that will hold this many names. The main method should call a method, getNames() to allow the user to enter the names. A for loop should be used in this method. Once the names are entered, the main method should call another method displayNames() which will use a while loop to display the names entered.
/**
* Please find the required solutions
*/
import java.util.Scanner;
public class NamesApp {
/*Get Names method inputs names of length of parameters*/
public static void getNames(String[] names) {
// read names from user using for loop
Scanner keyboard = new Scanner(System.in);
for (int i = 0; i < names.length; i++) {
System.out.println("Enter name " + (i + 1) + ": ");
names[i] = keyboard.nextLine();
}
// finally close resource
keyboard.close();
}
/**
* Display names using while loop
*
* @param names
*/
public static void displayNames(String[] names) {
System.out.println("Displaying names: ");
int i = 0;
while (i < names.length)
System.out.println(names[i++]);
}
/**
* Main method with required implementation
*/
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
System.out.println("Enter number of names to enter");
int numberOfNames = keyboard.nextInt();
keyboard.nextLine();
String[] names = new String[numberOfNames];
getNames(names);
displayNames(names);
keyboard.close();
}
}
Sample output:

Create a Java program which asks the user how many names they want to enter. The...
Java Letter Counter: Write a program that asks the user to enter a string, and then asks the user to enter a character. The program should count and display the number of times that the specified character appears in the string. Must use a do while loop and a counter!!!!
***** JAVA ONLY ***** Write a program that asks the user to enter the name of a file, and then asks the user to enter a character. The program should count and display the number of times that the specified character appears in the file. Use Notepad to create a simple file that can be used to test the program. ***** JAVA ONLY *****
Write a program in JAVA that asks the user to enter an integer. Store the integers in an array. Allow for up to 10 integers. When the user enters -1, the program should end. Print the number of integers entered as well as the number of times each integer was entered.
In Java, write a program using a loop that asks the user to enter a series of decimal numbers. The user must enter -88 to end the input of the decimal numbers. After the user enters all numbers, the program should display the sum of all numbers entered.
Use printf(...) method to Write a java program that asks the user to enter three different names and then sorts and display names in ascending order. For example, if the names "Maria", "Kelley", and "Angie" were entered, the program will display: Names in sorted order are: FIRST: Angie SECOND: Kelley THIRD: Maria
C++ please no arrays! Create a program that will allow the user to enter up to 50 whole values and determine the number of values entered, how many of the values were odd and how many of the values were even. Your code should contain 2 functions, a main function and a function to enter the numbers enter and count the values. Your main function should be a driver program that will call another function to count the total number...
Write a console-based program ( C # ) that asks a user to enter a number between 1 and 10. Check if the number is between the range and if not ask the user to enter again or quit. Store the values entered in an array. Write two methods. Method1 called displayByVal should have a parameter defined where you pass the value of an array element into the method and display it. Method2 called displayByRef should have a parameter defined...
Create a program that allows a user to enter up to five names of friends. Use a twodimensional array to store the friends’ names. After each name is entered, the user should have the option to enter another name or print out a report that shows each name entered thus far
Write a java program that asks the user to enter an integer. The program should then print all squares less than the number entered by the user. For example, if the user enters 120, the program should display 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, and 100.
write a program code that asks the user how many numbers they wish to find the statistics of and then asks the user to enter those numbers. The program must then calculate and display the average variance and standard deviation of the numbers entered by the user. the program code must -ask three user how many numbers they wish to find the statistics of -ask the user to enter those numbers and store them in an array - use a...