Question

How to Write a program in c++ to compute the Quiz mark from 16 point to...

How to Write a program in c++ to compute the Quiz mark from 16 point to be form 10points
0 0
Add a comment Improve this question Transcribed image text
Answer #1

You would need to give a more detailed explanation of your problem. In order to provide a correct code, please provide the following details:

  • A clear problem statement
  • A more detailed explanation of the problem, explaining the program requirements clearly.
  • If possible, a sample run of program Input and output.

Once you provide these details, I will provide you a more correct code.

For time being, I am providing a sample code of a quiz game in C++.

CODE

================

#include<iostream>

using namespace std;

int main() {

  int x,n;

  x=0;

  char choice[100],ch1;

  cout<<"\n\n\t\t *************";

  cout<<"\n\n\t\t * Quiz Game *";

  cout<<"\n\n\t\t *************";

  cout<<"\n\n\t\t====================================";

  cout<<"\n\n\t\t= Developed By :Bhaumik Mevada =";

  cout<<"\n\n\t\t====================================";

  cout<<"\n\n";

  cout<<"\n Please Enter Your Name : ";

  cin>>choice;

  cout<<"\n\n";

  cout<<"\n\n\t\t Welcome "<<choice<<"\n";

  cout<<"\n\n\t\t Loading Please wait........";

  cout<<"\n\n\t\t 1) Start Quiz";

  cout<<"\n\n\t\t 2) View Score";

  cout<<"\n\n\t\t 3) Exit Quiz";

  cout<<"\n\n Enter Your Choice :--> ";

  cin>>n;

  switch(n)

  {

    case 1:

    cout<<"\n\n\n Note :Enter Answer in the a,b,c and d only...";

    cout<<"\n\n\n";

    cout<<"Which of the following type of class allows only one object of it tobe created ?";

    cout<<"\n\n A.Virtual Class \n\n B.Abstract Class \n\n C.Singleton Class \n\n D.Friend Class";

  cout<<"\n\n Enter Your Select Answer : ";

  cin>>ch1;

  if(ch1=='c')

  {

    x=x+1;

    cout<<"\n\n Correct Answer....";

  }

  else

    cout<<"\n\n Sorry Wrong Answer....";

    cout<<"\n\n\n";

    cout<<"Which of the following is not a type of constructor ?";

    cout<<"\n\n A.Copy Constructor \n\n B.Friend Constructor \n\n C.Default Constructor \n\n D.Parameterized Constructor";

    cout<<"\n\n Enter Your Select Answer : ";

    cin>>ch1;

  if(ch1=='b')

  {

    x=x+1;

    cout<<"\n\n Correct Answer....";

  }

  else

    cout<<"\n\n Sorry Wrong Answer....";

    cout<<"\n\n\n";

    cout<<"RunTime Polymorphism is achieved by___";

    cout<<"\n\n A.Friend Function \n\n B.Operator Overloading \n\n C.Function Overloading \n\n D.Virtual Function";

    cout<<"\n\n Enter Your Select Answer : ";

    cin>>ch1;

  if(ch1=='d')

  {

    x=x+1;

    cout<<"\n\n Correct Answer...";

  }

  else

    cout<<"\n\n Sorry Wrong Answer....";

    cout<<"\n\n\n";

    cout<<"Which of the following cannot be used with the Keyword 'Virtual' ?";

    cout<<"\n\n A.Constructor \n\n B.Member function \n\n C.Destructor \n\n D.Class";

    cout<<"\n\n Enter Your Select Answer : ";

    cin>>ch1;

  if(ch1=='a')

  {

    x=x+1;

    cout<<"\n\n Correct Answer.....";

  }

  else

    cout<<"\n\n Sorry Wrong Answer....";

    cout<<"\n\n\n";

    cout<<"Which of the following is not a type of inheritance ?";

    cout<<"\n\n A.Multiple \n\n B.Distributive \n\n C.Multilevel \n\n D.Hierarchical";

    cout<<"\n\n Enter Your Select Answer : ";

    cin>>ch1;

  if(ch1=='b')

  {

    x=x+1;

    cout<<"\n\n Correct Answer...";

  }

  else

    cout<<"\n\n Sorry Wrong Answer....";

    cout<<"\n\n\n";

    cout<<"Which of the following is an invalid visibility label while inheriting a class";

    cout<<"\n\n A.Public \n\n B.Private \n\n C.Friend \n\n D.Protected";

    cout<<"\n\n Enter Your Select Answer : ";

    cin>>ch1;

  if(ch1=='c')

  {

    x=x+1;

    cout<<"\n\n Correct Answer....";

  }

  else

    cout<<"\n\n Sorry Wrong Answer....";

    cout<<"\n\n Enter Your Choice :--> ";

    cin>>n;

  case 2:

    if(x==50)

    cout<<"\n\n Congratulation......You are extremly intelligent";

    else if(x<=50)

   cout<<"\n Total Score is : "<<x;

   cout<<"\n\n Enter Your Choice :--> ";

   cin>>n;

  case 3:

return 0;

}

}

Add a comment
Know the answer?
Add Answer to:
How to Write a program in c++ to compute the Quiz mark from 16 point to...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT