The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 3 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
FOR PYTHON: Write a function letter2number() that takes a string representing a letter grade as a parameter and returns the grade point associated with that grade. The grade letter will be one of A, B, C, D, or F (upper- or lowercase). It may include a plus or minus after the letter. An A corresponds to a grade point of 4, a B to 3, a C to 2, a D to 1, and an F to 0. A plus increases the base grade point by 0.3 and a minus decreases it by 0.3. There is no such thing as an A+ or an F-. If the user provides a string as an argument that doesn't correspond to a valid grade, the function returns the string 'unknown grade'. You MUST use a dictionary for this problem. Any solution that does not involve a dictionary will not earn full credit. The following shows the function as used on several different arguments:

Hel-----------lo -----------Sir-----------/Ma-----------dam----------- Â----------- -----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------sol-----------uti-----------on.-----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- ca-----------tch-----------