the sooner I get answers the more I can study
if you could provide solutions and possibly some explanations to help this along
thanks
Quote
3. Create a counting program that prompts the user for three
inputs (shown next) that determine how and what to count.
Store the user’s answers in variables. Use the acquired data to
build your counting program with a for loop and display the
results to the user.
• Beginning number to start counting from
• Ending number to stop counting at
• Increment number
Quote
4. Create a math quiz program that prompts the user for how many
questions to ask. The program should congratulate the player if
he or she gets the correct answer or alert the user of the correct
answer in the event the question is answered incorrectly.
The math quiz program should also keep track of how many
questions the player has answered correctly and incorrectly and
display these running totals at the end of the quiz.
Quote
5. Modify the Concentration Game to use a main menu. The menu
should allow the user to select a level of difficulty and/or quit
the game (a sample menu is shown below). The level of difficulty
could be determined by how many separate numbers the user
has to concentrate on and/or how many seconds the player has
to concentrate. Each time the user completes a single game of
Concentration, the menu should reappear allowing the user to
continue at the same level, at a new level, or simply quit the
game.
1 Easy (remember 3 numbers in 5 seconds)
2 Intermediate (remember 5 numbers in 5 seconds)
3 Difficult (remember 5 numbers in 2 seconds)
4 Quit
This is the concentration game I need help modifying
Quote
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
main()
{
char cYesNo = '\0';
int iResp1 = 0;
int iResp2 = 0;
int iResp3 = 0;
int iElaspedTime = 0;
int iCurrentTime = 0;
int iRandomNum = 0;
int i1 = 0;
int i2 = 0;
int i3 = 0;
int iCounter = 0;
srand(time(NULL));
printf("\nPlay a game of Concentration? (y or n): ");
scanf("%c", &cYesNo);
if (cYesNo == 'y' || cYesNo == 'Y') {
i1 = rand() % 100;
i2 = rand() % 100;
i3 = rand() % 100;
printf("\nConcentrate on the next three numbers\n");
printf("\n%d\t%d\t%d\n", i1, i2, i3);
iCurrentTime = time(NULL);
do {
iElaspedTime = time(NULL);
} while ( (iElaspedTime - iCurrentTime) < 3 ); //end do while loop
system ("cls");
printf("\nEnter each # separated with one space: ");
scanf("%d%d%d", &iResp1, &iResp2, &iResp3);
system("pause");
if ( i1 == iResp1 && i2 == iResp2 && i3 == iResp3 )
printf("\nCongratulations!\n");
else
printf("\nSorry, correct numbers were %d %d %d\n", i1, i2, i3);
system("pause");
} //end if
} //end main function