Results 1 to 10 of 10
  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,875

    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,875

    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,875

    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
    442

    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?

  6. #6

    Default

    This thread is old but I want to ask a question, what are the best programming languages to learn?

  7. #7

    Default

    It is interesting to contemplate how things had changed since the first post in the thread, I guess most demanded languages today will look like this rating: 1. JavaScript 2. Java 3. Python (here's detailed info about Python ). I am personally surprised with these changes, IT market is very unpredictable.

  8. #8

    Default

    learn java the hard way - and watch utube vids
    i'll give you 50 pesos for it

  9. #9

    Default

    A file in this scenario is probably the worst data structure to work with. So when you delete an entry you have to first search for the entry by 'artifact name', and depending on the entries it could take awhile to search the list. While listing the entries it could display Artifact # and then just jump right there when adding/deleting entries. So it's pretty easy step to do when deleting. Just jump to the text file where 'artifact name' is located and delete the 4 lines, making sure to remove any blank spaces or empty lines. This is also not the best site to ask questions like this. I recommend stackoverflow.com

  10. #10
    Intermediate Member
    Join Date
    Dec 2015
    Location
    Kekistan
    Posts
    442

    Default

    Quote Originally Posted by deenalee View Post
    It is interesting to contemplate how things had changed since the first post in the thread, I guess most demanded languages today will look like this rating: 1. JavaScript 2. Java 3. Python (here's detailed info about Python ). I am personally surprised with these changes, IT market is very unpredictable.
    I could tend to agree, but I think that JavaScript is hardly used much these days in areas such as gaming, websites, and other scripting purposes. In fact in terms of websites what was once done on JavaScript is now done by JQuery. I would that both C++ and C# are more widely used, as these scripts can also be used for databasing, gaming, and Windows-based scripting.

    Python is the most growing language in popularity, but apart from extensions such as Pyglet, it is mainly used for mathematical purposes.
    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 02:10 AM.