That is, an open book exam.
ptr->member
instead of (*ptr).member
.<stdint.h>
, <stdbool.h>
, <stddef.h>
, <stdlib.h>
, and <stdio.h>
.Problem set for Quiz 2 The password for the PDF document is the answer to the question below.
Imagine you are playing the Bulls and Cows game, where "A" indicates a digit is in the correct position and "B" signifies a digit is present but in the wrong position. For example, if your secret number is 4545
and your opponent guesses 5122
, the response would be 0A1B
. This means that no digits are correctly placed and one digit is correct but misplaced. Then, we can construct a hexadecimal integer literal based on the answer, 0x0A1B
.
As you continue playing the Bulls and Cows game, pay close attention to the secret number provided by the instructor. For example, if your opponent guesses 1224, you should retain the hexadecimal integer literal derived from a response of ?A?B
.
In the context of RISC-V assembly, assume that register x10 holds the value constructed from the Bulls and Cows game, which includes the secret number provided by the instructor and the opponent's guess of 1224
. What will be the value in register x12 after executing the following instructions?
Enter the password in all lowercase when inputting it into the PDF document. The value must be represented as a hexadecimal integer literal, starting with 0x
and always in its shortest form. That is, use 0x42
rather than 0x0042
.
Hint: The password is 6 characters long.
For clarity, the C program referenced in Problem C is reproduced below: