Jump to content
Sign in to follow this  
patrickberubedubreuil

part 2 C++

Recommended Posts

patrickberubedubreuil

i got part 1 of c++ menu too work

 

all i need to do now is programme for the console

too like loop....so i can handle the menu more then 1 time....

meaning dont have to replay it to get a new answer out of console....

 

how would i go about programming a  loop like that....(sequantly get more info from my menu with restarting it)?

 

heres my code what would you add too it

 

// Example program for resume
#include <iostream>
using namespace std;

int main ()
{
  int user_value;
  cout <<" 1 - Myage\n 2 - Myname\n";
  cout << "Insert your number,to get to know me";
  cin >> user_value;
  cin.ignore ();
  
  string string_x;{
  string_x = "Forty-Five";
  string string_y;
  string_y = "Patrick";
}
  switch (user_value)
  {
     
      case 1:
        cout << "Forty-Five";
        break;
      case 2 :
        cout << "Patrick";
        break;
      default:
        cout << "Wrong Output";
  }
  
  cin.ignore();
  
  return 0;
}
      

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×