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

Algorithms

 
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 
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 
#include "iostream"
#include "fstream"
#include "string"
#include "iomanip"
using namespace std;


int main()
{
int i, correct = 0, incorrect = 0;

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++;
}
}

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;
}
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 
GeneralRe: Can someone who is good at math please check my working!? - Differential equation Pin
CPallini22-Apr-08 4:26
mveCPallini22-Apr-08 4:26 
AnswerRe: Can someone who is good at math please check my working!? - Differential equation Pin
CPallini22-Apr-08 4:55
mveCPallini22-Apr-08 4:55 
GeneralRe: Can someone who is good at math please check my working!? - Differential equation Pin
73Zeppelin22-Apr-08 4:57
73Zeppelin22-Apr-08 4:57 

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.