Presentation is loading. Please wait.

Presentation is loading. Please wait.

Some problems for your consideration

Similar presentations


Presentation on theme: "Some problems for your consideration"— Presentation transcript:

1 Some problems for your consideration

2 What’s in a name “Remember that a person's name is to that person the sweetest and most important sound in any language.” from Dale Carnegie’s “How to Win Friends and Influence People” Write a program that writes out your best friend’s name 100 times.

3 What’s in a name “Remember that a person's name is to that person the sweetest and most important sound in any language.” from Dale Carnegie’s “How to Win Friends and Influence People” Write a program that prompts you for a number and then writes out your best friend’s name that many times.

4 Summation Write a program that prompts the user for a positive integer, n, and then calculates the following:

5 Factorial Write a program that prompt the user for a positive integer, n, and then calculates n!.

6 Mean (average) I need a program that calculates the average of student test scores. The program should first prompt for the number of students, s. The program should then prompt for s test scores. Finally, the program should report the average.

7 Babylonian algorithm for square root of n (revisited)
Steps: Make a guess at the answer (you can pick n/2 as your initial guess). Compute r = n / guess. Set guess = (guess+r) / 2. Go back to stop 2 for as may iterations as necessary. The more you repeat steps 2 and 3, the close guess will be to the square root of n. Write a program that inputs n, iterates through the algorithm K times, and outputs the answer.


Download ppt "Some problems for your consideration"

Similar presentations


Ads by Google