hey there guys! I really need help...
so, I need a program that reads some specific lines and prints other ones from a file. also, i need to compare an input with another specific lines from a file. I have a written file with information for playing a little game. on the 1st line I have a char 'e', 'm' or 'h' wich matches the difficulty the user chose previously (easy, medium or hard). the 2nd line has a math question, the 3rd has the correct answer for it, and the 4th has a letter 'I', 'P', 'C' or 'A' wich i have to return to the user only if he aswers correctly. In every 4 lines I have the information regarding each question.
So, I need to only show the questions that match the chosen difficulty, then I need to compare the user answer with the correct one and if he answers correctly, I return the corresponding letter. I also need to store the correct user's answers so that I stop the game whenever he reaches the word "IPCA", so he will need to answer the questions with the matching letters. Until the user doesn't get all the letters, the questions keep going. Please, I really need this!
so, I need a program that reads some specific lines and prints other ones from a file. also, i need to compare an input with another specific lines from a file. I have a written file with information for playing a little game. on the 1st line I have a char 'e', 'm' or 'h' wich matches the difficulty the user chose previously (easy, medium or hard). the 2nd line has a math question, the 3rd has the correct answer for it, and the 4th has a letter 'I', 'P', 'C' or 'A' wich i have to return to the user only if he aswers correctly. In every 4 lines I have the information regarding each question.
So, I need to only show the questions that match the chosen difficulty, then I need to compare the user answer with the correct one and if he answers correctly, I return the corresponding letter. I also need to store the correct user's answers so that I stop the game whenever he reaches the word "IPCA", so he will need to answer the questions with the matching letters. Until the user doesn't get all the letters, the questions keep going. Please, I really need this!