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

use IE Crow's Foot notation to make an E-R diagram. provide entity names and identifiers for...
use IE Crow's Foot notation to make an E-R diagram. provide entity names and identifiers for each entity, along with all necessary relationships between entities, including minimum and maximum cardinalities A professor wants to use a small database to track information about personal student software use during a course. He would like to store student names and email addresses, the name and installation instructions of each type of software required for the course, and the date each student installed the...
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...
VISUAL BASIC (VB.NET)1. Create a Sub Procedure with a name of your choice and in the...
VISUAL BASIC (VB.NET)1. Create a Sub Procedure with a name of your choice and in the procedure, declare a 2-Dimensinal (2-D) array that can store 15 Integer numbers. Then implement a nested loop that will be used to store any 15 Integer numbers into the 2-D array at runtime (an interactive program). The implementation will be such that the program cannot terminate unless all the inputs provided are integers (user input validation). If you provide an invalid input, you should...
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...
Name and describe the four types of delivery. Give a comparison between two types (your choice)....
Name and describe the four types of delivery. Give a comparison between two types (your choice). Of the two Indicate which you think would enable a speaker to be most effective and tell why or why no? State if you feel it is important for a speaker to rehearse the presentation/speech before delivery; if so state why, if not state why not? In manuscript presentations, speakers read their remarks word for word from a prepared statement. Manuscript speaking is common...
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...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT