/programming-mb-php

Sample PHP Program to be used for BSA Programming Merit Badge

Primary LanguagePHPMIT LicenseMIT

BSA Programming Merit Badge (PHP)

Sample PHP programs to be used for instruction of the BSA Programming Merit Badge.

This project is organized by "labs"; each in its own folder.

LAB 1

Dice rolling script. Rolls two six-sided dice and outputs the value of each. Prompts the user to play again or quit. Teaches basic concepts of:

  • variable assignment
  • input prompt
  • while loops
  • conditionals
  • random number generator (RNG)

LAB 2

Temperature conversion scripts. Prompts for user input and converts Fahrenheit to Celsius. Teaches basic concepts of:

  • variable assignment
  • input prompt
  • if statements
  • conditionals
  • user defined functions
  • HTML output, beginning web programming

LAB 3

Parses a JSON object of tweets from the Twitter API, and outputs the results in a simple formatted grid.

Teaches basic concepts of:

  • variable assignment
  • input prompt
  • if/else statements
  • arrays and lists
  • conditionals
  • string manipulation/formatting
  • JSON parsing
  • REST API
  • Advanced HTML output and CSS styling

Contributing

programming-mb-php is an open source project and your contribution is very much appreciated.

  1. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.
  2. Fork the repository on Github and make your changes on the main branch (or branch off of it).
  3. Add new examples/labs to a new subfolder/directory.
  4. Add overview of new examples/labs to this README.md (if applicable).
  5. Send a pull request (with the main branch as the target).

A big thank you goes out to everyone who helped with the project, the contributors and everyone who took the time to report issues and give feedback.

License

programming-mb-php is available under the MIT license. See the LICENSE file for more info.