Question

In: Computer Science

Use your creativity to make a Novelty Name Generator of your choice, ie: Spooky Halloween Names,...

Use your creativity to make a Novelty Name Generator of your choice, ie: Spooky Halloween Names, Christmas Elf Names, Anything that is school appropriate.

To create the novelty name you should use at least 2 associative arrays.

The page design is up to you. For example:

  • you may use the student name list from last week and create an array of names with their novelty names and display all
  • you may use a button to randomly select a name from the student name list and display their novelty name
  • you may use a form to allow the user to enter their name and then generate and display their novelty name
  • you may think a method other than these. . .

Solutions

Expert Solution

Hi,

I created java programs for all options which you wanted..you didint specify any language option so i choosed java for the implementation.

There are 3 option you will have while running the program

1. Display list of Student with their novelty name.

2. Add more students with theri novelty names

3. Search student by his name to see his/her novelty name.

4. Quit to quuit from the system(program).

I created one class called NoveltyName.java which will store name and novelty name of each studdent and then it will be added by a container or data structure called ArrayList for further more processing.

NoveltyName.java:

public class NoveltyName
{
        
     private String stdName;
         private String novName;


         // DEfault constructor
    NoveltyName(){
      System.out.println("Default constructor");
    }

        NoveltyName(String stdName, String novName){
      //System.out.println("arrgument constructor");
          this.stdName = stdName;
      this.novName = novName;
         
    }


    public String getStdName()
     {

       return stdName;

     }
     
          public String getNovName()
     {

       return novName;

     }


        @Override

      public String toString()
      {

        return stdName + "\t\t\t" + novName;

      }

}

TestNoveltyName.java:  

Another class is main driver class where we wil get alot of option to get command from user.

import java.util.Scanner;
import java.util.ArrayList;

public class TestNoveltyNames
{
        public static void main(String[] args) 
        {
                // Array list to add all the students information in this class object
        ArrayList<NoveltyName> list = new ArrayList<NoveltyName>();
                String choice="";
        // Added name of students and their novelty names
                NoveltyName nnames1 = new NoveltyName("Arachna", "Spider Woman");
            NoveltyName nnames2 = new NoveltyName("Banshee", "Screaming Spirit");
                NoveltyName nnames3 = new NoveltyName("Barnabas", "Dark Shadows");
                NoveltyName nnames4 = new NoveltyName("Beelzebub", "Devil");
                NoveltyName nnames5 = new NoveltyName("James", "Legand");
        list.add(nnames1); // added student object in array list
                list.add(nnames2);
                list.add(nnames3);
                list.add(nnames4);
                list.add(nnames5);
        
                Scanner input = new Scanner(System.in);
                while(true){
                        System.out.println("########## Please choose below options: #############\n");
            //user can  choose below options 
                    System.out.println("1. To display students list their novelty names.");
                    System.out.println("2. To add student name with his novelty name.");
                        System.out.println("3. To search novelty name by student original name.");
                        System.out.println("4. Quit.");
                        choice = input.nextLine();
                        // by this we are displaying studdent information
                        if(choice.equals("1")){
                             System.out.println("Student Name:               Novelty Name:\n");
                 for(NoveltyName nm : list){
                                     System.out.println(nm);
                                 }
                        }
                        // user can add more student wwith their novelty names 
                        else if(choice.equals("2")){
                                while(true){
                            System.out.println("Please enter name of the student: ");
                                String name = input.nextLine();
                        System.out.println("Please enter novelty name of the student: ");
                                String novName = input.nextLine();
                list.add(new NoveltyName(name, novName));
                                System.out.println("Name added succesfully.\n");
                System.out.print("Do you want to add more names? press (y/n)? ");
                                   choice = input.nextLine();   
                                   if(choice.equalsIgnoreCase("n"))
                                           break;
                                }


                        }// else if end for 2
                        else if(choice.equals("3")){
                                //search student by his name
                           System.out.println("Please enter student original name? ");
                           choice = input.nextLine();
                           for(NoveltyName nm : list){
                              if(nm.getStdName().equalsIgnoreCase(choice)){
                                       System.out.println(nm);
                                  }
                           }
                        }
                        // quite from the system.
                        else {
                           System.out.println("Quit from the system.");
                                   break;
                        }





                } // outer while loop
 



        }
}

Output:


Related Solutions

1-Edgeworth box a. Make an Edgeworth box by own choice of original person names and goods...
1-Edgeworth box a. Make an Edgeworth box by own choice of original person names and goods types. b. Indicate a point in the box which is not Pareto optimal. Explain. c. Indicate a point in the box which is Pareto optimal. Explain. d. Can a skewed distribution of resources be Pareto optimal? Why or why not? Indicate your answer in the Edgeworth box.
Make a chart as listed in your text of the mood stabilizing agents. Know the names,...
Make a chart as listed in your text of the mood stabilizing agents. Know the names, contraindications/precautions. Lithium is the gold standard for mood disorders but not all patients can take this drug. Be familiar with it and its narrow drug range and drug withdrawals. What are "acceptable" side effects of taking Li+? You will notice many of these drugs have "unlabeled" uses such as for migraine management, etc
choose any drug and name of your drug both generic and trade names..Athorough description of the...
choose any drug and name of your drug both generic and trade names..Athorough description of the drugwhich includes.a)whatis the drug used for b)what is .the classificationof the drugc ..c)what is the action of the drug. d)what is the side effects of the drugethe interactions ofthedrugthe precautions while taking the drugg.when to contact the health care providerh.theinformationyou gainedduring your researchAfter the description which includesall of the above elements, provide information to yourclient about why they are taking the drug, any special...
3. Use a ‘real-world’ (ie. non-IT) analogy to illustrate your understanding of an Enterprise Service Bus...
3. Use a ‘real-world’ (ie. non-IT) analogy to illustrate your understanding of an Enterprise Service Bus (ESB). Explain how in the specific context of your analogy, does the ESB facilitate scalable interaction of computer systems across an enterprise.
Make your own survey on a health administration or public health topic of your choice. Create...
Make your own survey on a health administration or public health topic of your choice. Create a survey with 10 questions that adheres to the following requirements: Descriptive Name Flow of questions is thoughtful and makes sense Minimum of 2 sections Question types (other questions types are up to you) 1 drop down question with 5 options 2 multiple choice questions (minimum of 3 options) 1 "check all that apply" question 1 multiple choice grid question with a minimum of...
Use a firm of your choice, either real or of your own creation aand write as...
Use a firm of your choice, either real or of your own creation aand write as from the perspective who has just been hired to conduct and audit of the firm. a) Using the firm you have chosen, outline a thorough outline for the audit that includes descriptions of particularly important issues to be dealt with along the way. b) Using the firm you are auditing, thoroughly outline the evidence you will gather. Explain the importance of each type and...
Use a firm of your choice, either real or of your own creation aand write as...
Use a firm of your choice, either real or of your own creation aand write as from the perspective who has just been hired to conduct and audit of the firm. explain each part at least in 200 words. a) Using the firm you have chosen, outline a thorough outline for the audit that includes descriptions of particularly important issues to be dealt with along the way. b) Using the firm you are auditing, thoroughly outline the evidence you will...
The dentist asks you to make provisional crown for teeth #8 and #9. Your choice of...
The dentist asks you to make provisional crown for teeth #8 and #9. Your choice of coverage the polycarbonate crown. Because the teeth involved are the maxillary centrals, what are your concerns regarding these provisional crowns?
- Use separate diagrams of your choice to illustrate and answer the following: a) Can a...
- Use separate diagrams of your choice to illustrate and answer the following: a) Can a given consumer have more than one indifference curve when deciding between (say) free time and working? If so, can those indifference curves cross at any point? Why or why not? Why are the indifference curves convex? b) Is the concept of Nash equilibrium useful when we have a dominant strategy equilibrium? Why/why not? Is the concept of Nash equilibrium useful to predict outcomes of...
Using a social problem of your choice (with the exception of homicide), use TWO of the...
Using a social problem of your choice (with the exception of homicide), use TWO of the theoretical perspectives we have discussed in this course to analyze the problem you have chosen. In your answer, be sure to clearly define what a social problem is, why your topic is considered a social problem based on the criteria, and how each of your chosen perspectives view the problematic condition. Make sure you ground your answer in examples.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT