If this is your first visit, You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
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
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
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
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
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.
Comment