Click here to Skip to main content
15,901,426 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: HI ALL Pin
David Crow29-Apr-08 3:36
David Crow29-Apr-08 3:36 
GeneralRe: HI ALL Pin
johnzfrebbies@29-Apr-08 15:35
johnzfrebbies@29-Apr-08 15:35 
GeneralRe: HI ALL Pin
73Zeppelin28-Apr-08 22:02
73Zeppelin28-Apr-08 22:02 
GeneralRe: HI ALL Pin
johnzfrebbies@29-Apr-08 15:27
johnzfrebbies@29-Apr-08 15:27 
QuestionRe: HI ALL Pin
David Crow29-Apr-08 16:32
David Crow29-Apr-08 16:32 
AnswerRe: HI ALL Pin
johnzfrebbies@29-Apr-08 16:42
johnzfrebbies@29-Apr-08 16:42 
AnswerRe: HI ALL Pin
73Zeppelin29-Apr-08 20:21
73Zeppelin29-Apr-08 20:21 
GeneralRe: HI ALL Pin
johnzfrebbies@30-Apr-08 2:06
johnzfrebbies@30-Apr-08 2:06 
I don't under stand what I'm doing wrong?..please advise

#include "iostream"
#include "fstream"
#include "string"
#include "iomanip"
using namespace std;


int main()
{
int i;
//int x;
int correct;
int incorrect;

ifstream StudentAnsw;
ifstream Answers;
StudentAnsw.open("C:\\driversexam.dat");
Answers.open("C:\\Answers.dat");

char StudentA[20];
char answer[20];

cout << "THESE ARE YOUR RESULTS.\n";
correct = 0;
incorrect = 0;

for(i = 0; i < 20; i++)
{
cout <<"Question " << (i+1) << " " << endl;
Answers >> answer[i];
StudentAnsw >> StudentA[i];
if (StudentA == answer)
{
cout << " " << " Is a correct answer." << endl << endl;
correct++;
}
else
{
cout << " " << " Is a incorrect choice." << endl;
incorrect++;
}


}
system("pause");
system("CLS");
cout << "You answered " << correct << " questions correctly.\n";
cout << "You answered " << incorrect << " questions incorrectly.\n";

if (correct >= 15)
{
cout << "\nCONGRATUATIONS! \nYOU HAVE PASSED THE DRIVER'S LICENSE TEST.\n";
cout << "DON'T DRINK AND DRIVE" << endl;
}
else
{
cout << "\nSorry. You FAILED! the Driver's License Exam.\n";
cout << "\nYou need 15 correct answers to pass the exam.\n";
cout << "\nPlease Study and stay of the road. \n";
}
StudentAnsw.close();
Answers.close();
return 0;
}
GeneralRe: HI ALL Pin
David Crow30-Apr-08 3:08
David Crow30-Apr-08 3:08 
AnswerRe: HI ALL Pin
73Zeppelin30-Apr-08 3:19
73Zeppelin30-Apr-08 3:19 
AnswerRe: HI ALL Pin
johnzfrebbies@29-Apr-08 16:43
johnzfrebbies@29-Apr-08 16:43 
GeneralRe: HI ALL [modified] Pin
73Zeppelin29-Apr-08 20:02
73Zeppelin29-Apr-08 20:02 
GeneralRe: HI ALL Pin
johnzfrebbies@30-Apr-08 11:28
johnzfrebbies@30-Apr-08 11:28 
AnswerRe: HI ALL Pin
73Zeppelin1-May-08 0:11
73Zeppelin1-May-08 0:11 
GeneralRe: HI ALL Pin
johnzfrebbies@1-May-08 8:32
johnzfrebbies@1-May-08 8:32 
GeneralRe: HI ALL Pin
73Zeppelin1-May-08 9:08
73Zeppelin1-May-08 9:08 
GeneralRe: HI ALL Pin
johnzfrebbies@1-May-08 18:49
johnzfrebbies@1-May-08 18:49 
GeneralRe: HI ALL Pin
73Zeppelin2-May-08 22:06
73Zeppelin2-May-08 22:06 
QuestionCan someone who is good at math please check my working!? - Differential equation [modified] Pin
MarkB77722-Apr-08 3:58
MarkB77722-Apr-08 3:58 
AnswerRe: Can someone who is good at math please check my working!? - Differential equation Pin
73Zeppelin22-Apr-08 4:09
73Zeppelin22-Apr-08 4:09 
GeneralRe: Can someone who is good at math please check my working!? - Differential equation Pin
MarkB77722-Apr-08 4:18
MarkB77722-Apr-08 4:18 
AnswerRe: Can someone who is good at math please check my working!? - Differential equation Pin
73Zeppelin22-Apr-08 4:15
73Zeppelin22-Apr-08 4:15 
GeneralRe: Can someone who is good at math please check my working!? - Differential equation Pin
MarkB77722-Apr-08 4:22
MarkB77722-Apr-08 4:22 
AnswerRe: Can someone who is good at math please check my working!? - Differential equation Pin
CPallini22-Apr-08 4:20
mveCPallini22-Apr-08 4:20 
GeneralRe: Can someone who is good at math please check my working!? - Differential equation Pin
MarkB77722-Apr-08 4:23
MarkB77722-Apr-08 4:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.