Solved

c++ question

Posted on 2000-04-20
3
253 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
  • 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now