Question: Option B Programming Language: C++ (with sufficient comments) The main importance of this program is to utilize Bitwise operators to appropriately set the bits of

 Option B Programming Language: C++ (with sufficient comments) The main importanceof this program is to utilize Bitwise operators to appropriately set the

Option B

Programming Language: C++ (with sufficient comments)

The main importance of this program is to utilize Bitwise operators to appropriately set the bits of the single variable. Everything must be written using functions. The main function should not have all the code. Thank you in advance.

making an assignment. A C++ program to manage those options could have a separate flag (bool variable) for each condition that would be turned on or off. If there were 16 options (I only wish ), 16 different variables would be required. Being the efficient programmer that you are, you decide to save memory by using a single variable and using bitwise operators to manage the options. Starting with the rightmost bit, the options are: 1. Time Limit 2. Printing Allowed 3. Scrambled questions 4. Password Protected 5. Point Values Shown 6. Question Titles Shown 7. References Shown 8. Access to external links allowed 9. Formulas shown 10. Only 1 attempt allowed 11. Correct letter case required 12. Late submissions allowed 13. Access to eBook allowed 14. Access to "Check my work" allowed 15. Correct spacing and punctuation required 16. "Ask the instructor" allowed Output will be to a file named lastname_firstname_bits.out. Display your name as the first line of output. Option A Input will be from the file named "bits.dat". You will read in an integer in decimal form from 0 to 65535. You will examine the bits in the binary format of this number. You will use bitwise operators to determine which options are on and which are off. For each number read in the assignment number along with the options which are turned on will be described in the output file. Read until the end of file. Sample input: Corresponding output: Cerise Wuthrich ASSIGNMENT #1 OPTIONS This assignment has a time limit. The question in this assignment may be printed. The questions in this assignment will be scrambled. ASSIGNMENT #2 OPTIONS The questions in this assignment will be scrambled. This assignment is password protected. Point values for each question will be shown. Option B Input will be from the file named "on_off.dat" There will be exactly ten lines of data. For each assignment, you will read in a series of 16 occurrences of on or off. The first on or off will used to set the leftmost bit (Ask the instructor). The last on or off on the line will used to set the rightmost option (Time limit). Based on those values, you will use bitwise operators to appropriately set the bits of the single variable. The resulting decimal number will be sent to the output file, along with the assignment number. Sample input: off off off off off off off off off off off off off on on on on off off off off off off off off off off off on on on off Corresponding output: Cerise Wuthrich ny name goes here ASSIGNMENT #1 FLAG IS 7 ASSIGNMENT #2 FLAG IS 32782 Turn in: Printout of program Printouts of 2 input files, mine and one you make up Printouts of 2 corresponding output files

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!