programm in C language Create a game that categorizes your user based on the res
ID: 3585096 • Letter: P
Question
programm in C language
Create a game that categorizes your user based on the response to questions asked by the program. For example, the gimmick of your game could be, “Are you a Rick or a Morty”, (if you have never seen this show, watch it, it is amazing). Your game should include at least 5 questions with at least 4 answer choices to your user on each question. Your categorization should have at least three buckets and should be based on the summed value of the answer selections of your user. You will also want to put a control in that makes sure your user only uses valid input.
Explanation / Answer
In this C Code the user is prompt with several question and asked to answer with option, to find "the person is morty or rick." morty has some key features such as playing chess,violins, keyboards, and he is not interested in watching movies, maintains health by yoga and healthy diet. he is a sensistive person mostly talkative.
rick with football and cricket player, interested in Flute and Guitar, maintains his health by exercise and cycling,always fond of watching movies, he is silent and courageous
gets the option(1 and 3 for rick)(2 and 4 for morty) from the user and calculates the sum of the values entered and finds the right person.
#include <cstdlib>
# include<iostream>
using namespace std;
int a,r, m;
//method for accepting input and calculating
void getCalculate()
{
cout<<" option :";
cin>>a;
//checks for user valid input
while((a<1)||(a>5))
{
cout<<" Enter the choice between 1 to 4:";
cin>>a;
}
// counts for the option choosed
if((a==1)||(a==3))
r++;
else
m++;
}
int main(int argc, char** argv) {
//displays the question
cout<<"Are you a Rick or a Morty ? Let us find ! ";
cout<<" Answer the questions below by selecting the options.(1,2,..) ";
cout<<" what game you like to play mostly? 1. Football 2.Hockey 3.cricket 4.chess";
getCalculate();
cout<<" which music instrument do you like to play? 1.Flute 2..Keyboards 3.Guitar 4.Violins";
getCalculate();
cout<<" How you will maintain your health? 1.Exercise 2. Healthy Diet 3.Regular cycling 4.Yoga.";
getCalculate();
cout<<" Are you interested in watching movies? 1.yes always 2.yes,sometimes 3.whenever finds time 4.rarely watch movies";
getCalculate();
cout<<" You are mostly a_____ 1. silent person 2. talkative person 3.courageous 4.sensitive person";
getCalculate();
if(m>r)
{
cout<<" You are a Morty.";
}
else
{
cout<<" You are a Rick.";
}
return 0;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.