Jump to content
Sign in to follow this  
patrickberubedubreuil

C++ Menu

Recommended Posts

patrickberubedubreuil

Iam trying to make a c++ resume...

that can be in a form of a menu....

just know i just started so i only have my age done.....name will be added and what not....

iam a student at PTS V4 level....i just want to try my own programming skills....

but need help...

 

whats wrong with this code i try and compile it and it says mistake on several lines(14,16,17)....

 

can you help make my resume menu a succesd...

 

here is the code....

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

int main ()
{
  int user_value;
  cout <<" 1 - Myage\n" << endl;
  cout << "Insert your number,to get to know me";
  cin >> user_value;
  cin.ignore ();
  
  switch (user_value);{
      case 1:
        cout << "45";
         break;
      default:
        cout << "Wrong Output";
  }
  cin.ignore();
  return 0;

 

thanks for your time

 

Share this post


Link to post
Share on other sites
patrickberubedubreuil

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

int main ()
{
  int user_value;
  cout <<" 1 - Myage\n";
  cout << "Insert your number,to get to know me";
  cin >> user_value;
  cin.ignore ();
  
  int value_1 = "45"
  
  
  switch (user_value);
  {
      case 1:
        cout << "value_1";
         break;
      default:
        cout << "Wrong Output";
  }
  cin.ignore();
  return 0;
      
}
i added a variable does this make more sense at least??????

still doesnt work

Share this post


Link to post
Share on other sites
patrickberubedubreuil

got it too work, but when i press #1. as my case 1 is soppose to be forty five but it prints (x) why?

 

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

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

 

Thanks for your help and and time people

Patrick Berube Dubreuil

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  

×