Mr. Gottsacker
Computer Programming
Write a program that prints out the following converstion table of light years to astronomical units (the distance from the Earth to the Sun). Note that one light year is 63241.077 astronomical units.
Light years Astronomical Units
1 63241.08
2 126482.15
3 189723.23
...
9 569169.69
10 632410.77
Write a program that prints out the following conversion table of nautical miles to miles. Note that one nautical mile is 1.151078 miles.
Nautical miles Miles
1 1.151078
5 5.755390
10 11.510780
15 17.266170
...
495 569.783610
500 575.390000
Write a program that prints out the winningest soccer team given a series of team names and their number of wins in the season. Prompt the user to enter the number of teams that are in the league. Then, collect each team's name and their number of wins in the season. Then, display the name of the team with the most wins.
Use a while
loop to find the largest integer n
such that n^3
is less than 14,000.
Exercise_2_13
Rewrite Exercise 4.102, taking advantage of loops. When the program is first run, prompt the user to enter the number of quizzes that they would like to take. Each quiz should generate two integers between 10 and 20, and prompt the user to answer the sum of them. After the last quiz, output the user's score to two decimal places.
Rewrite Exercise 4.103, taking advantage of looping. The user should enter a password with any number of characters. The password must contain at least one of the following:
Shift + [number]
)Rewrite Exercise 4.104, taking advantage of looping. Prompt the user to enter a password of any length. Transform the password to make it stronger. Specifically:
character | leet |
---|---|
a or A | @ |
e or E | 3 |
s or S | $ |
o or O | 0 |