Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 users input word is less than 8 characters, output Password not long enough.
  2. If the users input word is greater than or equal to 8 characters, do the following:
    1. Replace es 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 authors 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 authors 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions

Question

What is the "typical" business cycle stock price relationship?

Answered: 1 week ago