This is a coursework that will create a Fair Grade Allocator. The purpose of the application is to help teams allocate the credit for a project so that all parties are satisfied with the outcome. The...

Just the deliverable 2.


This is a coursework that will create a Fair Grade Allocator. The purpose of the application is to help teams allocate the credit for a project so that all parties are satisfied with the outcome. The main menu and creating a project code has been created which is at the last few pages. Now the code that’s needed is for option V. The code needs to source the number of team members and name of team members from the first part of code and offer the user to input votes. In this deliverable it is essential that you use object oriented (OO) design. You must have: · A Person class · A Project class You must think carefully about what attributes and methods these classes need. You may have additional classes if you think that they are necessary or fit with your design. You must extend your application to collect the votes cast for a project. The dialogue for option ‘V’: Choosing option ‘V’ will allow the user to record the votes for the project. The partial dialogue could look like that shown below. Information entered by the user is underlined: Enter the project name: C1-ENGS101P There are 3 team members. Enter Xiang’s votes, points must add up to 100: Enter Xiang’s points for Asim: 50 Enter Xiang’s points for Bogdan: 50 Enter Bogdan’s votes, points must add up to 100: Enter Bogdan’s points for Xiang: 35 Enter Bogdan’s points for Asim: 65 Press to return to the main menu: _ The rules governing this part of the application are: Choosing option ‘V’ will allow the user to enter the team’s votes for a particular project. Code for the first part is as below: ## # This application is a fair grade allocator based on the work by: # A. Procaccia, J. Goldman, N. Shah and D. Kurokawa. # # Author: Rae Harbird # Date: November 2018 from d2classperson.py import Project import Person ## Constants MINIMUM_NAME_LENGTH = 3 # Used to validate team member's name and project name MAXIMUM_NAME_LENGTH = 10 MINIMUM_TEAM_SIZE = 3 MAXIMUM_TEAM_SIZE = 5 MENU_CHOICES = ['A', 'C', 'V', 'S', 'Q'] ## Prints the menu for the application. # def printMenu(): menuString = ("Welcome to Spliddit:\n" "\tAbout (A)\n" "\tCreate Project (C)\n" "\tEnter Votes (V)\n" "\tShow Project (S) \n" "\tQuit (Q)") print(menuString) ## Prints a description of the application. # # def about() : aboutString = ("\n\nWelcome to Spliddit. " "This application will allocate grades to " "project participants based of the votes of their " "peers.\n") print(aboutString) ## Sets up a project from the information entered by the user. # @return a tuple containing the project name and the names # of team members # def createProject() : projectName = getProjectName() teamSize = getTeamSize() members = getTeamNames(teamSize) return (projectName, members) ## Prompts the user for a project name and validates it. # @return a string containing the project name. # # Invariants: a project name must be between the minimum and maximum length # and cannot be blank. The name must contain only alphabetic # characters. # def getProjectName() : projectName = input("\n\tEnter project name: ") while isValidName(projectName, MINIMUM_NAME_LENGTH, MAXIMUM_NAME_LENGTH) == False : print(("\n\t\tThe project name must be more than {} characters long, " "less than {} characters long and must contain only " "alphabetic characters. Try again.\n") .format(MINIMUM_NAME_LENGTH - 1, MAXIMUM_NAME_LENGTH + 1)) projectName = input("\n\tEnter project name: ") return projectName ## Check the string contains only characters from the alphabet and check that it is the right length. # # @param theString the string to be validated # @minimum the minimum length of the string # @maximum the maximum length of the string # @return True if the string conforms to the validation conditions and False if it does not. # def isValidName(theString, minimum, maximum) : return theString.isalpha() == True \ and len(theString) >= minimum \ and len(theString) <= maximum="" ##="" prompts="" the="" user="" for="" the="" team="" size="" and="" validates="" it.="" #="" @return="" the="" number="" of="" people="" in="" the="" team.="" #="" #="" invariants:="" the="" team="" size="" must="" be="" between="" the="" minimum="" and="" maximum="" size.="" #="" def="" getteamsize()="" :="" teamsize="input("\n\tHow" many="" people="" in="" the="" team:="" ")="" while="" isvalidteamsize(teamsize,="" minimum_team_size,="" maximum_team_size)="=" false="" :="" print(("\n\t\tthe="" team="" size="" must="" be="" more="" than="" {}="" and="" less="" than="" {}.="" "="" "try="" again.").format(minimum_team_size="" -="" 1,="" maximum_team_size="" +="" 1))="" teamsize="input("\n\tHow" many="" people="" in="" the="" team:="" ")="" return="" int(teamsize)="" ##="" checks="" whether="" the="" team="" size="" is="" greater="" than="" or="" equal="" to="" the="" minimum="" size="" #="" and="" less="" than="" or="" equal="" to="" the="" maximum="" size.="" #="" #="" @return="" true="" or="" false.="" #="" def="" isvalidteamsize(size,="" minimum,="" maximum):="" return="" isinteger(size)="" and="" int(size)="">= minimum and int(size) <= maximum="" ##="" checks="" whether="" the="" string="" passed="" as="" a="" parameter="" is="" an="" integer.="" #="" #="" @return="" true="" or="" false.="" #="" def="" isinteger(number)="" :="" try:="" int(number)="" return="" true="" except="" valueerror:="" return="" false="" ##="" gets="" the="" names="" for="" the="" people="" in="" the="" team.="" duplicate="" team="" names="" are="" not="" allowed.="" #="" #="" @return="" a="" list="" containing="" the="" names.="" #="" def="" getteamnames(teamsize):="" teamnames="[]" i="0" while="" i=""><= teamsize: teamname = getpersonname() if teamname not in teamnames: teamnames.append(teamname) i = i + 1 else: print("\n\t\tsorry, you already have a team member called {}, try again." .format(teamname)) return teamnames ## prompts the user for a person's name and validates it. # # @return a string containing the person's name. # # invariants: a person's name must be between the minimum and maximum length # and cannot be blank. the name must contain at least one # alphabetic character and may contain numbers. # def getpersonname() : personname = input("\n\tenter name: ") while isvalidname(personname, minimum_name_length, maximum_name_length) == false : print(("\n\t\tthe name must be more than {} characters long," " less than {} characters long and cannot contain " "numbers or punctuation characters.").format(minimum_name_length - 1, maximum_name_length + 1)) personname = input("\n\tenter name: ") return personname ## validates the option choice. # # @return true or false # # invariants: the option must be a valid choice from menu_choices # def isvalidoption(option): if len(option.strip()) == 0: return false elif option[0].upper() in menu_choices: return true else: return false ## prints the menu, prompts the user for an option and validates the option. # # @return a character representing the option. # def getoption(): option = '*' while isvalidoption(option) == false: printmenu() option = input("\nenter an option: ") return option.upper() ## the menu is displayed until the user quits # def main() : teamsize:="" teamname="getPersonName()" if="" teamname="" not="" in="" teamnames:="" teamnames.append(teamname)="" i="i" +="" 1="" else:="" print("\n\t\tsorry,="" you="" already="" have="" a="" team="" member="" called="" {},="" try="" again."="" .format(teamname))="" return="" teamnames="" ##="" prompts="" the="" user="" for="" a="" person's="" name="" and="" validates="" it.="" #="" #="" @return="" a="" string="" containing="" the="" person's="" name.="" #="" #="" invariants:="" a="" person's="" name="" must="" be="" between="" the="" minimum="" and="" maximum="" length="" #="" and="" cannot="" be="" blank.="" the="" name="" must="" contain="" at="" least="" one="" #="" alphabetic="" character="" and="" may="" contain="" numbers.="" #="" def="" getpersonname()="" :="" personname="input("\n\tEnter" name:="" ")="" while="" isvalidname(personname,="" minimum_name_length,="" maximum_name_length)="=" false="" :="" print(("\n\t\tthe="" name="" must="" be="" more="" than="" {}="" characters="" long,"="" "="" less="" than="" {}="" characters="" long="" and="" cannot="" contain="" "="" "numbers="" or="" punctuation="" characters.").format(minimum_name_length="" -="" 1,="" maximum_name_length="" +="" 1))="" personname="input("\n\tEnter" name:="" ")="" return="" personname="" ##="" validates="" the="" option="" choice.="" #="" #="" @return="" true="" or="" false="" #="" #="" invariants:="" the="" option="" must="" be="" a="" valid="" choice="" from="" menu_choices="" #="" def="" isvalidoption(option):="" if="" len(option.strip())="=" 0:="" return="" false="" elif="" option[0].upper()="" in="" menu_choices:="" return="" true="" else:="" return="" false="" ##="" prints="" the="" menu,="" prompts="" the="" user="" for="" an="" option="" and="" validates="" the="" option.="" #="" #="" @return="" a="" character="" representing="" the="" option.="" #="" def="" getoption():="" option='*' while="" isvalidoption(option)="=" false:="" printmenu()="" option="input("\nEnter" an="" option:="" ")="" return="" option.upper()="" ##="" the="" menu="" is="" displayed="" until="" the="" user="" quits="" #="" def="" main()="">
Nov 23, 2020
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here