Creating and maintaining a database.

The program should make use of functions, linked list, structures, arrays, pointers, and
data files (input and output files). It should be able to do the following:
Add record, delete record, update record, Sorting & Searching (on both string and
numbers), triggers, and alert messages among others…

Any program type :

but including the rules above. Come on my frds. rock on this challenge i know you can do it.

SNIP

happygeek commented: interesting new way to say please do my homework for me -2
lexusdominus commented: do your own work, you parasite +0

Recommended Answers

All 9 Replies

#include <stdlib.h>
#include <iostream>
#include <fstream>

using namespace std;

void open()
{
       char data1[50];
  ifstream myfile ("randOutput.txt");
  if (myfile.is_open())
  {
    while (! myfile.eof() )
    {
      myfile.getline (data1, 100);
      cout << data1 << endl;
    }
    myfile.close();
     }
    else cout << "Unable to open file"; 
  system("pause");  
}
void gen_rand()
{
   int  i, seed;
   cout << "\nPlease any integer to Generate Random Numbers: ";
   cin >> seed;     // Reads an integer.
   cin.ignore();
   srand( seed);     
   cout << "\n\n            "
           "RANDOM NUMBERS\n\n";
   std::ofstream cout("randOutput.txt");
   for( i = 1 ; i <= 20 ; ++i)
      cout <<(rand() % 100+1) << endl;
}

int main()
{
    int num;
    cout<<" \n\tPress 1"" For Random Numbers option. \n"
          " \n\tPress 2"" To Show the generated Random Numbers. "
          "\n\n\tOption (1-2): ";
    cin>> num;
    cin.ignore();    
    if(num==1){
               system("cls");
               gen_rand(); // Calling the gen_rand() function
               }
	if(num==2){
               system("cls");
               open();
              }
    if(num==0){   
                  cout << "\n\tERROR!  Please Select An Appropriate Options";
              }
    if(num>=3){    
                  cout <<"\n\tERROR!  Please Select An Appropriate Options";
                }                
    cin.get();
	return 0;
}

I really don't think this belongs here.

Why the unnecessary restrictions? Besides the linked list, you won't get around using all of these anyway and using a linked list should depend on whether a particular implementation you had in mind actually needs it.
Aside from that, it's not really that much of a challenge and especially not fun.
That's the kind of work one has to do every day anyway.

Its a basic step to maintain database not challenging work for any one who have little knowledge of this short off programming so you need read book.
First try your self then if you get any problem then feel free too definitely some kind enough here to help you.
Use code tag to post your code and mention point of your problem rather then simplly leaving your code. Hope you understand

The name of this this post should be, "Challenge, Who will do my homework."

commented: Indeed. +25
commented: Well said +11

it's a challenge for me to defeat a class ruler. he think he is the only god of C++. I wana kill his arrogancy

commented: I imagine a lot of things are a challenge to you... -2

So you're basically asking us to write a piece of code, which you can then hand to your teacher to prove that you're a better coder than he is?

Lol. No.

That sounds like a fun challenge. here is your code:

<<snip>>

this is not a homework forum

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.