Click here to Skip to main content
15,921,113 members
Home / Discussions / Algorithms
   

Algorithms

 
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 
I still have not got the program to display the answers whether correct or incorrect. I'm also trying to get user input by typing file name&num so I can read in that file and compare it to the answers. also I will finish it off with a MAXSIZE array in case the exam consists of more than 20 questions. what I need the most is some help with the syntax for the input from user that consists of NameNum.dat . Should I use a pointer that initiates a search? then store it, After that hows the correct way to open it to read and thus use it? I'm okay with the closing it....obviously. oh! and by the way...this is really wierd but anyways, I have some guys in my course and I inquired for some general input it as what I'm doing wrong. I just wanted to Know if my flowchart was close to accurate. Come to find out no one takes time to do them. but they do have their coverpage with source code and printed executed program. I was shown the source code one guy populated. He had the same parenthesis " " in his header file along with the missing variable [i] and a source code that just so happened to have the same executable and declarative statements. what are the odds of that! when I temporally used those statements for my own recognition until I was complete with a properly working lab with the assigned listed names that were provided on the problem page. well anyways I was quite amused and curious to how he thinks he is the only one to utilize constructive peer tutorials. So I will not be using this assignment in my course. I do however want to figure it out. It will not recieve a grade but this piece of work will be one of my finest. thanks for your help in helping me see why people like me (newbie)can be pretty sh*tty. I believe I've moved up one level in an ethical computer community. (willbie)Smile | :)



#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];

i = 0;
Answers >> answer[i];
StudentAnsw >> StudentA[i];

while(Answers.eof() == false)
{
i++;
Answers >> answer[i];
StudentAnsw >> StudentA[i];

}
//return 0;


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

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

cout <<"Question " << (i+1) << " " << endl;

if (StudentA[i] == answer[i])
{
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;
}
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 
GeneralRe: Can someone who is good at math please check my working!? - Differential equation Pin
CPallini22-Apr-08 5:09
mveCPallini22-Apr-08 5:09 
GeneralRe: Can someone who is good at math please check my working!? - Differential equation Pin
MarkB77722-Apr-08 12:54
MarkB77722-Apr-08 12:54 

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.