Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Lab Assignment- Iterations

1. Write a program that keeps asking the user for a password until they correctly name it. Once they correctly enter the password, the program congratulates the user and tells them how many guesses it took. Call the program lastnamePassword.

Example (user input in italics)

What is the password?
monkeys
Incorrect. Guess again.
dishwasher
Incorrect. Guess again.
aardvark
Correct! You got the password, and it took you 3 guesses to get it correct.

2. Write a program that takes a string input from the user and then outputs the word, then the word minus the last letter, then the word minus the second to last letter, etc until it only prints the first letter. Name the program lastNameDown. ?

Extra: After going down to one letter, print the opposite back up to the full word - if you do this name your program lastNameDownUp.

Input: Computer
Output:
Computer
Compute
Comput
Compu
Comp
Com
Co
C

3. Write a program that asks the user for an integer input, and prints out all of the Fibbonacci numbers below that input. Each number in the Fibbonacci sequence is found by adding the two previous ( 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, etc) Name the Program lastNameFibb.

Enter an integer: 20

1
1
2
3
5
8
13

That is all of the Fibbonacci numbers below 20.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92746775

Have any Question?


Related Questions in Computer Engineering

Can someone help me identify how intrustion detection

Can someone help me identify how Intrustion detection system and intrusion prevent system can help protect confidentiality, integrity and availability

Question suppose that you receive an email from someone

Question : Suppose that you receive an email from someone claiming to be Alice, and the email included a digital certificate that contains M = ("Alice", Alice's public key) and [h(M)]_CA, where CA is a certificate author ...

Question suppose an instruction can be carried out in 3

Question : Suppose an instruction can be carried out in 3 stages, the stages taking 3 ns, 7 ns, and 10 ns, respectively. (a) What is the maximum execution rate without pipelining? (b) What speedup is possible with pipeli ...

Research ways that information systems have been misused

Research ways that Information Systems have been misused. Using the Internet, find an example of an organization that has misused Information Systems. Post your response to the discussion board. Respond to the following ...

The average cell phone bill is 78 with a standard deviation

The average cell phone bill is 78 with a standard deviation of 10. What is the minimum percentage of cell phone bills that will be between 54 and 102?

Please respondexplain the properties and characteristics of

PLEASE RESPOND Explain the properties and characteristics of Transmission Control Protocol/Internet Protocol (TCP/IP).

The cost of a new piece of equipment is 42000 it is

The cost of a new piece of equipment is $42000. It is expected that the new piece of equipment will lead to cash flows of $17000, $29000, and $40000 over the next three years. Discount rate is 12% what is the net present ...

Suppose that an algorithm takes 30 seconds for an input of

Suppose that an algorithm takes 30 seconds for an input of 224 elements (with some particular, but unspecified speed in instructions per second). Estimate how long the same algorithm, running on the same hardware, would ...

A group of students made the following scores on a 10-item

A group of students made the following scores on a 10-item quiz in psychological statistics: {5, 6, 7, 7, 7, 8, 8, 9, 9, 10, 10} What is the variance, treating these scores as a sample?

Decision support systems vary greatly in application and

Decision support systems vary greatly in application and complexity, but they all share specific features. A typical Decision support systems has four components: data management, model management, knowledge management a ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As