write a java program that prompts the user to enter a number, its base, and base
ID: 3545555 • Letter: W
Question
write a java program that prompts the user to enter a number, its base, and base to be converted to reads these inputs from the keyboard and stores the number in a double "num", base b in int"b", base a in int "a". uses iteration to calculate the conversion of numa to numb.uses iteration to calculate the conversion of numb to numa, and a the values of the conversions in appropriately formatted and informative manner.
please answer, i will rate
Explanation / Answer
public static void main(String args[]){ Scanner input = new Scanner(System.in); System.out.println(); System.out.println("Enter a number: "); double num = input.nextDouble(); String num1 = Double.toString(num); System.out.println(); System.out.println("Enter base 'a': "); int a = input.nextInt(); System.out.println(); System.out.println("Enter base 'b': "); int b = input.nextInt(); System.out.println(); } public double base10_to_2(double in){ Scanner in = new Scanner(System.in); double a, r , q, c; while ( q > 0 ) q = a/2; r = a%2; int [] r1 = new int [c + 1]; }
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.