Click here to Skip to main content
15,899,754 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: Converting int to Hex String Pin
MKlucher19-Dec-04 10:56
MKlucher19-Dec-04 10:56 
GeneralRe: Converting int to Hex String Pin
S. Senthil Kumar27-Dec-04 7:34
S. Senthil Kumar27-Dec-04 7:34 
GeneralC++/CLI Community in Orkut Pin
Majid Shahabfar16-Dec-04 0:17
Majid Shahabfar16-Dec-04 0:17 
GeneralBlank Control ID when invoking Add Member Variable Wizard Pin
Anonymous14-Dec-04 0:36
Anonymous14-Dec-04 0:36 
GeneralOpenoffice.org COM interface Pin
Munchausen12-Dec-04 1:26
Munchausen12-Dec-04 1:26 
GeneralExample of RegDeleteKey Pin
jonavon blakly10-Dec-04 17:57
jonavon blakly10-Dec-04 17:57 
GeneralRe: Example of RegDeleteKey Pin
TigerNinja_13-Dec-04 3:49
TigerNinja_13-Dec-04 3:49 
Generalhelppp Pin
James19859-Dec-04 16:01
James19859-Dec-04 16:01 
OK guys well im sorta finished with my final project but i cant get it to work CORRECTLY. The program is to have a menu and ask the user to choose betweetn add, subtract, mult and divide. when they choose whatever one it will ask them a simple question. and if they get the correct answer or wrong answer it will ask them again if they want another problem. If they choose yes then it will give em another problem but if they choose no it will go back to the menu. I cant seem when they enter no it keeps say "enter another seed vaule" I want it to go back to the menu. Well here is the code. O and if they enter anything besides Y or N i need it to say sorry that is an incorrect choice. Here is the code:

#include <iostream>
#include <iomanip>
#include <cstdlib>
using namespace std;

int main()
{
int choice; float num1, num2, answer, correct;
char again;
unsigned seed;
do
{
cout << "\n\t\tSimple Math Tutor Menu\n\n";
cout << "1. Addition\n";
cout << "2. Subtraction\n";
cout << "3. Division\n";
cout << "4. Multiplication\n";
cout << "5. Quit The Program\n\n";
cout << "Please enter a choice: ";
cin >> choice;
if (choice <1 || choice >5)
{
cout << "Sorry that is an incorrect choice!"<<endl;
cout="" <<="" "please="" enter="" another="" choice="" "<<endl;
="" cin="">> choice;
}
cout<<"Enter a seed value: ";
cin>>seed;
srand(seed);
num1 = 1 + rand() % 10;
num2 = 1 + rand() % 10;


switch (choice)
{

case 1 : do
{

cout << "What is the sum of "<< num1 << " and " << num2 <<endl;
cin="">> answer;
correct = num1 + num2;
if ( answer == correct)
{
cout << "Congratulations you are correct!" <<endl;
}
="" else
="" {=""
="" cout="" <<="" "sorry="" that="" was="" incorrect"="" <<endl;
="" "the="" correct="" answer="" was:="" "="" "would="" you="" like="" to="" do="" another="" problem="" (y="" n)?="" ";
="" cin="">> again;
cout<<"\nEnter another seed value: ";
cin>>seed;
num1 = 1 + rand() % 10;
num2 = 1 + rand() % 10;
}while (again=='y' || again=='Y');
if (again != 'y' || again !='Y')
cout << "Sorry That is an incorrect choice" <
GeneralRe: helppp Pin
TigerNinja_13-Dec-04 2:44
TigerNinja_13-Dec-04 2:44 
GeneralHelp with Strtok Pin
civicnar8-Dec-04 13:34
civicnar8-Dec-04 13:34 
GeneralRe: Help with Strtok Pin
civicnar8-Dec-04 13:41
civicnar8-Dec-04 13:41 
GeneralRe: Help with Strtok Pin
Christian Graus8-Dec-04 13:44
protectorChristian Graus8-Dec-04 13:44 
GeneralRe: Help with Strtok Pin
VKatti15-Dec-04 2:36
VKatti15-Dec-04 2:36 
GeneralRe: Using MFC dialogs from .Net Pin
TigerNinja_13-Dec-04 3:11
TigerNinja_13-Dec-04 3:11 
GeneralRe: Using MFC dialogs from .Net Pin
sunhui15-Dec-04 12:00
sunhui15-Dec-04 12:00 
Generaldictionary Pin
nayyab6-Dec-04 12:40
nayyab6-Dec-04 12:40 
GeneralRotating an image in a picture box Pin
fluminis6-Dec-04 11:13
fluminis6-Dec-04 11:13 
GeneralRe: Rotating an image in a picture box Pin
TigerNinja_13-Dec-04 4:05
TigerNinja_13-Dec-04 4:05 
GeneralRe: Rotating an image in a picture box Pin
fluminis13-Dec-04 7:47
fluminis13-Dec-04 7:47 
QuestionHow to Map a network drive Share? Pin
SeanV5-Dec-04 9:37
SeanV5-Dec-04 9:37 
GeneralASP.NET using MC++ or C++/CLI Pin
Ahmed Al-Lakani3-Dec-04 21:02
Ahmed Al-Lakani3-Dec-04 21:02 
GeneralRe: ASP.NET using MC++ or C++/CLI Pin
TigerNinja_13-Dec-04 4:28
TigerNinja_13-Dec-04 4:28 
Generaltutorials needed Pin
guyaton1-Dec-04 14:58
guyaton1-Dec-04 14:58 
GeneralRe: tutorials needed Pin
TigerNinja_13-Dec-04 4:11
TigerNinja_13-Dec-04 4:11 
GeneralAxImp.exe error Pin
h00ps29-Nov-04 8:47
h00ps29-Nov-04 8:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.