Assignment 1: Fractions Consider the following code, which implements a very simple 4-function calculator: float n1, n2; char op; while (cin >> n1 >> op >> n2) { switch (op)…