Related questions
Write a program to handle a user's rolodex entries. (A rolodex is a system with tagged cards each representing a contact. It would contain a name, address, and phone number. In this day and age, it would probably have an email address as well.)
Typical operations people want to do to a rolodex entry are:
1) Add entry
2) Edit entry
3) Delete entry
4) Find entry
5) Print all entries
6) Quit
You can decide what the maximum number of rolodex entries is and how long each part of an entry is (name, address, etc.).
When they choose to edit an entry, give them the option of selecting from the current rolodex entries or returning to the main menu — don't force them to edit someone just because they chose that option.
Similarly for deleting an entry. Also don't forget that when deleting an entry, you must move all following entries down to fill in the gap.
If they want to add an entry and the rolodex is full, offer them the choice to return to the main menu or select a person to overwrite.
When they choose the print option, make a nicely formatted table of their current entries (if any).
When they choose to find an entry, go to a submenu:
1) find by Name
2) find by Address
3) find by Phone number
4) find by Email address
5) Return to Main Menu
All of these searches are to be case-insensitive content searches. (In other words, if the rolodex contains a person named Vishal Herrera, they should be found by searches by name of: sh, SH, al h, al H, herrera, HERRERA, etc. as well as of Vishal Herrera.)
Question: Should you print all matches to a search or just the first one?
All menus are to be choosable by both number and capitalized letter(s).
Hint: You'll only have one class — most likely. It might look something like this:
const size_t MAX_NAME = ???,
MAX_STREET = ???,
MAX_TOWN = ???,
MAX_STATE = 3,
MAX_PHONE = 14,
// ...other MAX's...
class RolodexEntry
{
char fname[MAX_NAME], lname[MAX_NAME]; // together or separate?
char street[MAX_STREET], town[MAX_TOWN], state[MAX_STATE];
long zip;
short zip_4;
char phone[MAX_PHONE];
public:
// ...ctor's, accessors, mutators, i/o, equality, etc.
};
Hint: This class should have its own library. Other libraries may also be used for collections of functions (like a generic list searching function? or special string searching functions).
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps
- write java programarrow_forwardPython Algorithms Part 1 – Binary SearchLet's play a little game to give you an idea of how different algorithms for the same problem can have wildly different efficiencies. If I choose an integer from 1 to 16 and ask you to guess what the number is, you can keep guessing numbers until you hit on it. When you guess wrong, I tell you whether you are too high or too low. Once you've guessed the number, think about the technique you used to decide each of your next guesses.If you guessed 1, then 2, then 3, then 4, and so on, until you guessed the right number, you used an approach called "linear search," meaning you guessed the numbers serially and sequentially, as if they were lined up in a row. This is definitely one way to find the mystery number, but it could require as many as 16 guesses. However, you could get lucky, if the number was 1, you’d only need 1 guess. Using a linear search process, on average, you'd need 8 guesses.There is an approach that is more efficient than just...arrow_forwardWrite a program to draw a quiz score histogram. Your program shouldread data from a file. Each line of the file contains a number in the range0-10. Your program must count the number of occurrences of each scoreand then draw a vertical bar chart with a bar for each possible score (0-10) with a height corresponding to the count of that score. For example,if 15 students got an 8, then the height of the bar for 8 should be 15.Hint: Use a list that stores the count for each possible score. An examplehistogram is shown below: o o D D0 1 2 3 4 5 6 7 8 9 10arrow_forward
- implement C# code to create a list of Card objects, add two Card objects to the list, use a loop to flip the cards in the list and print it.arrow_forwardSuppose a file contains student's records with each record containing name and age of a student. Write a program to read these records and display them in sorted order by name. Use C language to write a program.arrow_forwardWrite a java program that will generate a permuterm index from the terms in the files in an input directory. The program should prompt the user for a single directory and find all of the terms (after processing) in each file in it. The program should then find the permutations of each term and store them (keeping track of the original word each permutation comes from). After all of the text files in the directory have been read, the output of the program should display the permutations in sorted order along with the original term. Use the dollar sign as the end of term symbol.arrow_forward
- Find on the internet (or use a camera to take) three different types of images: an indoor scene, outdoor scenery, and a close-up scene of a single object. Write python code to implement an adaptive thresholding scheme to segment the images as best as you can and write a brief summary.arrow_forwardA fast food restaurant is planning to develop a system to process customer’s orders. The system receives food orders from the users, and stores and processes according to the order in which the users placed the orders. The system can remove an order from the list of orders once the order is complete. The system can also display the order which is currently being processed by the employees. The system displays the list of orders as well. The system displays all these options as a menu of choices to a user and performs the operations according to the user’s selection. (Please see the test runs on the next page). Write a program in C/C++ to develop a simple order processing system for the fast-food restaurant. In your program, you must use queue to store and process customer’s orders. Your program must use a linked list to perform the queue operations. Your output format should be as shown in the test runs (see the next page). Your program must contain the following user-defined...arrow_forwardWrite a program to roll dices (use the "rand" function) for 36,000 times and then calculate the number of occurrences of each number (1 to 6) as well as the probability of each number using arrays IN C PROGRAMMING LANGUAGE AND COMMENT EVERY STEP IN DETAILS.arrow_forward
- Text book imageDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationText book imageStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONText book imageDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- Text book imageC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONText book imageDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningText book imageProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education