Answer:
no
Explanation:
click on the picture to make it bigger
Answer:
Release the mouse in the desired location.
Handle the print outside of the factorial function, which only needs one userVal when called.
int factorial( int foo )
{
if( foo == 1 )
return 1;
else
return( foo * factorial( foo - 1 ) );
}
True.
Pseudo-code (false code) is just for a preliminary "drawing" of the logic needed.
Here's a solution that works except for the leading zeros. Unclear (to me) why they need to be there and what's the logic?
public static void main(String[] args)
{
int number, base;
Scanner Cin = new Scanner(System.in);
System.out.print("Enter a decimal number between 1 and 100,000: ");
number = Cin.nextInt();
System.out.print("Enter a base from 2-16: ");
base = Cin.nextInt();
System.out.format("The number %d in base %d is %s.", number, base, Integer.toString(number, base).toUpperCase());
}