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();
}









share|improve this question









New contributor




Matthew Maciejewski is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











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















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();
}









share|improve this question









New contributor




Matthew Maciejewski is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











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













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();
}









share|improve this question









New contributor




Matthew Maciejewski is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











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






share|improve this question









New contributor




Matthew Maciejewski is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Matthew Maciejewski is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 3 hours ago









mdfst13

17.1k52155




17.1k52155






New contributor




Matthew Maciejewski is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 4 hours ago









Matthew Maciejewski

1




1




New contributor




Matthew Maciejewski is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Matthew Maciejewski is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Matthew Maciejewski is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




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


















  • 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















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

Morgemoulin

Scott Moir

Souastre