Formula to assign value to form entry

Formula to assign value to form entry

I have a form to enter information about client contracts into Zoho Creator. 
I'm trying to create an a formula to automatically assign a number value to to each selectable line in a dropdown.

The field name is input.rating and the following lines are selectable:

A1

A2

A3

A4

A5

B1

B2

B3


I want the formula to assign the values in the second column below when a line selection is made and display it on the form or view.

A1       10

A2         8

A3         6

A4         4

A5         2

B1         4

B2         2

B3         1


Is a formula the correct vehicle for accomplishing this? If so how should the formula read?