I am trying to make a program that will list all the National Heroes of our Country. We used the switch statement.
#include "stdafx.h"
#include "iostream"
#include "stdio.h"
#include "conio.h"
using namespace std;
int main()
{
int choice,desc;
char repeat;
cout<<"\t\t\t\tPhilippine National Heroes\n\n";
cout<<"[1]Dr.Jose Rizal\n";
cout<<"[2]Andres Bonifacio\n";
cout<<"[3]General Gregorio Del Pilar\n";
cout<<"Enter the number of your Choice:\t";
cin>>choice;
switch(choice)
{
case 1: cout<<"\t\t\t\tJOSE RIZAL\n\n";
cout<<"(June 19, 1861 to December 30, 1896, Bagumbayan), was a Filipino polymath, patriot and the most prominent advocate for reform in the Philippines during the Spanish colonial era.";
break;
case 2: cout<<"\t\t\t\tANDRES BONIFACIO\n\n";
cout<<"(November 30, 1863 to May 10, 1897) was a Filipino nationalist and revolutionary.";
break;
case 3: cout<<"\t\t\t\tGENERAL GREGORIO DEL PILAR\n\n";
cout<<" (November 14, 1875—December 2, 1899) was one of the youngest generals in the Philippine Revolutionary Forces during the Philippine Revolution and the Philippine-American War.";
break;
case 4: cout<<"\t\t\t\tGENERAL EMILIO AGUINALDO\n\n";
cout<<"(March 22, 1869 – February 6, 1964) was a Filipino general, politician, and independence leader. ;
break;
default : cout<<"\nInvalid Choice!";
}
getch();
return 0;
}
What I need is, on how can make it repeat another choice after you've chosen someone.
Like for example I've chosen choice 1 Jose Rizal, then I want to choose again another hero, How can I do that?
PLEASE I REALLY NEED YOUR HELP. THANK YOU VERY MUCH IN ADVANCE.
ANY HELP WILL BE APPRECIATED. THANKS.
just tell me if you want me to put my entire code in here. Thank You.