ExclamationGuild Attendance Checker Program

Posts 15 of 5 · Page 1 of 1
Guild Attendance Checker Program
#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main()
{
int GuildMember1 = 0;
char answer;

ofstream outFile;
outFile.open("D:\\Attendance.txt");
if (outFile.fail())
{
cout << "Error opening \"Attendance.txt\" for output.\n";

return 1;
}
cout<< "Welcome to Attendance Checker Version 0.01 \n";
cout<<"Is GuildMember1 present? y/n.\n";
cin >> answer;
if (answer == 'y')
{
GuildMember1=0;
}
else if (answer == 'n')
{
GuildMember1= GuildMember1+1;
} else {
std::cout << "Invalid answer '" << answer << "'" << std::endl;
}
cout<< " Absent Counters = "<<GuildMember1<<"\n";

cout<< " Finished Checking Attendance.\n";

cout<< "Text file saved in D:\\Attendance.txt\n";

cout<< " Thank you for using Uxhal Attendance Checker 0.01\n";

outFile << "GuildMember1's Name = "<<GuildMember1<<" \n";

outFile.close();
system("PAUSE");
return 0;
}

Hi guys! I'm trying to create a program in C++ that helps me check our Guild's attendance. xD
I want to ask for some help and tips on what to do..


My Thoughts:
  • It's a bit complicated (my real code that is) since there are a lot of type "int" which is used to determine the value of the Guild Member.
  • I tried using Array to read and edit the values, but I never got the gist of it ._.



My Questions :
  • How do I edit the text file straight from the program? like grab the Absent Counter value and edit it. o.o
  • Is there a way to do this online? I mean.. the program grabs the names and their counters from a certain website which contains the text file? if so how? :O


Plans/Ideas/Thoughts about my program :
  • If you are absent you get 1 Absent Counter.
  • If you are present your Absent Counters reset to 0.
  • If your Absent Counters reach 5 you will be Terminated.
  • If your Absent Counters reach 4 you will recieve a Warning.

NOTE :
  • I would kindly accept any aid you may give.
  • I am not sure whether I am in the right thread to post this or not.
  • I am not that good with C++ so please be gentle, I would be very delighted if you would help.
Code:
string WordList[512];
void LoadWordList(char *ListLocation)
{
	ifstream myFile;
	myFile.open(ListLocation);

	if(myFile.is_open())
	{
		while(!myFile.eof())
		{
			getline(myFile, tempString);
			WordList[Index] = tempString;
		}
	}
}
This should help you!
It's from one of my school-projects
Quote Originally Posted by flameswor10 View Post
Code:
string WordList[512];
void LoadWordList(char *ListLocation)
{
	ifstream myFile;
	myFile.open(ListLocation);

	if(myFile.is_open())
	{
		while(!myFile.eof())
		{
			getline(myFile, tempString);
			WordList[Index] = tempString;
		}
	}
}
This should help you!
It's from one of my school-projects

Wahhh!!! Thanks so much for the reply and aid! XD
... but.. uhmm... sorry for the noobish question but..



what does it do?
Quote Originally Posted by Yuudoku View Post
Wahhh!!! Thanks so much for the reply and aid! XD
... but.. uhmm... sorry for the noobish question but..



what does it do?
It goes through the file you want to load line by line then stores it into the string array.
You can use this to check who's attended the clan or not by using an if statement while loading.

To Edit it, you can use another loop to go thorough the already loaded array and do your checks through there.
If you want, I can make an example in my spare time
Quote Originally Posted by flameswor10 View Post
It goes through the file you want to load line by line then stores it into the string array.
You can use this to check who's attended the clan or not by using an if statement while loading.

To Edit it, you can use another loop to go thorough the already loaded array and do your checks through there.
If you want, I can make an example in my spare time
Ohh.. XD thanks for the explanation.. I get it a little.. but don't know how it's done ^^, sorry.. (I'm a noob in programming ._.)
I would be delighted if you could
Posts 15 of 5 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?