Here is the full description of the assignment:

  • The flashcards will be group into boxes A, B and C according to the flow as follows.
  1. From the selection screen, user chooses to start
  2. The program randomly shows a flashcard (either side, randomly) and the user guesses the other side (no input required)
  3. After guessing, the user selects to show the other side
  4. If correct, the user promotes the flashcard to box A. If incorrect, the user promotes the flashcard to box C. If the user is unsure or almost close to the correct one, the user promotes the flashcard to box B. The promotion is based on honest user input
  5. After the user goes through all the flashcards, the program gives the user's score and stores it with its corresponding date and time.
  6. From the selection screen, the user gets an option to redo the flashcards in box B and C as done in item 2 to 4
  7. The score gets recomputed and then displayed with previous score(s) after a single process in item 6 has been completed.
  • Boxes A, B and C are initially empty with the option that the user could empty them at the selection if they contain flashcards
  • Put a selection screen to show the stored scores and their corresponding date and time
  1. Score = number of flashcards in box A / total number of flashcards
  • A selection screen option for saving and loading the following:
  1. Scores (1 text file)
  2. Content of each box (3 text files)
  • The flashcards are biblical passages (reference at one side and passage content at the other)

Here is my starting random program:
Code:
#include<stdio.h>  
#include <conio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

int getNextNum(){
  static int list[9];
  static int size = -1;
  if (size==-1){
    size=9;
    for(int i=0;i<size;i++){ 
      list[i]=i+1;
      }
    }
  if(size==0){
    return 0;
    }
  int index=rand()%size;
  int num=list[index];
  size--;
  list[index] = list[size];
  return num;
}


int main(){
  const time_t timer=time(NULL);
  printf("%s\n",ctime(&timer));
  
  srand( time(NULL));
  int z;
  for(int i=0;i<9;i++){
    z=getNextNum();
    printf("Random Number: %d\n",z);
    }
  getche();
}

Last edited by askmewhy25; 18Mar2010 at 20:58..