Questions
Instructions Complete the program below. The program should be turned in as a .py file. Please...

Instructions

Complete the program below. The program should be turned in as a .py file. Please turn in the .py file itself (do not take a picture of it or copy/paste it into another program). Please also turn in the output for your program. The output should be in a different file. You may find the easiest way is to take a screenshot of your output. You can use the snipping tool on Windows or the grab tool on a Mac to take pictures of your output. You may want to put all of your output pictures in a single Word file.

Criteria for Success

Please view the rubric to ensure you are completing everything you need. You are required to use functions. In addition, make sure the output examples you turn in show a variety of test cases. You can create a test() function in your program to prove the majority of your code works.

Password Validator

When users create a new account on a website, they are often asked to create a new password. Many websites then test the password to make sure it is strong enough before allowing a user to save it. If it's not strong enough, the user needs to create a new password.  

In this program, you will ask a user for a username/password combination and test for password strength according to the following rules:

  • Must be at least 8 characters and less than 21 characters (20 characters is OK, 21 is not)
  • Must contain both an upper and lowercase letter
  • Must contain a digit (0-9)
  • Must contain a punctuation mark (!+.@$%*)
  • Must ONLY consist of letters (A-Z), (a-z), digits (0-9) and !+.@$*.

Your program will prompt for a username. Then, it will prompt for a password. Your program should check the password. If the password is OK, print "Good Password!" and end the program. If the password is NOT OK, print the appropriate message to the user. Continue reprompting until the user successfully picks a good password.

If there are multiple problems with the password, you only need to report one.

Consider: Is this the most user-friendly approach?

No. It's not. But it does seem some websites continue to hassle the user this way, while others let the user know up front what is expected... And give better error messages than these, often reincluding what is required. I prefer those sites. However, I want you to write the code that can give specific errors.

Obvious Password

Rule: If a password contains 1 or more of the following Strings (ignore case):

  • password
  • 1234
  • 111111
  • Qwerty123
  • Abcd99
  • football
  • dragon
  • letmein
  • iloveyou
  • admin
  • login
  • welcome
  • flower
  • zaq1
  • Password1

Message to user: Don't use common passwords

Too Short Password

Rule: Password must be at least 8 characters long

Message to user: Password must be at least 8 characters long

Too Long Password

Rule: Password must be less than 21 characters long

Message to user: Password must be less than 21 characters

Low Complexity Password

Rule: The password must contain at least 1 character each of:

  • lowercase letter
  • uppercase letter
  • digit
  • punctuation mark (!+.@$%*)

Message to user: Passwords must contain both upper and lower case letters, at least one digit and at least one punctuation mark (!+.@$%*)

Unrecognized Character

Rule: Your company's back-end systems don't like certain characters. Therefore, the password must only contain:

  • Letters (A-Z) or (a-z)
  • Digits (0-9)
  • Punctuation (!+.@$%*) (no parentheses)

Message to user: Password contains an Invalid Character

Other Issues

Rule: If the password has one of the following issues, alert the user of the issue and have them choose a new one.

  • Password contains the username (ignoring case)
  • Password is the same as the username spelled backwards (ignoring case)

Message to User: Passwords can't contain a variation of the username

Pig Latin Translator

Write a program that asks the user for a sentence and converts it to Pig Latin. The below explains how to convert to Pig Latin:

If the first letter is a vowel (a, e, i, o, u):

  • Add "way" to the end of the word.

If the first letter is a consonant (treat the letter "y" as a consonant):

  • Remove the first letter and place that letter at the end of the word. Then append the string "ay" to the end of the word

Words that have their first letter capitalized, should continue to have the (possibly new) first letter capitalized.

Sentences end with a period (.), an exclamation point (!) or a question mark (?). Make sure the punctuation continues to stay at the end of the sentence.

English Pig Latin
sleep leepsay
the hetay
python ythonpay
computer omputercay
pig igpay
Latin Atinlay
if ifway
other otherway
only onlyway
apple appleway

Sentences occassionally have other punctuation such as commas (,) and semicolons (;). Make sure these punctuation marks stay put.

For example:

Original sentence: Hello World!
Right: Ellohay orldway!
NOT: elloHay orld!Way

Original sentence: To be, or not to be?
Right: Otay ebay, orway otnay otay ebay?
NOT: oTay e,bay orway otay e?bay

You only have to deal with the 5 punctuation marks mentioned (. ! ? , ;)


PUTHON PROGRAM

In: Computer Science

Of 250 adults selected randomly from one town, 72 of them smoke. Construct a 95% confidence...

Of 250 adults selected randomly from one town, 72 of them smoke. Construct a 95% confidence interval for the true percentage of all adults in the town that smoke

In: Statistics and Probability

. The mean monthly mortgage paid by all home owners in a town is $2365 with...

. The mean monthly mortgage paid by all home owners in a town is $2365
with a standard deviation of $340. Use Chebyshev’s Theorem to find the
following quantities.
(a) (2 points) The minimum percentage of all home owners in this town
who pay a monthly mortgage of $1685 to $3045.
(b) (3 points) The interval that contains the monthly mortgage pay-
ments of at least %84 of all home owners in this town.

In: Statistics and Probability

The Sacramento area was founded on the prospect of gold. Gold discovery in nearby Coloma brought...

The Sacramento area was founded on the prospect of gold. Gold discovery in nearby Coloma brought countless people west with hopes of richer days and better choices for their families. In collaboration with a local merchant Sam Brannan, John Sutter and his family founded the city of Sacramento in 1848. In April of 1849, the population of the area was estimated at 150 people. By October of the same year, the population grew to a whopping 6,000 people (Wiegand, 1998). In mid-October of 1850 it is reported that a riverboat named the “New World” arrived in the area with a single passenger carrying the deadly cholera disease. As a result of exposure to cholera, reports indicated that within three weeks 800 people died of the disease. Many of those that perished are buried in a common grave located at the Old City Cemetery located at 1000 Broadway Street in Sacramento. Approximately 80 physicians were working during the time of the cholera outbreak, and 17 died from cholera within a year after initial exposure (Old City Cemetery, 2005). What type of outbreak is this? Explain and include aspects of how exposure occurred, description of whether it is epidemic, pandemic, or endemic, type of exposure etc.

In: Biology

IN PYTHON 1) Pig Latin Write a function called igpay(word) that takes in a string word...

IN PYTHON

1) Pig Latin

Write a function called igpay(word) that takes in a string word representing a word in English, and returns the word translated into Pig Latin. Pig Latin is a “language” in which English words are translated according to the following rules:

  • For any word that begins with one or more consonants: move the consonants to the end of the word and append the string ‘ay’.

  • For all other words, append the string ‘way’ to the end.

  • For the above you can assume that ‘a’, ‘e’, ‘i’, ‘o’, and ‘u’ are vowels, and any other letter is a consonant. This does mean that ‘y’ is considered a consonant even in situations where it really shouldn’t be.

For this exercise, you can assume the following:

  • There will be no punctuation.

  • All letters will be lowercase

  • Every word will have at least one vowel (so we won’t give you a word like “by”)

Write a helper function that finds the index of the first vowel in a given word, and use that in your main function.

Hints:

  • To find the index of the first vowel in a given word, since you’re interested in the indexes, looping through the indexes of the string using range, or enumerate, or a while loop may work better than a direct for loop on the characters.

  • Use slicing to break up the string into all of the letters before the vowel, and all of the letters from the vowel onwards.

Examples:

>>> igpay('can')

'ancay'

>>> igpay('answer')

'answerway'

>>> igpay('prepare')

'eparepray'

>>> igpay('synthesis')

'esissynthay'

In: Computer Science

In a nuclear fusion reactor two nuclei of deuterium merge, forming a nucleus of helium. The...

In a nuclear fusion reactor two nuclei of deuterium merge, forming a nucleus of helium. The mass of the deuterium nucleus, expressed in units of atomic mass (u), is 2.0136u and of the helium nucleus is equal to 4.0015u (1u = 1.6605 × 10-27 kg). Determine the amount of energy released when 1.0 kg of deuterium is merged. Answer: 5,74 × 1014 J.

In: Physics

Controllership in Accounting Employment Rules vs Personal & Privacy Concerns Characters:         Sandy, the controller of...

Controllership in Accounting

Employment Rules vs Personal & Privacy Concerns

Characters:         Sandy, the controller of ABC, Inc., a small manufacturing company

Jacob, the controller of Micro, Inc., a small manufacturing company

Sandy is a controller of ABC, Inc., a small regional manufacturing company. During her

four years of employment at ABC, she has worked her way up through the ranks. She has

been the controller for the past year and has consistently received favorable evaluations.

Sandy enjoys her work and is good at what she does.

ABC, Inc., is close to finalizing a merger with Micro, Inc., a similar manufacturing company.

The merger will be finalized in two weeks, on July 1. When the companies merge, various

positions will be eliminated to avoid duplication of efforts in the merged company. A variety

of positions will be cut, including manufacturing workers, office staff, and management

positions. The decisions on personnel cuts will be announced August 1.

Jacob, the controller of Micro, Inc., has been with that company for less than a year. He is

perceived favorably by management. The newly merged company will need only one

controller, and Sandy has received unofficial confirmation that she will be the controller of

the new firm and that Jacob will be dismissed.

Sandy has had significant responsibility for her parents during the past two years. Her

father has terminal cancer, and the specialist has given him only six months to live. Her

mother is emotionally distressed and needs special attention from time to time. In addition,

after years of trying, Sandy has recently found out that she is pregnant. She plans to take a

short maternity leave and then return to work full-time.

Sandy realizes the time demands of her current and experted family and also the time

demands of working as the controller of the newly merged company. She feels that she will

be able to balance her personal and professional life in such a way that her job performance

will not suffer. Yet, she wonders if she should make her boss aware of her responsibility to

her parents and her pregnancy.

Answer the following questions from the case above :-

1. What are the relevant facts of the case?

2. What, if any, are the ethical issues?

3. Who are the stakeholders?

4. What are the possible alternatives including any ethical concerns?

5. What are the practical constraints?

6. What action(s) should be taken?

In: Accounting

Match the research design to the correct test statistic. Each research design may be used more...

Match the research design to the correct test statistic. Each research design may be used more than once.

Jack Pearson is interested in whether race of applicant (Black, Hispanic, White, Asian) and the type of college (Ivy League, HBCU, Public, or Private-Liberal Arts) impacts the amount of financial aid an applicant is awarded.

Donald Trump is interested in how his Twitter activity impacts his approval ratings. He gathers a group of 1000 followers, shows them his Twitter activity on a particularly heavy activity day (20+ tweets in a day), measures their approval ratings, and then shows them his Twitter activity on a slow day (less than 2 tweets in a day), and measures their approval ratings again.

Professors are interested in the relationship between location of parking spots and quality of cars.

The Philadelphia Eagles are interested in how a quarterback change can impact the number of points scored in a football game. They follow the number of points the Eagles score in the first half of the season with Carson Wentz as quarterback, and the number of points the Eagles score in the second half of the season with Nick Foles at quarterback and analyze how they changed.

Federal prosecutors are interested in whether the leniency of plea deals (strict, moderate, lenient, illegally lenient) will impact the likelihood that high profile defendants will plead guilty.

The Yankees are interested in the impact of age started playing baseball (pre-elementary school, elementary school, middle school, high school) and muscle strength (low, moderate-low, moderate-high, high, super high) on batting average.

Betty is interested in how the information about the Black Hood (a serial murderer) is given to citizens of the town (via text versus via newspaper) of Riverdale will impact how scared they become on a scale of 1 (Come and get me, Black Hood; I’m not scared of you) to 10 (I’m never leaving the confines of my barricaded house again).

Researchers are interested in the impact of crime show watching on jurors’ expectations of forensic evidence in a trial. They compare importance ratings of forensic evidence between those jurors who watch crime shows and those who don’t.

In the NYC subway system, a subway train is, on average, 5 minutes late. The NYC transit authority thinks a new signal system may improve on-time performance, but have some serious budget concerns. On Monday, they measure how late all trains are with the old signal system, on Tuesday, they measure how late all trains are with a new, expensive signal system, and on Wednesday, they measure how late all trains are with a new, less expensive signal system.

Retailers are interested in the relationship between Christmas music prevalence on the radio and sales in the month of December.

Stockton wants to evaluate whether new students’ understanding of consent increases as a result of an in-depth sexual assault training at orientation. They give the students a survey about consent before the training and then again after the training to see if there is an increase in their understanding.

Doctors in an uncivilized country with no medical ethics laws are interested in how effective different treatments are for Ebola. They take a group of patients with Ebola, give them no treatment and monitor their progress, then 1 week later, give them Treatment A and monitor their progress, and then 1 week later, give them Treatment B and monitor their progress.

A.

Factorial ANOVA

B.

Dependent samples t-test

C.

Correlation

D.

One-way ANOVA

E.

Independent samples t-test

F.

Repeated Measures ANOVA

In: Statistics and Probability

The accompanying table describes results from groups of 8 births from 8 different sets of parents....

The accompanying table describes results from groups of 8 births from 8 different sets of parents. The random variable x represents the number of girls among 8 children. Complete parts​ (a) through​ (d) below. LOADING... Click the icon to view the table. a. Find the probability of getting exactly 1 girl in 8 births.Number of Girls x ​P(x) 0 0.002 1 0.028 2 0.117 3 0.217 4 0.272 5 0.217 6 0.117 7 0.028 8 0.002

In: Statistics and Probability

The accompanying table describes results from groups of 8 births from 8 different sets of parents....

The accompanying table describes results from groups of 8 births from 8 different sets of parents. The random variable x represents the number of girls among 8 children. Complete parts​ (a) through​ (d) below. . Find the probability of getting exactly 1 girl in 8 births. ​P(x) Number of Girls x P(x) 0 0.002 1 0.022 2 0.117 3 0.227 4 0.264 5 0.227 6 0.117 7 0.022 8 0.002

In: Statistics and Probability