tritech programming assignment

popismooth

Write a short application that uses a ‘for’ loop to iterate through 21 cycles (i.e. 0 through 20). With each iteration, the number of the iteration should show to the console window. That was the easy part; now for something more challenging. With each iteration of the ‘for’ loop, tell me if the iteration is an odd number or an even number. Print the words: “ is an odd number” or “ is an even number” after the iteration count. So, the output should look like the following:

 

0

0 is an even number

1

1 is an odd number

2

2 is an even number   … and so forth all the way to 20.

 

Bonus Problem: Now, I have a bonus problem for you. It is worth 5 extra points on any graded assignment. It may be worth 10 points if you convince me that you solved it on your own and did not ask someone (or the WWW) for the answer. Here is the problem statement:

 

Prompt the end user for a 7 number sequence password. In your code, the seven number sequence is: 3, 7, 11, 17, 21, 26, 32. The sequence of numbers must be given (input to the console) in this order on the same line. If the sequence of numbers is given correctly, then tell the end user they have gained access to the network. If the end user misses any number – either gets a number wrong, does not input the correct sequence of numbers, or whatever – then two things should happen:

1.     An alarm sounds (i.e. a beep will sound 3x). Hint:  Beep() is a method in C#

2.     You tell the end user that they have entered an incorrect value.

 

    • 11 years ago
    • 15
    Answer(1)

    Purchase the answer to view it

    NOT RATED
    • cprograming_1.docx
    Bids(1)
    other Questions(10)