Newbie needs help, shouldnt be hard
Ok im new and starting on my first task. I want to create a sound player. I have most of the coding finished (I think) and use windows and devcpp but first i have a few questions. 1. Can i use a different thing besides that black backround. 2. In the tutorials it only shows the command 'int' but it never teaches how to make a like word variable... say like i want it so when i type in "rock" it takes me to the menu instead of a number..
Ok so first i had it to here....
Code:
#include <iostream>
using namespace std;
int main()
{
int rock;
cout<<"Hello welcome to My Custom Radio.\n" "Please type the number of whatever music you would like to listen to today\n" "\n" "1 = rock\n" "2 = metal\n" "3 = Techno\n" "\n";
cin>> rock;
cin.ignore();
if ( rock == 1 ) {
cout<<"\n" "You have chosen Rock, Please choose a song to listen to: \n" "\n" "1. Crazy Train\n" "2. IronMan\n" "3. Black Parade\n" "4. Numb\n" "\n" ;
}
if ( rock == 2 ) {
cout<<"\n" "You have chosen Metal, Please choose a song to listen to: \n" "\n" "1. Teenagers\n" "2. In the End\n" "3. Killing in the name of\n" "4. Gonna Die\n" "\n" ;
}
if ( rock == 3 ) {
cout<<"\n" "You have chosen Techno songs, Please choose a song to listen to: \n" "\n" "1. Around the World 1\n" "2. Around the World 2\n" "3. popcorn1\n" "4. loop3\n" "\n" ;
}
cin.get();
}
Then i tried to make it so when you clicked the number after the second menu it says "Enjoy your music!" But when i click the number after the second menu it just closes...
Code:
#include <iostream>
using namespace std;
int main()
{
int rock;
int rock1;
cout<<"Hello welcome to My Custom Radio.\n" "Please type the number of whatever music you would like to listen to today\n" "\n" "1 = rock\n" "2 = metal\n" "3 = Techno\n" "\n";
cin>> rock;
cin.ignore();
if ( rock == 1 ) {
cout<<"\n" "You have chosen Rock, Please choose a song to listen to: \n" "\n" "1. Crazy Train\n" "2. IronMan\n" "3. Black Parade\n" "4. Numb\n" "\n" ;
cin>> rock1;
}
if (rock1 == 1) {
cout<<"\n" "Please enjoy your music";
}
if ( rock == 2 ) {
cout<<"\n" "You have chosen Metal, Please choose a song to listen to: \n" "\n" "1. Teenagers\n" "2. In the End\n" "3. Killing in the name of\n" "4. Gonna Die\n" "\n" ;
}
if ( rock == 3 ) {
cout<<"\n" "You have chosen Techno songs, Please choose a song to listen to: \n" "\n" "1. Around the World 1\n" "2. Around the World 2\n" "3. popcorn1\n" "4. loop3\n" "\n" ;
}
cin.get();
}
Like i said it just fades away after the second menu...