Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(15 marks) P3: Computer Simulation Focus: OOP composition, several classes work together to achieve an objective, helper methods The objective of this lab will be
(15 marks) P3: Computer Simulation Focus: OOP composition, several classes work together to achieve an objective, helper methods The objective of this lab will be to combine the work previously done in labs P1 and P2 in order to build our complete simulator. MEMORY Computer 0 0799 0798 0198 0499 1008 1108 0899 0909 0898 Input Device 2 3 Program Counter 5 6 7 8 9 CENTRAL PROCESSING UNIT Instruction Register Accumulator Output Device ks] rking end (A) A basic computer simulator: Using the computer information previously provided, we could deduce that the simulated computer will be represented by a new class Computer that contains at least the following Four private attributes for: - A Memory object Three Register objects, one in each category (IR, PC, and ACC) A constructor to create the above objects and initialize them . Methods that can be used to execute a program as follows * A method run () to run the program loaded into memory. This method should perform the following steps a) Load a program into the memory. For now, we will load the default program discussed in lab P1. That is, use the method LoadMemory created in the Memory class from Lab P1 to load the default program
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