Step 1: Define variables.
Let the total number of quizzes be \(n\). Let the sum of Ramesh’s scores in the first \(n-1\) quizzes be \(S\). His last quiz score will be either \(97\) (to just get an (A) or \(70\) Actual scor(E).
Step 2: A-grade condition.
For an A grade, the average must be at least \(90\):
\[
\frac{S + 97}{n} \geq 90.
\]
\[
S + 97 \geq 90n. \hfill (1)
\]
Step 3: B-grade condition with 70.
With a score of \(70\), the average should fall in \([87,89]\):
\[
87 \leq \frac{S + 70}{n} \leq 89.
\]
So,
\[
87n \leq S + 70 \leq 89n. \hfill (2)
\]
Step 4: Use inequalities.
From (1): \(S \geq 90n - 97.\)
From (2): \(87n - 70 \leq S \leq 89n - 70.\)
For consistency:
\[
90n - 97 \leq 89n - 70.
\]
\[
n \leq 27.
\]
Also,
\[
90n - 97 \geq 87n - 70 ⇒ 3n \geq 27 ⇒ n \geq 9.
\]
Step 5: Check \(n=9\).
If \(n=9\):
From (1): \(S \geq 90(9) - 97 = 810 - 97 = 713.\)
From (2): \(87(9)-70 = 713 \leq S \leq 89(9)-70 = 801 - 70 = 731.\)
So \(713 \leq S \leq 731\), which is consistent. Hence \(n=9\).
\[
\boxed{9}
\]