Your cart is currently empty!
This lab is your first challenge lab. What that means is that it is OPTIONAL. If you decide to do it and you are successful, you can obtain up to 50 points to be added to your total number of lab points. This will definitely increase your final grade for labs! Important: since this is…
This lab is your first challenge lab. What that means is that it is OPTIONAL. If you decide to do it and you are successful, you can obtain up to 50 points to be added to your total number of lab points. This will definitely increase your final grade for labs! Important: since this is an optional lab, you are expected to work on it outside your lab sessions, unless you are completely done with the current assigned lab. We hope you enjoy being challenged! |
This lab is not in replacement of the regularly assigned labs. Regularly assigned labs should be your priority and only once you are done, you should work on this challenge lab. You should expect to work about 3 to 4 hours to complete this assignment.
description. Converting numbers to different bases.
In this activity, you will design a method called Conversion whose aim is to practice the conversion of numbers from one given base to another base.
Method Conversion takes the following inputs:
And it returns the number, given in the original base, now translated in the target base.
Note: the base numbers can be anything between 2 and 36.
Examples:
Conversion(111,2,10) 7
Conversion(31,10,2) 11111
Conversion(A3,16,10) 163
Conversion(1A,16,2) 11010
Conversion(27,10,16) 1B
Important note: When manipulating the number given as an input, you are not allowed to use built-in functions from Java, outside of length() (for Strings), possibly charAt() (for Strings), power function, floor/ceiling.
What you have to turn in:
Important notes:
That’s it! Looking forward to seeing you in lab!