Write a program that is able to convert between clock rates in: hertz (Hz), kilohertz (kHz), megahertz (MHz) and gigahertz (GHz).
Bonus exercise: considering a 4-core processor that performs 6 instructions per cicle or 2 floating point operations per cycle, your program should also convert between FLOPS, IPS and their multiples: kFLOPS, kIPS, MFLOPS, MIPS, GFLOPS and GIPS.
Each line of input is given in the format
<n> <unit1> in <unit2>.
Units are given by their abbreviations:
Input is no larger than
For each line of input there should be a line of output with the corresponding result. Output should be rounded to one decimal place which should always be present.
3.3 GHz in MHz 100000 kHz in GHz 1.5 GHz in GFLOPS 1.5 GHz in MIPS
3300.0 MHz 0.1 GHz 12.0 GFLOPS 36000.0 MIPS
Double precision floating point arithmetic should be enough to get you a full score.
try first: bconv
Copyright © 2020-2021 Rudy Matela
All rights reserved