PYTHON PROGRAMMING ONLY PLEASE (MY CODE IS BELOW IS ALREADY CORRECT JUS NEED HELP WITH THE USER INPUTS). Create a program to sort a list of given numbers in ascending order.  For example, if given 2,7,2,4,5,6 the output would be 2, 2, 4, 5, 6, 7 Do not use any libraries for the sort you must create the sort algorithm from scratch or use one of the sort codes we used in class. At the very least your program should: (I mainly need help with this first bullet and the 2 following sub-bullets I have the sort already in the code and my code already prints out the sorted and unsorted list.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

PYTHON PROGRAMMING ONLY PLEASE (MY CODE IS BELOW IS ALREADY CORRECT JUS NEED HELP WITH THE USER INPUTS).

Create a program to sort a list of given numbers in ascending order. 

For example, if given 2,7,2,4,5,6 the output would be 2, 2, 4, 5, 6, 7

Do not use any libraries for the sort you must create the sort algorithm from scratch or use one of the sort codes we used in class.

At the very least your program should:

(I mainly need help with this first bullet and the 2 following sub-bullets I have the sort already in the code and my code already prints out the sorted and unsorted list.)

  • Ask the user if they would like to enter numbers into a list or create a random list.
    • If they choose to enter numbers into a list ask them to enter numbers for the list. (Make sure to tell them how to stop entering numbers ie enter q to stop.)
    • If they choose to create a random list ask them how many numbers they would like in their list.
  • Print the unsorted list to the user.
  • Then print the sorted list to the user.
  • Make sure to use exception handling to save your program from crashing.

 

 

 

 

 


from TimerFile import Timer
from RandListFile import RandList
from SortFile import Sort
from SearchesFile import Search
'''
Describe instances of the classes
'''
#instances of classes
timerInst = Timer()
sortInst = Sort()
searchInst = Search()
randomInst = RandList()

#Original Random List to
randomInst.createRandomList(1000)
randomListToSort = randomInst.getRandList()


'''
User Inputs
'''






'''
Search using some type of Sort
'''

#quickSort
print('--- Quick Sort----')
quickRandomInst = randomListToSort.copy()
quickSortList = randomInst.getRandList()
randomInst.showFirtTenOfList()
timerInst.startTimer()
sortListQuick = sortInst.quick_sort(quickSortList,0,len(quickSortList)-1)
randomInst.showFirtTenOfList()
timerInst.stopTimer()
timerInst.results()
timerInst.resetTimer()
print('--- End Quick Sort----')

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Stack
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education