Skip to content

MacleansCollegeCodingClub2024/Beginners-Problems-8

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Beginners-Modules-Strings

Beginner's Problems based on Modules and String Manipulation.

Starter

Guess the Number

Create a program which produces a random integer from 1 to 100 (inclusive).

Let the user guess the random number. If the user has an incorrect guess, provide the appropriate output (e.g. if the guess is too high, output ‘Your guess was too high.’) Keep letting the user guess until they input the correct number.

Output the number of tries the user had in order to guess the number.

Bus Fare

Given the starting stop and the ending stop, calculate the fare needed to travel.

The fare is calculated with this formula:

Base fare + (fare per stop * number of stops travelled)

The base fare is $5.00 and the fare per stop is $2.50.

Example: Input is in bold

What number stop are you at? 3

What is the stop you want to go to? 4

The fare from Stop 3 to Stop 4 is $7.50

Is it a Strong Password?

Given a password input, check against the following criteria to determine if the password is strong, moderately strong or weak (and output to the user).

The criteria for a strong password is:

  1. Is it longer than 7 characters?
  2. Does it have an uppercase letter?
  3. Does it have a lowercase letter?
  4. Does it have a number?
  5. Does it have a special character/symbol (i.e. non alpha-numeric character)

Each of these criteria contribute 1 point to the password’s ‘score’. If the score is 5 (i.e. all criteria is fulfilled) then the password is deemed ‘strong’. If the score is 3 or 4, the password is ‘moderately strong’ and if it’s 0,1, or 2, the password is ‘weak’.

About

Beginners Problems on Modules and Strings

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published