You have written a new program in assembly language, using only 4 types of instructions. Let’s call them types A, B, C, and D. Your program consists of 20% type A instructions, 40% type B, 30% type C, and 10% type D. You timed the program and it takes 100 seconds on your laptop.
A. Your friend suggests replacing all the type D instructions with another type, E, which is 10x faster. How long will the improved program take to run?
B. Consider the original program (no type E instructions). You are considering buying a new laptop which happens to execute type B instructions faster. How much faster (by what factor) must it execute type B instructions to get a total running time of 80 seconds? Assume that the new laptop executes types A, C, and D the same as your old laptop.
Submit via Gradescope.