Question
1.) Using the construct sizeof(), determine the size of unsigned long integers (declare them as long long unsigned) on your computer. Display the result on
-
1.) Using the construct sizeof(), determine the size of unsigned long integers (declare them as
long long unsigned) on your computer. Display the result on the console (monitor).
-
2.) Prompt the User to enter an unsigned long integer (Range: 0 to 18,446,744,073,709,551,615).
-
3.) Validate this entry as an unsigned integer and reject invalid entries.
-
4.) Prompt the User to enter a 2nd unsigned long integer (Range: 0 to 18,446,744,073,709,551,615).
Prompt the User to ensure that this value is greater than the first integer entered.
-
5.) Validate this entry as an unsigned long, long integer and reject invalid entries.
-
6.) Each input value or entry must be labeled. Align the displayed binary values so that the entered
values and any output value are aligned horizontally such that Bit 0 of each entry or output value
is directly above or below Bit 0 of all other input values or output results.
-
7.) Add the two values together.
-
8.) Display each of the three values left-to-right as (a) binary, (b) hexadecimal, and (c) decimal.
-
9.) Pause the screen, prompting the User to press any key to continue.
-
10.) Examine the binary representation of the sum and note its value.
-
11.) When a key is pressed, clear the screen, redraw the two entered integer values, and execute (12)
-
12.) Subtract the second value that was entered from the first. Remember that the result will be
negative so you must store the difference in an integer that can be either positive or negative.
-
13.) Display each of the three values left-to-right as (a) binary, (b) hexadecimal, and (c) decimal.
-
14.) Pause the screen, prompting the User to press any key to continue.
-
15.) Examine the binary representation of the difference and note how a negative value is formed.
-
16.) When a key is pressed, clear the screen, redraw the two entered integer values, and execute (17)
-
17.) Using the bitwise operator &, logically AND these two integers.
-
18.) Display each of the three values left-to-right as (a) binary, (b) hexadecimal, and (c) decimal.
-
19.) Pause the screen, prompting the User to press any key to continue.
-
20.) Examine the binary representation of the sum and note its value.
-
21.) When a key is pressed, clear the screen, redraw the two entered integer values, and execute (22)
-
22.) Using the bitwise operator |, logically OR these two integers.
-
23.) Display each of the three values left-to-right as (a) binary, (b) hexadecimal, and (c) decimal.
-
24.) Pause the screen, prompting the User to press any key to continue.
-
25.) Examine the binary representation of the sum and note its value.
-
26.) When a key is pressed, clear the screen, redraw the two entered integer values, and execute (27)
-
27.) Using the bitwise operator ^, logically XOR these two integers.
-
28.) Display each of the three values left-to-right as (a) binary, (b) hexadecimal, and (c) decimal.
-
29.) Pause the screen, prompting the User to press any key to continue. Examine the result.
-
30.) Examine the binary representation of the sum and note its value.
-
31.) When a key is pressed, clear the screen, redraw the two entered integer values, and execute (32)
-
32.) Using the bitwise operator ~, logically NOR the first integer.
-
33.) Display each of the three values left-to-right as (a) binary, (b) hexadecimal, and (c) decimal.
-
34.) Pause the screen, prompting the User to press any key to continue.
-
35.) Examine the binary representation of the sum and note its value.
-
36.) When a key is pressed, clear the screen, redraw the two entered integer values, and execute (37)
-
37.) Using the unary operator -, negate the first integer. (Careful here!)
-
38.) Display each of the three values left-to-right as (a) binary, (b) hexadecimal, and (c) decimal.
-
39.) Pause the screen, prompting the User to press any key to continue.
-
40.) Examine the binary representation of the sum and note its value.
-
41.) When a key is pressed, clear the screen, redraw the two entered integer values, and execute (42)
-
42.) Prompt the User that a left shift operation will next be performed on the first integer. Prompt the
User to enter the number of places this integer will be shifted.
-
43.) Qualify this number to ensure that (a) it is a positive number and (b) that is does not exceed 63.
-
44.) Using the left shift operator <<, perform a logical shift on the first integer.
-
45.) Display each of the three values left-to-right as (a) binary, (b) hexadecimal, and (c) decimal.
-
46.) Pause the screen, prompting the User to press any key to continue.
-
47.) Examine the binary representation of the sum and note its value.
-
48.) When a key is pressed, clear the screen, redraw the two entered integer values, and execute (49)
-
49.) Prompt the User that a right shift operation will be performed on the first integer. Prompt the User
to enter the number of places this integer will be shifted.
-
50.) Qualify this number to ensure that (a) it is a positive number and (b) that is does not exceed 63.
-
51.) Using the right shift operator >>, perform a logical shift on the first integer.
-
52.) Display each of the three values left-to-right as (a) binary, (b) hexadecimal, and (c) decimal.
-
53.) Pause the screen, prompting the User to press any key to continue.
-
54.) Examine the binary representation of the sum and note its value.
-
55.) Upon the next press of a keyboard key, terminate the program.
Pls follow step 1 to 55 and it should come out 1 complete program. C++
sample output look like this:
Enter a first unsigned integer: 1234567890
Enter a second unsigned integer, greater than the first: 9876543210
First integer: 00000000 00000000 00000000 00000000 01001001 10010110 00000010 11010010 xxxxxxxx499602D2 1234567890
Second integer: 00000000 00000000 00000000 00000010 01001100 10110000 00010110 11101010 xxxxxxx24CB016EA 9876543210
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started