
in java Write a class phone that stores
Name (String) and number of friends (String),
Provide appropriate methods
In the main program create an array of at least 10 string objects that hold people’s names and phone numbers. You may make up your own strings, or use the following:
"Alejandra Cruz, 555-1223"
"Joe Looney, 555-0097"
"Geri Palmer, 555-8787"
"Li Chen, 555-1212"
"Holly Gaddis, 555-8878"
"Sam Wiggins, 555-0998"
"Bob Kain, 555-8712"
"Tim Haynes, 555-7676"
"Warren Gaddis, 555-9037"
"Jean James, 555-4939"
"Ron Palmer, 555-2783"
The program should do following
• Display whole phonebook
• Number of all those friends name starting with ‘a’.
• Name of friends with phone numbers starting with 455.
• Number of all those friends name ending with ‘s’.
• Number of friends having “palmer” in name.
• Enter a name or partial name to search for in the array. Any entries in the array that match the string entered should be displayed. For example, if the user enters “Palmer” the program should display the following names from the list:
Geri Palmer, 555-8787
Ron Palmer, 555-2783

Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images

- In python and include doctring: First, write a class named Movie that has four data members: title, genre, director, and year. It should have: an init method that takes as arguments the title, genre, director, and year (in that order) and assigns them to the data members. The year is an integer and the others are strings. get methods for each of the data members (get_title, get_genre, get_director, and get_year). Next write a class named StreamingService that has two data members: name and catalog. the catalog is a dictionary of Movies, with the titles as the keys and the Movie objects as the corresponding values (you can assume there aren't any Movies with the same title). The StreamingService class should have: an init method that takes the name as an argument, and assigns it to the name data member. The catalog data member should be initialized to an empty dictionary. get methods for each of the data members (get_name and get_catalog). a method named add_movie that takes a Movie…arrow_forwardIn Java Write an application that inputs five numbers, each between 10 and 100, inclusive. As each number is read, display it only if it’s not a duplicate of a number already read. Provide for the “worst case,” in which all five numbers are different. Use the smallest possible array to solve this problem. Display the complete set of unique values input after the user enters each new value. Rough output in screenshotarrow_forwardHow Do I code in java? Farm animals : Animal [ ] farmName : String numAnimals : int //calculated controlled variable no setter Farm() //default 10 animals Farm(String) //default 10 animals Farm(int) //size of array Farm(String, int) addAnimal(Animal) : void getFarmName() : String setFarmName(String) : void getAnimal(int) : Animal //return null if index is invalid getNumAnimals() : int //notice no setter… this is a controlled variable getFirstAnimal() : Animal getLastAnimal() : Animal getAnimals() : Animal[ ] printAllDetails() : void // prints Farm attributes followed by Animal attributes as formatted below : // "FarmName: %20s | Number of Animals: %4d | Farm Size: %4d\n" // "Name: %20s | Year of Birth: %4d | Weight: %10.2f | Gender: %c\n" removeAnimal(int) : Animal removeAllAnimals() : void getTotalWeightOfAllAnimals() : double getAverageWeightOfAllAnimals() : double getNumberOfAnimalsAboveWeight(double) : int getNumberOfAnimalsBelowWeight(double) : int…arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY





