Question: Python Plz In the main.py file you will have the main script for this assignment. Here are some additional specifications: Your program should present a

Python Plz In the main.py file you will have the main scriptfor this assignment. Here are some additional specifications: Your program should presentPython Plz

In the main.py file you will have the main script for this assignment. Here are some additional specifications: Your program should present a menu to the user with the following options: o 1. Add a complex number to the collection o 2. Print collection o 3. Add all complex numbers in the collection o 4. Search for a complex number o 5. Exit Option 1 allows the user to create complex numbers to be added to a list. The program should ask the user to enter the real and imaginary parts of a complex number, create a Complex object and add it to a list of complex objects. Option 2 prints the entire list of complex numbers. Option 3 adds all the complex numbers stored in the list and display the result. Option 4 allows the user to search for a complex number to see if it is in the list. Start by asking the user to enter the complex number then display whether the number is in the list or not. If the number is in the list display the index where the number is located. Option 5 allows the user to exit the program. Your program must have the following functions: o validateInteger(): the purpose of this function is to validate a value entered by the user to make sure the value is an integer. This function takes no parameters and it returns an integer value entered by the user. o search(numberList, searchvalue): this function implements linear search. The function receives a list of complex numbers, a complex number to be searched. The function returns the location of the complex number if found in the list, or -1 if not found. Enter the real part: 5 Enter the imaginary part: 7 1. Add a complex number to the collection 2. Print collection 3. Add all complex numbers in the collection 4. Search for a complex number 5. Exit Enter your choice: 2 (1 + li) (2 + 3i) (5 + 7i) 1. Add a complex number to the collection 2. Print collection 3. Add all complex numbers in the collection 4. Search for a complex number 5. Exit Enter your choice: 3 The result is: (8 + 11i)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!