Answer:
import java.util.Scanner;
public class Lab{
public static String integerToReverseBinary(int number)
{
String binary = "";
if(number == 0){
return "0";
}
while(number > 0)
{
int remainder = number % 2;
number = number / 2;
binary += Integer.toString(remainder);
}
return binary;
}
public static String reverseString(String wordString)
{
String binaryString = "";
int length = wordString.length();
for(int i = length -1 ; i >= 0 ; i--)
{
binaryString += wordString.charAt(i);
}
return binaryString;
}
Explanation:
In the java source code, the Lab class is defined which has two methods, 'reverseString' and 'integerToReverseBinary'. The latter gets the argument from the former and reverses the content of its string value, then returns the new string value. The former gets the integer value and converts it to its binary equivalence for which are converted to strings and returned.
Answer:
The function declaration to this question as follows:
Function declaration:
//declaring method printFeetInchShort, that accepts two integer parameters
void printFeetInchShort(int numFeet,int numInches) //method
{//method body
printf("The given height is: "); // message printing
printf("%d\'%d\" ", numFeet,numInches); //value printing
}
Explanation:
In the above method (function) declaration a method "printFeetInchShort" is declared, that accepts two integer variable as its parameters.
- This method uses a return type void, which means it will not return any value.
- The parameter "numFeet and numInches" accepts an integer value in the main method and inside the method, it will print its value by a single and double quote.
Answer:
where are the step number. I can't find any