1. Engineering
  2. Computer Science
  3. this is written in python gtgtis a high school computer...

Question: this is written in python gtgtis a high school computer...

Question details

THIS IS WRITTEN IN PYTHON >>IS A HIGH SCHOOL COMPUTER SCIENCE COURSE. NOT TOO COMPLICATED PLEASE

QUESTION #1

Write a program to generate passwords. The program should ask the user for a phrase and number, and then create the password based on our special algorithm. The algorithm to create the password is as follows:

  1. If the user’s input word is less than 8 characters, output “Password not long enough.”
  2. If the user’s input word is greater than or equal to 8 characters, do the following:
    1. Replace e’s with @
    2. Replace s or S with $
    3. Replace t or T with +
    4. Capitalize the word and add the number to the end.

Sample Run

Enter your word: zebras
Enter a number: 62
Password not long enough. 

Enter your word: newyorkcity
Enter a number: 892
Password: N@wyorkci+y892

QUESTION #2

Write a program to find the average of the numbers stored in NewYorkTemps.txt (Down Below!). Be sure your output uses floating point numbers (i.e. numbers with decimals).

56.0
57.5
58.4
70.3
51.2
68.5
93.2
57.8
55.0
45.3
68.7
42.1
20.0
21.1
25.5
26.6
30.3
33.2
31.6
32.8
54.5
50.2
45.5
36.6
24.2

QUESTION #3

Write a program to input ten book titles and author’s names then save them to a file named book.txt.

For each book, the user will first input the title, then input the first name, then the last name of the author, all on separate lines. In addition to saving the books in the file, please output, using the print method. the information you've gathered from the user.

You should follow this format for your output:

Format:

TO KILL A MOCKINGBIRD Lee, Harper

All book titles should be in upper case and the author’s name should be capitalized.

QUESTION #4

Write the code to find the average of the values stored in the text file temperatures.txt. All data in the file are float values.

Sample Output

The average temperature is: 58.36

Test Data

*average is pulled from temperatures.txt located in Google Drive*
The average temperature is: 48.005

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution