Description
Suppose a program has a certain number of instructions, which on average execute in a given time. Write a Java program that simulates the execution of instructions on a typical computer. Use the “standard” execution time values in the sample below. Use four instance variables to store these values as time variables. No user input is necessary.
AssignmentExecutionInstructions/ExecutionTime.java
Instructions/ExecutionTime.java
Write a Java program that simulates the execution of instructions on a typical computer. Use the “standard” execution time values in the sample below. Use four instance variables to store these values as time variables. No user input is necessary.
Sample execution: Assumed number of instructions to execute: 10000 Assumed execution time of each instruction: 10.0 ns Assumed clock speed: 3.0 GHz Assumed number of instructions per cycle: 1 Total execution time = 1.667 x 10^-4 seconds
Notes:
- The program must compile without syntax errors; in the best case 50% of the assignment points will be deducted, and if your program is “essentially” correct.
- To get full credit for an assignment, your program must show the assignment problem completely.
- Programs should be easy to execute and run. Your program should have a reasonable amount of comments.
- At the very beginning of the file, there should be a block comment containing the student’s name, assignment number, and date.
- Follow good programming style and guidelines discussed in class, such as using meaningful names for variables and using comments to describe variables, classes, methods, etc.