Refactored code to meet assignment requirements

Fixed the casting of int and float. As well as modified if, else if,
and else statement to meet the grading rubric requirements