Users enter (in text boxes) the grams of fat, the grams of carbohydrates, and the grams of protein.

Each gram of fat is nine calories; a gram of protein or carbohydrate is four calories.

How can I write this ?

Thanks