Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
another problem :)
#1
First I will say thanks in advance for all your help so far.
Here is the assignment

For remote access, it’s often better to use a Command Line Interface (CLI), rather than a Graphical User Interface (GUI). A CLI does not use a mouse. However, a program can interact with the user via a menu driven interface. In this assignment, you will implement a menu driven interface for maintaining a list of scores. You will also validate user input to make sure that the score entered is within an acceptable range.

Your program should provide a menu driven interface in which the user can do the following:

Choose to exit
Choose to display the scores from highest to lowest values.
Choose to add a score to the list. Note that scores must be floating point numbers.
Choose to display the highest and lowest scores.

Your program should demonstrate secure software best practices as follows:

Create a list with three initial values: 85.3, 85.2 and 21.99.
Use the if/else construct to ensure that new scores entered by the user are between 0.0 and 100.0.
To get the highest and lowest score, sort the list and use indexing. Use the len() function to get the number of items in the list and then subtract 1 to get the index of the last item in the list.
Provide the user with useful information. If the score entered is outside of the range, let the user know if the score is too high or if it's too low. If the user enters an invalid menu selection, let her/him know what's wrong.
Use the print format specifier to set the number of digits to the right of the decimal point to two for the scores displayed.
Your program should include header comments at the top of the file that specify your name, the date, the name of the assignment and the course identifier.

OK this is what I have so far. I wanted to get the frame work finished first to ensure it functioned properly before I got it to add scores.
menu = """
1: Enter to exit
2: List scores so far
3: Add a score
4: Display the highest and lowest scores
"""
List = ["85.3, 85.2, 21.99"] 
done = False

while not done:
    print (menu)

    selection = input ("Please enter menu item 1-4: ")

    if selection == "1":
        done = True
        print("Thank you for using The score engine")
    elif selection == "2":
        
        print("Scores recorded so far:")
    elif selection == "3":
        print("Please enter a score between 0 and 100:")
        
    elif selection == "4":
        print("Score engine highest to lowest:")
    else:
        print("{} is not a valid entry.".format(selection))
        print()
I am unsure how to get it to record input score and add it to my list of scores and how to sort from higher to lower.
Reply


Messages In This Thread
another problem :) - by raymond2688 - Aug-02-2019, 06:02 PM
RE: another problem :) - by Yoriz - Aug-02-2019, 06:15 PM
RE: another problem :) - by raymond2688 - Aug-02-2019, 07:08 PM
RE: another problem :) - by ichabod801 - Aug-02-2019, 06:29 PM
RE: another problem :) - by Yoriz - Aug-02-2019, 07:16 PM
RE: another problem :) - by raymond2688 - Aug-02-2019, 07:42 PM
RE: another problem :) - by Yoriz - Aug-02-2019, 07:47 PM
RE: another problem :) - by ichabod801 - Aug-02-2019, 08:02 PM
RE: another problem :) - by raymond2688 - Aug-02-2019, 09:15 PM
RE: another problem :) - by raymond2688 - Aug-03-2019, 01:42 PM
RE: another problem :) - by ichabod801 - Aug-03-2019, 02:09 PM
RE: another problem :) - by raymond2688 - Aug-03-2019, 02:42 PM
RE: another problem :) - by raymond2688 - Aug-03-2019, 02:15 PM
RE: another problem :) - by ThomasL - Aug-03-2019, 02:38 PM
RE: another problem :) - by ichabod801 - Aug-03-2019, 03:35 PM
RE: another problem :) - by Yoriz - Aug-03-2019, 03:42 PM
RE: another problem :) - by raymond2688 - Aug-03-2019, 05:23 PM
RE: another problem :) - by raymond2688 - Aug-03-2019, 08:32 PM
RE: another problem :) - by ichabod801 - Aug-03-2019, 09:03 PM
RE: another problem :) - by raymond2688 - Aug-03-2019, 10:21 PM
RE: another problem :) - by ichabod801 - Aug-03-2019, 10:28 PM
RE: another problem :) - by raymond2688 - Aug-04-2019, 08:26 PM
RE: another problem :) - by ichabod801 - Aug-04-2019, 09:08 PM
RE: another problem :) - by raymond2688 - Aug-05-2019, 01:18 AM
RE: another problem :) - by ichabod801 - Aug-05-2019, 01:41 AM
RE: another problem :) - by raymond2688 - Aug-05-2019, 02:16 AM
RE: another problem :) - by ichabod801 - Aug-05-2019, 01:37 PM
RE: another problem :) - by raymond2688 - Aug-05-2019, 03:38 PM
RE: another problem :) - by anagarcia - Aug-22-2019, 10:02 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020