Click here to Skip to main content
16,019,435 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: HI ALL Pin
Roger Wright28-Apr-08 5:56
professionalRoger Wright28-Apr-08 5:56 
GeneralRe: HI ALL Pin
johnzfrebbies@28-Apr-08 14:51
johnzfrebbies@28-Apr-08 14:51 
QuestionRe: HI ALL Pin
David Crow28-Apr-08 6:20
David Crow28-Apr-08 6:20 
GeneralRe: HI ALL Pin
johnzfrebbies@28-Apr-08 15:03
johnzfrebbies@28-Apr-08 15:03 
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 
sorry about that.Unsure | :~ I was in the process of working it out and not expecting a full blown finished product by any means. any ways thanks for pointing that out. heres what I have so far..... I can' t get my files to read in and compare.



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


int main()
{
int i, correct = -1, incorrect = -1;

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



char StudentA[20], answer[20];

cout << "\t\t\tTHESE ARE YOUR RESULTS.\n";

for(i = 0; i < 20; i++)
{

cout <<"Question " << (i+1) << " " << endl;
Answers >> answer[i];
StudentAnsw >> StudentA[i];
if(StudentA[i] == answer[i])
{
//Answers >> answer;
//StudentAnsw >> StudentA;
cout << " Was answered correctly.\n";
correct++;
}
else
{
cout << StudentA[i] << " is an incorrect choice.\n";
incorrect++;
}
}

correct = correct++;
incorrect = incorrect++;
cout << "\t\t\tYou answered " << correct << " questions correctly.\n";
cout << "\t\t\tYou answered " << incorrect << " questions incorrectly.\n";

if (correct >= 15)
{
cout << "\n\t\t\tCONGRATUATIONS! \n\t\t\t\tYOU HAVE PASSED THE DRIVER'S LICENSE TEST.\n\a\a";

cout << "\t\t\t\tDON'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";
}
system("pause");
StudentAnsw.close();
Answers.close();
return 0;
}
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 
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 

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.