Something like the following. Also you need to give what language you are using. Anyways, you should be able to convert this to your language of choice.
<script type="text/javascript">
function checkGeneration() {
var gen = ["Baby Boomer ","Generation X","Xennials","Generation Y"];
var reversestr = "";
var getyear = window.prompt("Enter a 3 digit number: ");
if (parseInt(getyear) <= 1964) {
alert(gen[0]);
} else if(parseInt(getyear) <= 1979) {
alert(gen[1]);
} else if(parseInt(getyear) <= 1985) {
alert(gen[2]);
} else if(parseInt(getyear) <= 1995) {
alert(gen[3]);
}
}
checkGeneration();
</script>
Answer:
The following are code in the Java Programming Language.
//define boolean type function
boolean isReverse(int ar[], int b[])
{
//declare integer type variable
int x;
//set the for loop
for (x=0; x < ar.length && ar[x] == b[ar.length-1-x]; x++);
return x == ar.length;
}
Explanation:
<u>The following are the description of the code</u>.
In the above code that is written in the Java Programming Language, we define the boolean data type function that is 'is Reverse()' and pass two array integer data type arguments that is 'ar', 'b' in the then, declare integer data type variable that is 'x'. Set the for loop that the boolean type value is true or false.
Answer:
Please kindly check explainations for the code.
Explanation:
lw $t1, Num1
lw $t2, Num2
lw $t3, Num3
blt $t1, $t2, if
beq $t1, $t2, elseif
else:
add $t0, $t3, 5
sw $t0, Result
endif:
#.....other statements after if-elseif-else
if:
sw $t1, Result
b endif
elseif:
ble $t2, $t3, if2
or $t0, $t1, $t3
sw $t0, Result
b endif
if2:
and $t0, $t2, $t3
sw $t0, Result
b endif
Go to attachment for the onscreen code.