Announcement

Collapse
No announcement yet.

C++ help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Here is a photo of what I am replacing. They run all the way around the store.
    The second is a partial pic of my store.





    Apache

    Where do you put the Bayonet?
    Chesty Puller (upon seeing a flamethrower for the first time)
    I am all in favor of keeping dangerous weapons out of the hands of fools. Lets start with typewriters.
    Frank Lloyd Wright

    Comment


      #17
      Nice! Not sure what it has to do with c++, but it is nice

      Comment


        #18
        Wrong place. I was tired last night.
        Apache

        Where do you put the Bayonet?
        Chesty Puller (upon seeing a flamethrower for the first time)
        I am all in favor of keeping dangerous weapons out of the hands of fools. Lets start with typewriters.
        Frank Lloyd Wright

        Comment


          #19
          Wow thanks apache for shedding some "lights" on this problem

          Comment


            #20
            LOL Apache,
            K3BASFM. "Lead, follow, or get out of the way."
            sigpic

            Support Cainslair. Donate here! Cain's Lair Forums

            Comment


              #21
              Originally posted by Pumpkin_Jack View Post
              Wow thanks apache for shedding some "lights" on this problem


              Originally posted by Minerva View Post
              LOL Apache,
              Old age is a pitiful thing.

              Apache

              Where do you put the Bayonet?
              Chesty Puller (upon seeing a flamethrower for the first time)
              I am all in favor of keeping dangerous weapons out of the hands of fools. Lets start with typewriters.
              Frank Lloyd Wright

              Comment


                #22
                Alright terrible stuck on this one. Absolutely lost its due friday at noon so no rush. But here is what i have to do Lab 5 Directions

                Here is what i have

                #include <iostream>
                #include <string>
                #include <math.h>
                using namespace std;
                void changeSong( int indexToChange );

                // A 3-array table
                // Each array has 3 elements, 0-2
                string Artist [ 3 ];
                string Albulm [ 3 ];
                string Song [ 3 ];
                int Songnum [ 3 ];
                int userChoice = 0;
                int x; // generic int variable

                int main()
                {
                while (true)
                {
                userChoice = printMenu ();
                // populate 3 arrays with data
                Artist [ 0 ] = "Aerosmith";
                Albulm [ 0 ] = "Just Push Play";
                Song [ 0 ] = "Jaded";
                Songnum [ 0 ] = 0;

                Artist [ 1 ] = "The Beatles";
                Albulm [ 1 ] = "Abbey Road";
                Song [ 1 ] = "Come Together";
                Songnum [ 1 ] = 1;

                Artist [ 2 ] = "Led Zeppelin";
                Albulm [ 2 ] = "Led Zeppelin";
                Song [ 2 ] = "Dazed and Confused";
                Songnum [ 2 ] = 2;


                // ask the user which record to display
                cout << "Enter index to display...";
                cin >> x;

                // check within range 0-4
                if ((x >=0) && (x <=4))
                {
                cout << "Item: " << x << endl;
                cout << "Artist: " << Artist [ x ] << endl;
                cout << "Albulm: " << Albulm [ x ] << endl;
                cout << "Song: " << Song [ x ] << endl;
                }//end if

                // call change song function for the user-selected index
                changeSong( x );

                // display the whole table
                for (int ix=0; ix<=4; ix++)
                {
                cout << " Artist: " << Artist [ ix ] ;
                cout << " Albulm: " << Albulm [ ix ] ;
                cout << " Song: " << Song [ ix ] << " for index " << ix << endl;
                }//endfor

                } // end program

                // function to change the age of one record
                void changeSong( int indexToChange )
                {
                int newSong;
                cout << endl << "Enter new song name: ";
                cin >> newSong;

                Song [ indexToChange ] = newSong;
                } //endvoid
                }// end whiletrue


                int printMenu( ) {

                int selection = -1;

                cout << "0. " << endl;
                cout << "1. " << endl;
                cout << "2. " << endl;
                cout << "3. Exit" << endl;
                cout << "Enter choice, 0-3: ";
                cin >> selection;
                cout << endl;

                return selection;
                }

                Comment


                  #23
                  Formatting?

                  it is kind of a pain to try to read code with no indentation...

                  OK:
                  1. It would be easier to just declare your arrays with the entries.
                  EX.
                  string Artist [ 3 ] = {Aerosmith, TheBeatles, LedZepplin};

                  2. You need to set up a menu like in the instructions, then based on the user input, I would call a function to do what they want. For example, create PrintDatabase function, ChangeSong function, ChangeArtist function, etc. Then the main function is just a loop showing the main menu and calling functions using a switch.
                  [url=http://www.enjin.com/bf3-signature-generator][img]http://sigs.enjin.com/sig-bf3/1fad512dc784c11c.png[/img][/url]

                  Comment


                    #24
                    Did you get it done in time? I went offline Wednesday and didn't come back till today.

                    Comment

                    Cain's Lair Forums Statistics

                    Collapse

                    Topics: 26,182   Posts: 269,814   Members: 6,178   Active Members: 4
                    Welcome to our newest member, joky12.

                    Today's Birthdays

                    Collapse

                    Top Active Users

                    Collapse

                    There are no top active users.
                    widgetinstance 184 (More Posts) skipped due to lack of content & hide_module_if_empty option.
                    Working...
                    X