visual c++ - saving data into a file c++ -


I have a hard time doing this, it's like a survey, people have 5 questions and answers If you have to answer (data) in a file.txt file, then the program has to read the data. Then, on saying that the user has responded to A. for the first question that the number of people in the survey has been answered. (20/100) This is the same with the other 5 questions but I do not like It does not know how the program counts how many people take surveys and how they store answers in a file. help please!

  int Question = 1; Four answers; For {int i = 0; i & lt; question; i ++} {cout & lt; & Lt; "\ T1 - What kind of phone do you prefer?" & Lt; & Lt; Endl; Cout & lt; & Lt; "\ N"; Cout & lt; & Lt; "Ta Ta) iPhone B) Android C) Windows D) Other" & lt; & Lt; Endl; Cout & lt; & Lt; "\ N"; Cout & lt; & Lt; "\ T Response:"; Cin & gt; & Gt; To answer; Cout & lt; & Lt; "\ N"; Cout & lt; & Lt; "\ T2 - What is your favorite taste?" & Lt; & Lt; Endl; Cout & lt; & Lt; "\ N"; Cout & lt; & Lt; "Ta Ta) Chocolate B) Vanilla c) Strawberry D) Other" & lt; & Lt; Endl; Cout & lt; & Lt; "\ N"; Cout & lt; & Lt; "\ T Response:"; Cin & gt; & Gt; To answer; Cout & lt; & Lt; "\ N"; Cout & lt; & Lt; "\ T3 - What's your favorite sport?" & Lt; & Lt; Endl; Cout & lt; & Lt; "\ N"; Cout & lt; & Lt; "\ T) Basketball b) Baseball C) Hockey D) Football" & lt; & Lt; Endl; Cout & lt; & Lt; "\ N"; Cout & lt; & Lt; "\ T Response:"; Cin & gt; & Gt; To answer; Cout & lt; & Lt; "\ N"; Cout & lt; & Lt; "\ T4 - What's your favorite animal?" & Lt; & Lt; Endl; Cout & lt; & Lt; "\ N"; Cout & lt; & Lt; "Ta Ta) cat b) dog c) bird d) other" & lt; & Lt; Endl; Cout & lt; & Lt; "\ N"; Cout & lt; & Lt; "\ T Response:"; Cin & gt; & Gt; To answer; Cout & lt; & Lt; "\ N"; Cout & lt; & Lt; "\ T5 - What is your favorite season of the year?" & Lt; & Lt; Endl; Cout & lt; & Lt; "\ N"; Cout & lt; & Lt; "Ta Ta) Summer b) Winter C) Spring D) Autumn" & lt; & Lt; Endl; Cout & lt; & Lt; "\ N"; Cout & lt; & Lt; "\ T Response:"; Cin & gt; & Gt; To answer; Cout & lt; & Lt; "\ N"; } System ("pause"); Return 0; 

First hit:

It should answer all your questions on it.

Brief framework:

You can handle the file as a cot. Open it and you write the file on the output stream.

Reading is also described there.

But: It seems that there really is no solution in your mind. Write a step by step description of the whole process in your natural grief. Note where in the file should be written so that you can read it later. It can also be useful that the work is a little clearer.

Did you see the downwots? You got them because you could solve it with googling 5secs, the description of your problem was very unclear and you requested help (we are here to help).

I recommend you read this:


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -