Week_4 - johnelwart/Projects GitHub Wiki

Home

Homework 14: Calculate Change

Description: This program takes two strings from the user containing the amount owed and the amount paid at a restaurant. Those values are extracted out of the strings and used to check if enough was paid and then, if enough was given, calculate how much change needs to be given, if any, and prints it to the screen.

Input(s): Two strings containing the amount owed and paid

Output(s): The change owed or message saying not enough was paid

Source Code

Homework 15: Password Validator

Description: This program checks if a password fulfills a predetermined set of guidelines given in the assignment. These include:

  • Longer than 12 characters
  • At least one uppercase letter
  • At least one lowercase letter
  • At least one number
  • At least one special character (~`!@#$%^&*()_-+={}[]<>;:,.?)

This program also has a tester file to check if it is written correctly by passing various passwords into it, some right, some wrong.

Input(s): Password

Output(s): None

Source Code

Homework 16: Process Name

Description: This program gets a string from the user containing a first, middle, and last name and uses the slice operator to separate the three names and keep them in their own respective variables.

Input(s): One string containing a first, middle, and last name

Output(s): None

Source Code

Lab 4: Left Justify a String

Description: This program gets a string and a desired width value and returns a string of that width with the original string left justified inside.

Input(s):

  • String
  • New string width value

Output(s): New string with the original one left-justified

Source Code