Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
thumb_up100%
A personal phone directory contains room for first names and phone numbers for 30 people. Assign names and phone numbers for the first 10 people. Prompt the user for a name, and if the name is found in the list, display the corresponding phone number. If the name is not found in the list, prompt the user for a phone number, and add the new name and phone number to the list.
Continue to prompt the user for names until the user enters quit. After the arrays are full (containing 30 names), do not allow the user to add new entries.
Use the following names and phone numbers:
Name | Phone # |
---|---|
Gina | (847) 341-0912 |
Marcia | (847) 341-2392 |
Rita | (847) 354-0654 |
Jennifer | (414) 234-0912 |
Fred | (414) 435-6567 |
Neil | (608) 123-0904 |
Judy | (608) 435-0434 |
Arlene | (608) 123-0312 |
LaWanda | (920) 787-9813 |
Deepak | (930) 412-0991 |
import java.util.*;
class PhoneNumbers {
public static void main(String[] args) {
// Write your code here
}
}
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- In visual basic Write the code that will sequentially search through the array strFirstNames and will print out the word "Found" if the name "Brian" is in the array.arrow_forwardPlease help with the question on the picturearrow_forwardCreate a game similar to Hangman named GuessAWord in which a player guessesletters to try to replicate a hidden word. Store at least eight words in an array, andrandomly select one to be the hidden word. (The statements needed to generate arandom number are shown in the Exercises in the “Decision Making” and “Looping”chapters.) Initially, display the hidden word using asterisks to represent each letter.Allow the user to guess letters to replace the asterisks in the hidden word until theuser completes the entire word. If the user guesses a letter that is not in the hiddenword, display an appropriate message. If the user guesses a letter that appears multipletimes in the hidden word, make sure that each correct letter is placed. Figure 6-27shows typical games in progress in a console-based application and in a GUIapplication. In the GUI application, the user has successfully guessed e, and is about toguess r. Hint: If you create the GUI version of the game, you might want to include…arrow_forward
- You have FOUR people selling 5 different kinds of flowers, so instead of a 4 by 4 array you had in the video (4 rows and 4 columns) you now have a 4 by 5 array (4 rows and 5 columns ) You may either use the names I had in the video or choose your own. Instead of Brownies, you have flowers - petunia, pansy, rose, violet, and carnation. Use a random number generator to generate the numbers of flowers sold, print out all the data as I did in the video. The output should look like this: (numbers will vary because they are randomly generated) petunia pansy rose violet carnationFrankie 5 3 11 3 16 Janet 0 11 11 20 6 Sam 14 16 17 15 1 Abbie 8 20 0 6 8 Frankie sold 38 flowersJanet sold 48 flowersSam sold 63 flowersAbbie sold 42 flowers Total number of petunias sold: 27Total number of pansies…arrow_forward# Create Custom Transformer Create a custom transformer, just as we did in the lecture video entitled "Custom Transformers", that performs two computations: 1. Adds an attribute to the end of the numerical data (i.e. new last column) that is equal to $\frac{x_1^3}{x_5}$ for each observation. In other words, for each instance, you will cube the $x_1$ column and then divide by the $x_5$ column. 2. Drops the entire $x_4$ feature column if the passed function argument `drop_x4` is `True` and doesn't drop the column if `drop_x4` is `False`. (See further instructions below.) You must name your custom transformer class `Assignment4Transformer`. Your class should include an input parameter called `drop_x4` with a default value of `True` that deletes the $x_4$ feature column when its value is `True`, but preserves the $x_4$ feature column when you pass a value of `False`. This transformer will be used in a pipeline. In that pipeline, an imputer will be run *before* this transformer. Keep…arrow_forwardThe Fibonacci numbers are 0, 1, 1, 2, 3, 5, 8, 13, ... where each number (after the first two values) is the sum of the previous two numbers. Write a program that declares an integer array called fib_numbers with a length of 25 elements. The program then fills the array with the first 25 Fibonacci numbers using a loop. The program then prints the values to the screen using a separate loop.arrow_forward
- Array a is an integer array with all the elements in ascending order. The element at position 15 is the 15th largest and also the 15th smallest. You can assume integers are 4 bytes long. How many bytes are there in the array? O 116 124 O None of the other answers is correct. 120arrow_forwardThe Chat-A-While phone company provides service to six area codes and charges the per-minute rates for phone calls shown in Figure 6-25 (below). Write a program named ChatAWhile that stores the area codes and rates in parallel arrays and allows a user to enter an area code and the length of time for a call in minutes, and then display the total cost of the call. For example if the area code is in the array, such as 715, and the call length is 22 minutes, the output should be: Your phone call to area 715 costs $0.16 per minute For 22 minutes the total is $3.52 If the area code is not in the array, such as 111, the program should not accept a call length, and instead output Sorry - no calls allowed to area 111. Area Code Per-Minute Rate ($) 262 0.07 414 0.10 608 0.05 715 0.16 815 0.24 920 0.14 Figure 6-25 Per-minute phone call rates In order to prepend the $ to currency values, the program will need to use the CultureInfo.GetCultureInfo method. In order to do this,…arrow_forwardCreate an array of three string values that the fullName variable will use as a point of reference. Make an initialization list for the array using string values for the first, middle, and last names.arrow_forward
- Create an array of three string values that the fullName variable will use as a point of reference. Make an initialization list for the array using string values for the first, middle, and last names.arrow_forwardCan you write it in Java, add comments Create an application containing an array that stores eight integers. Prompt the user to enter the 8 integers. The application should call five methods that in turn (1) display all the integers, (2) display all the integers in reverse order, (3) display the sum of the integers, (4) display all values less than the calculated average value, and (5) display all values that are higher than the calculated average value. Save the file as ArrayMethodDemoarrow_forwardIn this project you will generate a poker hand containing five cards randomly selected from a deck of cards. The names of the cards are stored in a text string will be converted into an array. The array will be randomly sorted to "shuffle" the deck. Each time the user clicks a Deal button, the last five cards of the array will be removed, reducing the size of the deck size. When the size of the deck drops to zero, a new randomly sorted deck will be generated. A preview of the completed project with a randomly generated hand is shown in Figure 7-50.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education