d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > C Programming Basic! Help! > 3 Questions
Add Reply New Topic New Poll
Member
Posts: 51
Joined: Feb 7 2013
Gold: 0.00
Feb 12 2013 12:52pm
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
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Feb 12 2013 06:12pm
where's the work you put in? can't help you if you can't put in effort. if you're trying to study it for a test, that means you'll prolly have something similar, so i recommend attempting them.
Member
Posts: 4,605
Joined: Sep 15 2011
Gold: 9,464.00
Feb 12 2013 07:17pm
Quote (Xarai @ Feb 12 2013 11:52am)
the sooner I get answers the more I can study


drop your class and find a new major.
Member
Posts: 51
Joined: Feb 7 2013
Gold: 0.00
Feb 13 2013 11:55am
I can see why society is failing -
person 1 asks question
person 2 - dont answer question and nag bitch and troll person 1
Member
Posts: 4,980
Joined: Jan 16 2010
Gold: 0.00
Warn: 20%
Feb 13 2013 12:12pm
Quote (Xarai @ 13 Feb 2013 18:55)
I can see why society is failing -
person 1 asks question
person 2  - dont answer question and nag bitch and troll person 1


I would probably credit society's downfall on person 1, who would rather go ask a third party for a full solution, than use the sources at his disposal to solve the issue himself.
Member
Posts: 1,358
Joined: Dec 30 2012
Gold: 0.10
Feb 13 2013 12:20pm
Quote (Xarai @ Feb 13 2013 09:55am)
I can see why society is failing -
person 1 asks question
person 2  - dont answer question and nag bitch and troll person 1


Lawl
The only person who is failing is you.
Maybe if you payed more attention in class you wouldn't have to come here and expect us to spoon feed code to you.
Member
Posts: 4,605
Joined: Sep 15 2011
Gold: 9,464.00
Feb 13 2013 06:46pm
Quote (Xarai @ Feb 13 2013 10:55am)
I can see why society is failing -
person 1 asks question
person 2  - dont answer question and nag bitch and troll person 1


You're not asking questions though. You're asking for answers.
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll