Search Name Option [on hold]
up vote
-3
down vote
favorite
I was just wondering how I could add a search option to this program? I'm stuck. Ex: The program will ask the user to enter a name to search for. it will then display the index position of the name within the array.
import java.util.Scanner;
public class NameSearcherMAC {
public static void main(String args) throws Exception {
Scanner scan = new Scanner(System.in);
System.out.println("How many names would you like to enter?");
int n = scan.nextInt(); //Ensures you take an integer
System.out.println("Enter the " + n + " names: ");
String names = new String[n];
//store the names in an array
for (int i = 0; i < names.length; i++){
names[i] = scan.nextLine();
}
java
New contributor
put on hold as off-topic by 200_success, πάντα ῥεῖ, Sᴀᴍ Onᴇᴌᴀ, l0b0, Alex L 4 mins ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – 200_success, πάντα ῥεῖ, Sᴀᴍ Onᴇᴌᴀ, l0b0, Alex L
If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
up vote
-3
down vote
favorite
I was just wondering how I could add a search option to this program? I'm stuck. Ex: The program will ask the user to enter a name to search for. it will then display the index position of the name within the array.
import java.util.Scanner;
public class NameSearcherMAC {
public static void main(String args) throws Exception {
Scanner scan = new Scanner(System.in);
System.out.println("How many names would you like to enter?");
int n = scan.nextInt(); //Ensures you take an integer
System.out.println("Enter the " + n + " names: ");
String names = new String[n];
//store the names in an array
for (int i = 0; i < names.length; i++){
names[i] = scan.nextLine();
}
java
New contributor
put on hold as off-topic by 200_success, πάντα ῥεῖ, Sᴀᴍ Onᴇᴌᴀ, l0b0, Alex L 4 mins ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – 200_success, πάντα ῥεῖ, Sᴀᴍ Onᴇᴌᴀ, l0b0, Alex L
If this question can be reworded to fit the rules in the help center, please edit the question.
Welcome to Code Review! Unfortunately this post is off-topic for this site. Please read What topics can I ask about here? - note that it states "If you are looking for feedback on a specific working piece of code...then you are in the right place!" Also, when posting your question, there should have been text on the side that read "Your question must contain code that is already working correctly..." When you have fixed the code, please update it here and it can be reviewed."
– Sᴀᴍ Onᴇᴌᴀ
3 hours ago
BTW java is dramatically different than javascript... I don't see any javascript here
– Sᴀᴍ Onᴇᴌᴀ
3 hours ago
add a comment |
up vote
-3
down vote
favorite
up vote
-3
down vote
favorite
I was just wondering how I could add a search option to this program? I'm stuck. Ex: The program will ask the user to enter a name to search for. it will then display the index position of the name within the array.
import java.util.Scanner;
public class NameSearcherMAC {
public static void main(String args) throws Exception {
Scanner scan = new Scanner(System.in);
System.out.println("How many names would you like to enter?");
int n = scan.nextInt(); //Ensures you take an integer
System.out.println("Enter the " + n + " names: ");
String names = new String[n];
//store the names in an array
for (int i = 0; i < names.length; i++){
names[i] = scan.nextLine();
}
java
New contributor
I was just wondering how I could add a search option to this program? I'm stuck. Ex: The program will ask the user to enter a name to search for. it will then display the index position of the name within the array.
import java.util.Scanner;
public class NameSearcherMAC {
public static void main(String args) throws Exception {
Scanner scan = new Scanner(System.in);
System.out.println("How many names would you like to enter?");
int n = scan.nextInt(); //Ensures you take an integer
System.out.println("Enter the " + n + " names: ");
String names = new String[n];
//store the names in an array
for (int i = 0; i < names.length; i++){
names[i] = scan.nextLine();
}
java
java
New contributor
New contributor
edited 3 hours ago
mdfst13
17.1k52155
17.1k52155
New contributor
asked 4 hours ago
Matthew Maciejewski
1
1
New contributor
New contributor
put on hold as off-topic by 200_success, πάντα ῥεῖ, Sᴀᴍ Onᴇᴌᴀ, l0b0, Alex L 4 mins ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – 200_success, πάντα ῥεῖ, Sᴀᴍ Onᴇᴌᴀ, l0b0, Alex L
If this question can be reworded to fit the rules in the help center, please edit the question.
put on hold as off-topic by 200_success, πάντα ῥεῖ, Sᴀᴍ Onᴇᴌᴀ, l0b0, Alex L 4 mins ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – 200_success, πάντα ῥεῖ, Sᴀᴍ Onᴇᴌᴀ, l0b0, Alex L
If this question can be reworded to fit the rules in the help center, please edit the question.
Welcome to Code Review! Unfortunately this post is off-topic for this site. Please read What topics can I ask about here? - note that it states "If you are looking for feedback on a specific working piece of code...then you are in the right place!" Also, when posting your question, there should have been text on the side that read "Your question must contain code that is already working correctly..." When you have fixed the code, please update it here and it can be reviewed."
– Sᴀᴍ Onᴇᴌᴀ
3 hours ago
BTW java is dramatically different than javascript... I don't see any javascript here
– Sᴀᴍ Onᴇᴌᴀ
3 hours ago
add a comment |
Welcome to Code Review! Unfortunately this post is off-topic for this site. Please read What topics can I ask about here? - note that it states "If you are looking for feedback on a specific working piece of code...then you are in the right place!" Also, when posting your question, there should have been text on the side that read "Your question must contain code that is already working correctly..." When you have fixed the code, please update it here and it can be reviewed."
– Sᴀᴍ Onᴇᴌᴀ
3 hours ago
BTW java is dramatically different than javascript... I don't see any javascript here
– Sᴀᴍ Onᴇᴌᴀ
3 hours ago
Welcome to Code Review! Unfortunately this post is off-topic for this site. Please read What topics can I ask about here? - note that it states "If you are looking for feedback on a specific working piece of code...then you are in the right place!" Also, when posting your question, there should have been text on the side that read "Your question must contain code that is already working correctly..." When you have fixed the code, please update it here and it can be reviewed."
– Sᴀᴍ Onᴇᴌᴀ
3 hours ago
Welcome to Code Review! Unfortunately this post is off-topic for this site. Please read What topics can I ask about here? - note that it states "If you are looking for feedback on a specific working piece of code...then you are in the right place!" Also, when posting your question, there should have been text on the side that read "Your question must contain code that is already working correctly..." When you have fixed the code, please update it here and it can be reviewed."
– Sᴀᴍ Onᴇᴌᴀ
3 hours ago
BTW java is dramatically different than javascript... I don't see any javascript here
– Sᴀᴍ Onᴇᴌᴀ
3 hours ago
BTW java is dramatically different than javascript... I don't see any javascript here
– Sᴀᴍ Onᴇᴌᴀ
3 hours ago
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Welcome to Code Review! Unfortunately this post is off-topic for this site. Please read What topics can I ask about here? - note that it states "If you are looking for feedback on a specific working piece of code...then you are in the right place!" Also, when posting your question, there should have been text on the side that read "Your question must contain code that is already working correctly..." When you have fixed the code, please update it here and it can be reviewed."
– Sᴀᴍ Onᴇᴌᴀ
3 hours ago
BTW java is dramatically different than javascript... I don't see any javascript here
– Sᴀᴍ Onᴇᴌᴀ
3 hours ago