about | help | code help+videos | done | prefs |
The speed of a computer is often (simplistically) expressed in gigahertz (GHz), the number of billions of times the computer's internal clock "ticks" per second. For example, a 2 GHz computer has a clock that "ticks" 2 billion times per second. Suppose that a single computer instruction requires 3 "ticks" to execute. Write a function time(instructions, speed) that returns the time in seconds required to execute instructions instructions on a computer running at speed gigahertz. For example, time(1e9, 3) should return 1 (second). time(0, 1) → 0.0 time(10000, 1) → 3.0E-5 time(1.0E9, 3) → 1.0 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy