Suh 123 Database
Suh 123 Database
#include <fstream>
#include <iostream>
#include <stdio.h>
#include <string.h>
int main()
{
// be 15.
char data[15];
ifstream f("Example.txt");
string line;
count_n++;
while (option != 6) {
// DB
"Students\n2."
if (option == 1) {
cin >> n;
count_n = count_n + n;
ofstream outfile;
outfile.open("Example.txt", ios::app);
// stored line-by-line.
len = len + 1;
// file
else if (option == 2) {
char regno[9];
ifstream infile;
int check = 0;
infile.open("Example.txt", ios::in);
if (strcmp(data, regno) == 0) {
cout
<< endl;
<< endl;
<< endl;
infile >> data;
infile.close();
check = 1;
if (check == 0) {
<< endl;
// database of a student.
else if (option == 3) {
char subcode[7];
mark = "";
ifstream infile;
int check = 0;
"about marks\n"
if (option == 1) {
cout
<< "Warning! You would need to add mark"
<< endl;
fstream file("Example.txt");
// lengths of data.
if (strcmp(subcode, code1.c_str())
== 0) {
file.seekp(26 + 37 * i,
std::ios_base::beg);
file.write(mark.c_str(), 2);
}
if (strcmp(subcode, code2.c_str())
== 0) {
file.seekp(29 + 37 * i,
std::ios_base::beg);
file.write(mark.c_str(), 2);
}
}
else if (option == 2) {
infile.open("Example.txt", ios::in);
if (strcmp(subcode, code1.c_str()) == 0) {
<< endl;
check = 1;
infile.close();
infile.open("Example.txt", ios::in);
if (strcmp(subcode, code2.c_str()) == 0) {
<< endl;
check = 1;
infile.close();
if (check == 0) {
<< endl;
else if (option == 4) {
char procid[7];
int check = 0;
ifstream infile;
infile.open("Example.txt", ios::in);
if (strcmp(id, procid) == 0) {
<< endl;
<< endl;
check = 1;
if (check == 0) {
else if (option == 5) {
char password[25];
if (strcmp(password, admin_pass.c_str()) == 0) {
"\tName\tCSE1001\tCSE1002\tProctor "
"ID"
<< endl;
ifstream infile;
infile.open("Example.txt", ios::in);
char data[20];
}
}