Write a C++ program reflecting Figure 8 2 using the data in Figure 8 1 that asks
ID: 3821192 • Letter: W
Question
Write a C++ program reflecting Figure 8 2 using the data in Figure 8 1 that asks the user to input a memory address and then displays the output on the screen When you run the program, you will see that you are prompted to input an address and the corresponding output will be displayed. Then you are prompted to input another address and then its output is printed on the screen, so on. -Use 300020, 300040, 350010, 420940, and 430070 as the input addresses the CPU send Your outputs should be: "Your input is not acceptable because of addressing error by base register value", "Your input is not acceptable because of addressing error by base + limit registers", or "Your input is a correct logical address in memory". For example, when "300040" is entered as input, then "Your input is a correct logical address in memory" should be displayed on the screen.Explanation / Answer
Explanation can be found within the code as comments. #include using namespace std; int main() { unsigned long base = 300040u; unsigned long base_limt = 420940u; string error_by_base_register = "Your input is unacceptable because of addressing error by base register value "; string error_by_base_limit_register = "Your input is unacceptable because of addressing error by base+limit register value "; string correct_logical_address = "Your input is a correct logical address in memory. "; long input_address; while (true) { cin >> input_address; //loop breaking condition. if(input_address == -1 ){ coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.