Answer:
Explanation:
The following code is written in Python it doesn't use any loops, instead it uses a recursive function in order to continue asking the user for the inputs and count the number of positive values. If anything other than a number is passed it automatically ends the program.
def countPos(number=input("Enter number: "), counter=0):
try:
number = int(number)
if number > 0:
counter += 1
newNumber = input("Enter number: ")
return countPos(newNumber, counter)
else:
newNumber = input("Enter number: ")
return countPos(newNumber, counter)
except:
print(counter)
print("Program Finished")
countPos()
create a forecast, Excel creates a new worksheet that contains both a table of the historical and predicted values and a chart that expresses this data. A forecast can help you predict things like future sales, inventory requirements, or consumer trends.
Answer:
The code is given below
Explanation:
The correct syntax would be to place appropriate parenthesis.
(month==1?"jan":(month==2?"feb":(month==3?"mar":(month==4?"apr":(month==5?"may":(month==6?"jun":(month==7?"jul":(month==8?"aug":(month==9?"sep":(month==10?"oct":(month==11?"nov":"dec")))))))))));
Similarly, you can also use the following code:
String[] months = { "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec" };
int month = 1;
String monthDescription = months[month - 1];
To convert binary fraction to decimal fraction, we first write the given
.1011 (base 2)
The process of conversion is to break down to its decimal constituent,
.1011 (base 2) = (1*2^-1)+(0*2^-2)+(1*2^-3)+(1*2^-4)
.1011 (base 2) = 0.5 + 0 + 0.125 + 0.0625
.1011 (base 2) = 0.6875 (base 10)
<em>ANSWER: 0.6875 (base 10)</em>