SDEV300 Lab2 Solved (2 Solved Ver. attached)

55.00 $

Category:

Description

5/5 - (5 votes)

Week 2 Deliverables

Overview:  This week, you have studied additional Python language syntax including functions The Lab for this week demonstrates your knowledge of this additional Python functionality.

Submission requirements for this project include 2 files. (Zipping them into one file is acceptable and encouraged):

  • Python Command Line Math and Security Related Application Code
  • Word or PDF file containing your test and pylint results

Python Applications for this Lab: (total 100 points):

The first exercise produces a command line menu-driven python application providing users with the ability to perform several math and security related functions. The second part documents your testing and pylint analysis results.

  1. (80 points) Create a menu-driven python application with following menu options for users to run at the command line:

 

  1. Generate Secure Password
  2. Calculate and Format a Percentage
  3. How many days from today until July 4, 2025?
  4. Use the Law of Cosines to calculate the leg of a triangle.
  5. Calculate the volume of a Right Circular Cylinder
  6. Exit program

 

As you put this menu together be sure to adhere to the following guidance and hints:

  1. Create functions to be called sending in the parameters the user enters.
  2. Validate input data to ensure each entry from the user is correct before proceeding.
  3. Prompt the user to reenter information as needed.
  4. The following Python sites are excellent resources for learning more about the string, datetime, secrets, math, and random number libraries mentioned in the readings that you should use as part of this exercise.
    1. https://docs.python.org/3/library/random.html
    2. https://docs.python.org/3/library/secrets.html
  1. https://docs.python.org/3/library/math.html 5. Use comments to document your code
  1. Test with many combinations.
  2. Use pylint to verify the code style – the goal is a 10!

 

Some additional guidance related to your functions created:

1

 

  1. For the secure Password, you should prompt the user for the length of the password to be created, as well as the complexity (i.e. Use of Upper Case, Use of Lower Case, Use of Numbers, Use of special characters). Check out options from commercial password generators such as Norton. (https://my.norton.com/extspa/passwordmanager?path=pwdgen). Note in a command line interface, the input and prompts are just text, so you won’t be creating a GUI, just the functionality that allows the user to enter the information needed.
  2. For the percentage, consider a simple example, where the user has to enter the numerator and denominator and the number of decimal points for formatting. For example, 22, 57, 3 would yield 38.596 percent.
  3. For days until July 4, 2025 the output should just be the number of days. There would be no input other than the selection from the menu
  4. The formula for the law of cosines can be found at sites such as https://www.mathsisfun.com/algebra/trigcosinehtml. You want to solve for c (lower case c) in the following diagram.
  5. The formula for a right cylinder can be found here:

https://www.mathsisfun.com/geometry/prismvscylinder.html.  Be sure to select right circular cylinder.

  1. When exiting the program be sure to thank the user for visiting your application.

 

 

  • menu_options-bkfwrs.zip
  • menu_selection_V2-76ydx6.zip