Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

================================================================== #include #include using namespace std; int main(){ int questions = 8; // 10111101 1> means the answer is True, 0 means the answer is

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

#include #include using namespace std;

int main(){ int questions = 8; // 10111101 1> means the answer is True, 0 means the answer is False // arr contains set of questions string arr[] ={"1+1=2","2+3=6","4*4=16","6-7=-1","25/5=5","25/0=Infinity","9*9=80","7^2=49"}; int answers = 189; // 10111101 in decimal is 189 int userInput; for(int i=questions-1; i>=0; i--){ cout<> userInput; if(userInput == (answers&1)){ // do bit wise and cout<<"Correct! "; }else{ cout<<"Incorrect! "; } answers = answers>>1; // shift bits to 1 place to the right } return 0; }

help plz how i can modify this program make it

Ask the user the questions in a random order by using another 8-bit value that indicates whether a question has been asked or not.

and Make sure that the program is refactored so that you have a function to display your binary numbers as well as the getBit function

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

3rd Edition

0071107010, 978-0071107013

More Books

Students also viewed these Databases questions