I am trying to get practice on loops and switch statements and trying to figure out the following issue.
The output depends on the integer day
value.
For example if the user enters 8
then it will print the first 8 lines as follows:
On the 8th day of holidays, I did Eight jumping jacks,
....
...
On the 3rd day of holidays, I did Three pull downs,
...
..
On the 1st day of holidays, I did One downhill sprint.
So to solve this problem, I have used a switch statement in a for
loop and then wanted to use another switch statement to put the appropriate suffix for the day number. Eg: 1st, 2nd etc
I have done the following but I am stuck badly and would really appreciate if they can help me out.
int day = in.nextInt();
for (int i = 0; i < day; i++) {
switch (day) {
// Also, do I add another switch statement here for suffix?
}
}