Define the enumerated data type Lang which has the types ASL, English, Brail, Fr
ID: 3693985 • Letter: D
Question
Define the enumerated data type Lang which has the types ASL, English, Brail, French, German, Italian, Spanish Output all of the numbers associated with each type next to the description: ie. 0 is ASL Create a variable to hold a Lang and assign it a language value. Compare the value to three of these values and show the result of relational operation to the output screen. Demonstrate to the instructor the successful completion of the program output. Have this sheet ready for instructor to sign and hand in to instructor to receive credit.Explanation / Answer
1)
2 ,3 & 4)
#include <iostream>
#include <string>
using namespace std;
enum Lang {ASL, English, Brail, French, German, Italian, Spanish};
int main()
{
Lang L = Lang::ASL;
cout << L << " is ASL" << endl;
L = Lang::English;
cout << L << " is English" << endl;
L = Lang::Brail;
cout << L << " is Brail" << endl;
L = Lang::French;
cout << L << " is French" << endl;
L = Lang::German;
cout << L << " is German" << endl;
L = Lang::Italian;
cout << L << " is Italian" << endl;
L = Lang::Spanish;
cout << L << " is Spanish" << endl;
Lang M = Lang::ASL;
cout << (M==L) << endl;
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.