Solved

c++ question

Posted on 2000-04-20
3
297 Views
Last Modified: 2010-04-02
I asked this question earlier but I don't know if it went through or not.  

how do I get c++ to ask the user which employee (1 or 2) they want to see?

I have this but it's probably way off.
// Declare and define variables
{
char fEfirstName[10];
char fElastName[10];
char sEfirstName[10];
char sElastName[10];
double fEgPay;
double fEnPay;
double sEgpay;
double sEnpay;
double grossPay;
// ask user which employee they want to view

cout << "Chose employee 1 or 2 " 
cin >> ???????

0
Comment
Question by:nationnon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Author Comment

by:nationnon
ID: 2734452
Adjusted points from 30 to 60
0
 
LVL 3

Accepted Solution

by:
MDarling earned 60 total points
ID: 2734478
int nEmployee;

do
{
  cout << "Choose Employee 1 or 2: "
  cin >> nEmployee;
}
while(nEmployee<1 || nEmployee>2);

regards,
Mike.

0
 
LVL 1

Author Comment

by:nationnon
ID: 2734490
thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question