You should state what language you want your answer to be in before you ask programming questions. Here is what you're looking for in Java:
<span>public static String replace(String str) {
return str.replace(' ', '*')<span>;
</span>}</span>
Explanation:
The string "1301" can be converted into numbers by using the ASCII characters set.
1. Decimal ASCII
1=49, 3=51, 0=48, 1=49
Without space
"1301" = 49 51 48 49
with space included
"1 3 0 1" = 49 32 51 32 48 32 49
(white space is represented by 32 in Decimal ASCII)
2. Hexadecimal ASCII
1=31, 3=33, 0=30, 1=31
Without space
"1301" = 31 33 30 31
with space included
"1 3 0 1"= 31 20 33 20 30 20 31
(white space is represented by 20 in hexadecimal ASCII)
The magnitude can be found by traditional decimal to binary conversion (Divide by 2 until we are left with remainder 0 or 1) and sign can be represented by adding most significant bit (MSB) 0 for positive and 1 for negative.
A. -27
Magnitude: 00011011
Since the sign is negative add 1 to the MSB
which becomes 100011011
B. 140
Magnitude: 10001100
Since the sign is positive add 0 to the MSB
which becomes 010001100
C. -99
Magnitude: 01100011
Since the sign is negative add 1 to the MSB
which becomes 101100011
D. 46
Magnitude: 00101110
Since the sign is positive add 0 to the MSB
which becomes 000101110
You can just look up "python ide online" on google and paste this code:
n = -1
count = 0
while n < 0:
n = int(input("We're checking to see if a number is prime or not! Enter a positive number: "))
if n % 2 == 0:
if n == 2:
print("{} is a prime number".format(n))
else:
print("{} is not a prime number".format(n))
else:
for x in range(n, 1, -1):
if n % x == 0:
count += 1
if count > 1 or n == 1:
print("{} is not a prime number".format(n))
else:
print("{} is a prime number".format(n))
I've written some code that checks to see if a number entered by the user is a prime number or not.
Sorry, but I'm not too good with pseudocode plans and all that. I hope this helps.
Answer:
A. Relative cell reference.
Explanation:
A relative cell reference is like a pointer to a cell or range of cell in Excel. In Excel all cell references, by default, are relative cell references.
In the given instance, the cell address A4 in a formula means it is a relative cell reference. If there would have been a $ sign before A4, then it will be an absolute cell reference. But since, it is without dollar sign, it is a relative cell reference.
Therefore, option A is correct.