C Programming Absolute Beginner's Guide (3rd Edition)

(Romina) #1

printf("1997: Titanic\n");
printf("1998: Shakespeare in Love\n");
printf("1999: American Beauty\n");
printf("\n\n\n");
break;
} else if (choice2 == 3)
{
printf("\n\nUS Presidents in the 1990s:\n");
printf("1990-1992: George Bush\n");
printf("1993-1999: Bill Clinton\n");
printf("\n\n\n");
break;
} else if (choice2 == 4)
{
exit(1);
} else
{
printf("Sorry, that is not a valid choice!\n");
break;
}
}


// The section for when the user selects the 2000s
case (3):
{
printf("\n\nWhat would you like to see?\n");
printf("1. Baseball\n");
printf("2. The Movies\n");
printf("3. US Presidents\n");
printf("4. Quit\n");


printf("Enter your choice: ");
scanf(" %d", &choice2);


if (choice2 == 1)
{
printf("\n\nWorld Series Champions of ");
printf("the 2000s:\n");
printf("2000: New York Yankees\n");
printf("2001: Arizona Diamondbacks\n");
printf("2002: Anaheim Angels\n");
printf("2003: Florida Marlins\n");
printf("2004: Boston Red Sox\n");
printf("2005: Chicago White Sox\n");
printf("2006: St. Louis Cardinals\n");
printf("2007: Boston Red Sox\n");
printf("2008: Philadelphia Phillies\n");
printf("2009: New York Yankees\n");
printf("\n\n\n");
break;
} else if (choice2 == 2)
{
printf("\n\nOscar-Winning Movies in ");
printf("the 2000s:\n");
printf("2000: Gladiator\n");
printf("2001: A Beautiful Mind\n");
printf("2002: Chicago\n2003: The ");
printf("Lord of the Rings: The ");

Free download pdf