Results 1 to 5 of 5
  1. #1

    Default Anyone know about C++ programming (computer-related)

    Hey I'm working on this program thats already a little late so I'm getting desperate =\ Anyways It involves having a file open and I'm trying to figure out how to delete an entry from that file A file entry format is 1. Artifact Name 2. Month 3. Year 4. Owner's Name
    If I could get some help, that would be amazing right about now!

    This is what I have:

    #include<iostream>
    #include<string>
    #include<fstream>
    const int ART_ARRAY_SIZE = 31;
    art artifact[ART_ARRAY_SIZE];
    using namespace std;
    struct art
    {
    string name;
    string month;
    int year;
    string fName;
    string lName;

    **;
    void View(int artifact[], int ART_ARRAY_SIZE);
    void Search(int , int );
    void Add(int, int);
    void Delete(int, int));
    void Quit();
    int main()
    {


    string temp;
    char menu;
    int i=0;

    cout<<"Please select a file to open: "<<endl;
    inFile.open("ArtFile.txt");
    getline(inFile, sentence, '#');
    ifstream inFile;
    while(!inFile.eof())
    getline(inFile,artifact[i].name, '\n');

    getline(inFile,artifact[i].month, '\n');

    getline(inFile,temp, '\n');
    artifact[i].year = atoi(temp.c_str());

    getline(inFile,artifact[i].fName, '\n');

    getline(inFile,artifact[i].lName, '\n');
    **

    cout<<endl<<endl;
    cout<<"Artifact:"<<endl;
    cout<<artifact.name<<endl;
    cout<<artifact.month<<" "<<artifact.year+10<<endl;
    cout<<artifact.fName<<" "<<artifact.lName<<endl;
    cout<<endl;
    cout<<"***************************"<<endl;
    cout<<" Artifact Menu \n\n"<<endl;
    cout<<"* View List - V "<<endl;
    cout<<"* Search - S "<<endl;
    cout<<"* Add Artifact - A "<<endl;
    cout<<"* Delete Artifact - D "<<endl;
    cout<<"* Quit - Q "<<endl;
    cout<<"***************************"<<endl;
    do
    {
    cout<<"\n\nSelect an option: ";
    cin>>menu;
    **whlie(menu!='q')

    switch(menu)
    {
    case 'V':
    View(artifact);
    break;
    case 'S':
    Search(artifact);
    break;
    case 'A':
    Add(artifact);
    break;
    case'D':
    Delete(artifact);
    break;
    default:
    **

    system("PAUSE");
    return 0;
    **
    void View(int, int)
    {
    inFile.open("ArtFile.txt");
    **
    void Search(int, int)
    {
    string item;
    int counter=0;
    cout<<"Name an item: ";
    cin>>item;
    if(item!=artifact[counter].name)
    {
    counter++;
    **
    else
    {
    cout<<artifact[counter].name<<endl;
    cout<<artifact[counter].month<<endl;
    cout<<artifact[counter].year<<endl;
    cout<<artifact[counter].fname<<endl;
    cout<<artifact[counter].lname<<endl;
    **
    **
    void Add(int, int);
    {
    cout<<"Enter artifact name: ";
    getline(cin,artifact[i].name, '\n');
    cout<<"Enter artifact month: ";
    getline(cin,artifact[i].month, '\n');
    cout<<"Enter artifact year: ";
    getline(cin,temp, '\n');
    artifact.year = atoi(temp.c_str());
    cout<<"Enter artifact owner's first name: ";
    getline(cin,artifact[i].fName, '\n');
    cout<<"Enter artifact owner's last name: ";
    getline(cin,artifact[i].lName, '\n');
    **

    cout<<endl<<endl;
    cout<<"Artifact:"<<endl;
    cout<<artifact.name<<endl;
    cout<<artifact.month<<" "<<artifact.year+10<<endl;
    cout<<artifact.fName<<" "<<artifact.lName<<endl;
    system("PAUSE");
    **
    void Delete(int, int);
    {

    **

  2. #2
    Gay Chat Mod
    Join Date
    Jan 2014
    Location
    Melbourne, Australia
    Posts
    1,793

    Default

    Quote Originally Posted by Patty Swank View Post
    Okay, first you need to download XAMPP. the XAMPP will help you go though the optical hashed lines code C++ coding of the programming language. Then you edit the tripe-axel MD5# from the PHP made by the XAMPP internal programme cross sever.
    Wow Patty! I'm impressed! I studied C++ about 15 years ago but cant remember any of it to save myself! So yeah, I'm no help here. Good luck though!

  3. #3
    Gay Chat Mod
    Join Date
    Jan 2014
    Location
    Melbourne, Australia
    Posts
    1,793

    Default

    Quote Originally Posted by Patty Swank View Post
    Why thank you, good sir. I am a highly experience Programmer and a level 9 technician. I have been coding since I was fetus.
    I remember during my final semester I was dreaming code at the back end of our software project! Thankfully all of that was a lifetime ago. I HATE code!

  4. #4
    Gay Chat Mod
    Join Date
    Jan 2014
    Location
    Melbourne, Australia
    Posts
    1,793

    Default

    Quote Originally Posted by Patty Swank View Post
    Aw, that's too bad. What made you give up coding?
    After my course finished, I found that my communication skills were going to get me further than my development skills. So I became a consultant. But as I said, that was a lifetime ago now. I still work with computers, more so than I did when I was a consultant, however it's just a means to an end. I've got a great lifestyle that I wouldn't have if I didn't have these skills. I'd probably be stacking shelves in a supermarket ha ha

  5. #5
    Intermediate Member
    Join Date
    Dec 2015
    Location
    Kekistan
    Posts
    439

    Default

    Programming in C++? I have gone beyond that, as all my coding is done in C#.
    How much nuffin did a dindu do if a dindu dindu nuffin?

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
© 1999-2018 - #1 Chat Avenue - Free chat rooms for adults, gays, kids, singles, teens and more.
All times are GMT -4. The time now is 09:01 PM.