In order to lean more about your interests we ask the following questions and ma
ID: 3756233 • Letter: I
Question
In order to lean more about your interests we ask the following questions and make assumptions based on your answers. Answer 1 for TRUE or O for False to each question. Are you a sportsFan? Are you a sports fan? You are a Sports fan If this statement is true then we must determine what type of sports fan you are We will assume you are a Carolina Native in the event that you are an nfiFan who also is a panthersFan We assume you are a "True Nascar Fan in the even that you are a nascarFan who also is a earnhardtFan. We assume you are a "True NBA Fan' in the event that you are a hornetsFan-In the event that you are True NBA Fan w willalso ask your players favorite number if you enter the number 15 you are a 'Kimba Walker fan if you enter the number 2 you are a Tony Parker fan . if you enter any other number you are a Mediocre Hornets fan Are you an NFL fan? Are you a Panthers fan? Are you a Nascar fan? Are you a Dale Earnhardt Jr. fan? Are you a Hornets fan?Explanation / Answer
As it is not mentioned in the problem whether a single person can be a fan of two or more sports, hence there are two possible solutions of this problem.
Solution 1: When a person can be a fan of only one sport
#include <bits/stdc++.h> //header class for using the inbuilt functions
using namespace std;
int main() //main function for entry point of the function
{
int sportsFan; //for determinig you are a sports fan or not
int choice1;
int choice2; //variables for storing the choices
int carNative; //for determing whether the person is a Carolina Native or not
int tnf; //for determing the person is a True Nascar fan or not
int tnbaf; //for determing the person is a True NBA Fan or not
cout << "Are you a sports fan?" << endl;
cin >> sportsFan ;
if(sportsFan == 1)
{
cout << "You are a Sports fan" << endl;
cout << "Are you an NFL fan?" << endl;
cin >> choice1;
cout << "Are you a Panthers fan?" << endl;
cin >> choice2;
if(choice1 == 1 && choice2 == 1)
{
carNative = 1;
}
cout << "Are you a Nascar fan?" << endl;
cin >> choice1 ;
cout << "Are you a Dale Earnhardt Jr. fan?" << endl;
cin >> choice2 ;
if(choice1 == 1 && choice2 == 1)
{
tnf = 1;
}
cout << "Are you a Hornets fan?" << endl;
cin >> choice1 ;
if(choice1 == 1)
{
cout << "What is the number of your favorite player?" << endl;
cin >> choice2 ;
tnbaf = 1;
}
}
else
{
cout << "You enjoy other activities" << endl;
}
if(carNative == 1)
cout << "Carolina Native" << endl;
else if(tnf == 1)
cout << "True Nascar Fan" << endl;
else
{
if(choice2 == 2)
cout << "Tony Parker fan" << endl;
else if(choice2 == 15)
cout << "Kimba Walker fan" << endl;
else
cout << "Mediocre Hornets fan" << endl;
}
return 0;
}
//Solution 2: When a person can be a fan of two or more sports
#include <bits/stdc++.h> //header class for using the inbuilt functions
using namespace std;
int main() //main function for entry point of the function
{
int sportsFan; //for determinig you are a sports fan or not
int choice1;
int choice2; //variables for storing the choices
int carNative; //for determing whether the person is a Carolina Native or not
int tnf; //for determing the person is a True Nascar fan or not
int tnbaf; //for determing the person is a True NBA Fan or not
cout << "Are you a sports fan?" << endl;
cin >> sportsFan ;
if(sportsFan == 1)
{
cout << "You are a Sports fan" << endl;
cout << "Are you an NFL fan?" << endl;
cin >> choice1;
cout << "Are you a Panthers fan?" << endl;
cin >> choice2;
if(choice1 == 1 && choice2 == 1)
{
carNative = 1;
}
cout << "Are you a Nascar fan?" << endl;
cin >> choice1 ;
cout << "Are you a Dale Earnhardt Jr. fan?" << endl;
cin >> choice2 ;
if(choice1 == 1 && choice2 == 1)
{
tnf = 1;
}
cout << "Are you a Hornets fan?" << endl;
cin >> choice1 ;
if(choice1 == 1)
{
cout << "What is the number of your favorite player?" << endl;
cin >> choice2 ;
tnbaf = 1;
}
}
else
{
cout << "You enjoy other activities" << endl;
}
if(carNative == 1)
cout << "Carolina Native" << endl;
if(tnf == 1)
cout << "True Nascar Fan" << endl;
if(tnbaf == 1)
{
if(choice2 == 2)
cout << "Tony Parker fan" << endl;
else if(choice2 == 15)
cout << "Kimba Walker fan" << endl;
else
cout << "Mediocre Hornets fan" << endl;
}
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.