Speed up development with full-stack environments for every branch.

Learn More

Privilege Test [C++]

Forked from Hello World C++ Example.

12 Runs 20 Views 3 Copies

Test how well off you are in America!

Saved

Saved

Ilya 3

Ilya
published a month ago

    #include <iostream>
    using namespace std;
    int answer();
    int answer(){
    	
    	int anw=0;
    	
    	cin>>anw;
    	cout<<endl;
    	if(anw==1)
    	return 0;
    	else if(anw==2) return 3;
    	else if (anw==3) return 5;
    	else cout<<"Invalid answer, marked as 0"<<endl;
    	return 0;
    	
    }
    int main ()
    
    {
    	double total=0, f=0, md=0, fm=0, white=0;
    	string cur;
    	
    	cout << "Hello, I am the White Privilege Survey test!"<<endl<<
    	"Answer (3) if the the statement is often true for you..."<<endl //5
    	<<"Answer (2) if the statement is sometimes true for you..."<<endl //3
    	<<"Answer (1) if the statement is seldom or never true for you..."<<endl //0	
    	<<"THEN HIT ENTER"<<endl<<endl<<endl<<
    	"Because of my race or colour..."<<endl;
    
    	cout<<"1. I can be in the company of people of my race most of the time."<<endl;
    	//
    	f=answer();  
    	white+=f; 
    	total+=f;
    	cout<<"2. If I should need to move. I can be pretty sure of hassle-free"<<endl<<
    	"renting or purchasing in an area in which I would want to live."<<endl;
    	//
    	f=answer();  
    	md+=f; 
    	total+=f;
    	cout<<"3. I can be pretty sure that my neighbors in such a location will be"<<endl<<
    	"neutral or pleasant to me."<<endl;
    	//
    	f=answer(); 
    	md+=f;
    	total+=f;
    	cout<<"4. I can go shopping alone most of the time, pretty well assured that"<<endl<<
    	"I will not be followed or harassed."<<endl;
    	//
    	f=answer(); 
    	md +=f;
    	 total+=f;
    	cout<<"5. I can turn on the television or open to the front page of the"<<endl<<
    	"newspaper and see people of my race widely and positively"<<endl<<
    	"represented."<<endl;
    	//
    	f=answer();  
    	white+=f; 
    	total+=f;
    	cout<<"6. When I am told about our national heritage or about “civilization,” I"<<endl<<
    	"am shown that people of my race made it what it is."<<endl;
    	//
    	f=answer(); 
    	white +=f; 
    	total+=f;
    	cout<<"7. I can be sure that my children (or children from my family) will be"<<endl<<
    	"given curricular materials that testify to the contributions of their"<<endl<<
    	"race."<<endl;
    	//
    	f=answer();  
    	white+=f; total+=f;
    	cout<<"8. I can go into most supermarkets and find the staple foods which"<<endl<<
    	"fit with my racial/ethnic traditions; I can go into any hairdresser's"<<endl<<
    	"shop and find someone who can cut my hair."<<endl;
    	//
    	f=answer();  
    	white+=f; total+=f;
    	cout<<"9. Whether I use checks. credit cards. or cash. I can count on my"<<endl<<
    	"skin color not to work against the appearance of fnancial reliability."<<endl;
    	//
    	f=answer();white+=f; total+=f;
    	cout<<"10. I can arrange to protect my children (or children from my family)"<<endl<<
    	"most of the time from people who might mistreat them because of"<<endl<<
    	"their race."<<endl;
    	//
    	f=answer(); 
    	white +=f; total+=f;
    	cout<<"11. I can swear. dress in secondhand clothes. or not answer letters,"<<endl<<
    	"without having people attribute these choices to the bad morals. the"<<endl<<
    	"poverty, or the illiteracy of my race."<<endl;
    	//
    	f=answer(); 
    	white+=f; total+=f;
    	cout<<"12. I can do well in a challenging situation without being called a"<<endl<<
    	"credit to my race."<<endl;
    	//
    	f=answer(); 
    	white +=f; 
    	total+=f;
    	cout<<"13. I am never asked to speak for all the people of my racial group."<<endl;
    	//
    	f=answer(); 
    	white +=f; total+=f;
    	cout<<"14. I can remain oblivious to the language and customs of people of"<<endl<<
    	"color without feeling, from people of my race, any penalty for such"<<endl<<
    	"ignorance."<<endl;
    	f=answer();
    	white+=f; 
    	total+=f;
    	cout<<"15. I can criticize our government and talk about how much I fear its"<<endl<<
    	"policies and behavior without being seen as a racial outsider."<<endl;
    	f=answer();
    	white+=f;
    	 total+=f;
    	cout<<"16. I can be pretty sure that if I ask to talk to the “person in charge”. I"<<endl<<
    	"will be facing a person of my race."<<endl;
    	f=answer();
    	white+=f; 
    	total+=f;
    	cout<<"17. If a police offcer pulls me over, I can be sure I haven't been"<<endl<<
    	"singled out because of my race."<<endl;
    	f=answer();  
    	white+=f; 
    	total+=f;
    	cout<<"18. I can conveniently buy posters, postcards. picture books."<<endl<<
    	"greeting cards. and children's magazines featuring people of my"<<endl<<
    	"race."<<endl;
    	f=answer();
    	white+=f;
    	 total+=f;
    	cout<<"19. I can go home from most meetings of organizations I belong to"<<endl<<
    	"feeling somewhat tied-in. rather than isolated, out-of-place,"<<endl<<
    	"outnumbered. unheard, feared. or hated."<<endl;
    	f=answer();
    	white+=f; 
    	total+=f;
    	cout<<"20. I can take a job with an affrmative action employer without"<<endl<<
    	"having co-workers on the job suspect that I got it because of my"<<endl<<
    	"race."<<endl;
    	f=answer();
    	white+=f; 
    	total+=f;
    	cout<<"21. I can choose public accommodation (hotels. restaurants, etc.)"<<endl<<
    	"without fearing that people of my race cannot get in or will be"<<endl<<
    	"mistreated in the place I have chosen."<<endl;
    	f=answer();white+=f; total+=f;
    	cout<<"22. I can be sure that if I need legal or medical help, my race will not"<<endl<<
    	"work against me."<<endl;
    	f=answer();
    	white+=f; 
    	total+=f;
    	cout<<"23. If my day, week or year is going badly. I need not ask of each"<<endl<<
    	"negative episode or situation whether it has racial overtones."<<endl;
    	f=answer();
    	fm+=f; 
    	total+=f;
    	cout<<"24. I can comfortably avoid. ignore, or minimize the impact of racism"<<endl<<
    	"on my life."<<endl;
    	f=answer();white+=f; total+=f;
    	cout<<"25. I can speak in public to a powerful group without putting my race"<<endl<<
    	"on trial."<<endl;
    	f=answer();
    	white+=f; 
    	total+=f;
    	cout<<"26. I can choose blemish cover or bandages in “flesh” color and"<<endl<<
    	"have them more or less match the color of my skin."<<endl;
    	f=answer();
    	fm+=f; 
    	total+=f;
    	cout << "your privilege is --> "<<total/1.3<<"% <--"<<endl<<
    	"your raw score is: "<<total<<" with the highest score of 130, lowest of zero, and medium of 78"<<endl<<
    	"Did you fare better than your friends?"<<endl<<endl;
    	
    	cout<<"Would you like to know your odds of being middle class? (Y/N)"<<endl;
      	cin>>cur;
    	if(cur=="Y"||cur=="y")
      		cout<<"Chances that you are in the middle class --> "<<md/.15<<"%"<<endl;
      	cout<<"Would you like to know your odds of being a minority? (Y/N)"<<endl;
      	cin>>cur;
    	if(cur=="Y"||cur=="y")
      		cout<<  "Chances that you are not a minority in your country -->"<<white/1.05<<"%"<<endl;	
      cout<<"Would you like to know your odds of being a male? (Y/N)"<<endl;
      	cin>>cur;
    	if(cur=="Y"||cur=="y")
      		cout<< "Chances that you are a male -->"<<fm/.1<<"%"<<endl;
      
      return 0;
    }
    Please login/signup to get access to the terminal.

    Your session has timed out.

    Dismiss (the page may not function properly).