I believe it's 5 spaces for an indent. If that's incorrect plz forgive me lol.
Answer:
CLS
M=2
SUM=0
DO WHILE M<=50
SUM=SUM+M
M=M+2
LOOP
PRINT " The sum of all even numbers between 1 and 50 is"; sum
Answer:
System of linear equations is solved below and explained in detail.
Explanation:
Part a:
M = [1 3 5 2; 2 -4 7 -3; 0 -4 -7 3; 5 -3 2 1];
c = [7; -3; -1; 0];
Part b:
The statement used for the solution of system of linear equation will be:
X = linsolve(M,c)
where X will give the values of x1, x2, x3, x4 respectively.
Part c:
The system is solved in matlab using above equation and the results are attached in a file.
The values for X are:
x1 = -2/7
x2 = 3/7
x3 = 4/7
x4 = 11/7
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>