Question

In: Computer Science

In Python 3. Design, implement, and test a network application that maintains an online phonebook. The...

In Python 3. Design, implement, and test a network application that maintains an online phonebook. The data model for the phonebook is saved in a file on the server’s computer. Clients should be able to look up a person’s phone number or add a name and number to the phonebook. The server should handle multiple clients without delays.

Solutions

Expert Solution

def harsh_menu():
print('1. Print avaliable Phone Numbers')
print('2. Add a number and Name into a Phone Book')
print('3. Lookup a Phone Number From a PhoneBook')
print('4. Exit')
print()

Add_numbers = {}
Choose_menu = 0
harsh_menu()
while Choose_menu != 4:
Choose_menu = int(input("Type a number b/w (1-5): "))
if menu_choice == 1:
print("Mobile Numbers:")
for x in Add_numbers.keys():
print("Name: ", x, "\tNumber:", Add_numbers[x])
print()
elif Choose_menu == 2:
print("Add Name and Number inTo a phone Book")
name = input("Name: ")
phone = input("Number: ")
Add_numbers[name] = phone

elif Choose_menu == 4:
print("Lookup a Number From a PhoneBook")
name = input("Name: ")
if name in Add_numbers:
print("The number is", Add_numbers[name])
else:
print(name, "was not found")
elif menu_choice != 4:
harsh_menu()

*****************NOTE*******************

if you like the answer please give positive rating that will directly affect our payskill


Related Solutions

Write a class that maintains the scores for a game application. Implement the addition and removal...
Write a class that maintains the scores for a game application. Implement the addition and removal function to update the database. The gamescore.txt contains player’ name and score data record fields separated by comma. For Removal function, uses the name field to select record to remove the game score record. Use the List.java, LList.java, Dlink.java, GameEntry.java and gamescore.txt found below Read gamescore.txt to initialize the Linked list in sorted order by score. Provide Remove and Add function for user to...
C++Design and implement a program (name it LinearBinarySearch) to implement and test the linear and binary...
C++Design and implement a program (name it LinearBinarySearch) to implement and test the linear and binary search algorithm discussed in the lecture slides. Define method LinearSearch() to implement linear search of an array of integers. Modify the algorithm implementation to count number of comparisons it takes to find a target value (if exist) in the array. Define method BinarySearch() to implement binary search of an array of integers. Modify the algorithm implementation to count number of comparisons it takes to...
Design and implement an application that reads an integer value and prints the sum of all...
Design and implement an application that reads an integer value and prints the sum of all even integers between 2 and the input value, inclusive. Print an error message if the input value is less than 2 and prompt accordingly so that the user can enter the right number. Your program file will be called YourLastNameExamQ2
Java - Design and implement an application that creates a histogram that allows you to visually...
Java - Design and implement an application that creates a histogram that allows you to visually inspect the frequency distribution of a set of values. The program should read in an arbitrary number of integers that are in the range 1 to 100 inclusive; then produce a chart similar to the one below that indicates how many input values fell in the range 1 to 10, 11 to 20, and so on. Print one asterisk for each value entered. Sample...
PYTHON PROBLEM: Goal: Design and implement a Python program to solve the following problem. Scientists measure...
PYTHON PROBLEM: Goal: Design and implement a Python program to solve the following problem. Scientists measure an object’s mass in kilograms and weight in newtons. If you know the amount of mass of an object in kilograms, you can calculate its weight in newtons with the following formula: [Note: Use or test any random numbers to check whether the weight is heavy, can be lifted or light] ????h? = ???? × 9.8 Write a program that asks the user to...
Design and implement a program in python that takes a list of items along with quantities...
Design and implement a program in python that takes a list of items along with quantities or weights. The program should include at least two function definition that is called within the main part of your program. Each item has a price associated by quantity or weight. The user enters the item along with the quantity or weight and the program prints out a table for each item along with the quantity/weight and total price. Your program should be able...
Implement and test a TaskList application in Java that will allow a client to manage information...
Implement and test a TaskList application in Java that will allow a client to manage information about daily tasks.  A task has a task name, is scheduled on a specific day of the week and can have a comment attached to it. Together, the task name and day uniquely identify a task. There may be tasks with the same name scheduled for different days of the week. The application should allow the client to start with an empty TaskList and then...
Design and implement an application that can compute the weekly pay for different students at a college.
In Java Design and implement an application that can compute the weekly pay for different students at a college. Students (all with a name, major, GPA) can be undergraduate or graduate students. Undergraduate students can be volunteers to be tuto rs or teaching assistants. Graduate students can be teaching assistants or research assistants. Volunteer tuto rs are not paid anything. Undergraduate teaching assistants are paid $15 per hour and can work a maximum of 20 hours per week. Graduate teaching assistants...
programing language JAVA: Design and implement an application that reads a sentence from the user, then...
programing language JAVA: Design and implement an application that reads a sentence from the user, then counts all the vowels(a, e, i, o, u) in the entire sentence, and prints the number of vowels in the sentence. vowels may be upercase
A, B:   Design and Implement a C# windows form application to ask the user for 10...
A, B:   Design and Implement a C# windows form application to ask the user for 10 integer numbers, sort them in ascending order and display the sorted list. Use bubble sort technique to sort the array elements and do not use any built-in sort method to sort the array elements.                                                        [02] C:    Test and evaluate your program by inputting variety of values.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT