Answer:
public class Brainly
{
public static void main(String[] args)
{
BinaryConverter conv = new BinaryConverter();
String binStr = "01001101";
System.out.print(binStr + " in decimal is "+conv.BinToDec(binStr));
}
}
public class BinaryConverter
{
public int BinToDec(String binStr)
{
int d = 0;
while(binStr.length() > 0)
{
d = (d << 1) + ((binStr.charAt(0) == '1') ? 1: 0);
binStr = binStr.substring(1);
}
return d;
}
}
Explanation:
The program "eats" the string from left to right, and builds up the integer representation in variable "d" on the go. While there are digits left, it shifts the previous result to the left and sets the least signficant bit to 1 only if the corresponding string character is a 1.
Answer:
The answer is C. 85
Explanation:
The int() function is usually used to turn a float, to an int<em>.</em> When you use the int() function, it just cuts of everything past the decimal. It doesn't round the float. Leaving you with the option C. 85
hope this helped you :D
This question is a bit ambiguous as there were a few features that were added and any could be perceived as distinguishing depending on what you look for in your OS. I do believe this is in reference to the Wikipedia article on Windows 2.0 though as the first two listed features make note of Windows 1.0 specifically, therefore:
Windows 2.0 allowed windows to overlap, Windows 1.0 could not do this.
Windows 2.0 introduced new and more complex keyboard shortcuts and terminology such as "Minimize" and "Maximize" vs. Window 1.0's "Iconize" and "Zoom"
Source: https://en.m.wikipedia.org/wiki/Windows_2.0