Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save brycemara/67e018a39b45fc0551f252d0324e4fb0 to your computer and use it in GitHub Desktop.
Save brycemara/67e018a39b45fc0551f252d0324e4fb0 to your computer and use it in GitHub Desktop.
Mod 0 Session 3 Practice Tasks

Session 3 Practice Tasks

The assignments listed here should take you about 1 hour in total.

To start this assignment:

  1. Click the button in the upper right-hand corner that says Fork. This is now your copy of the document.
  2. Click the Edit button when you're ready to start adding your answers.
  3. To save your work, click the green button in the bottom right-hand corner. You can always come back and re-edit your gist.

Task 1: Practicing Git Workflow and Pushing a Repo to GitHub (20 min)

  1. From your command line, make a directory git_and_gh_practice with two files inside: hobbies.txt and travels.txt.
  2. Initialize git, and your two files, and make an initial commit.
  3. Use your text editor to open hobbies.txt.
  4. Add some text about your hobbies.
  5. Add the changes and commit.
  6. Use your text editor to open travels.txt.
  7. Add some text about your favorite vacation or travel experience.
  8. Add the changes and commit.
  9. On GitHub, create a new repository.
  10. Add the remote to your local repository.
  11. Push your repository to GitHub.
  • Paste the link to your repository here:

https://github.com/brycemara/git_and_gh_practice

Task 2: Forking a Repo on GitHub and Creating a Pull Request (30 min)

  1. Fork the Mod 0 Resources repository.
  2. Open your terminal
  3. Clone your fork to your computer (git clone <url>).
  4. cd into your cloned repository.
  5. Make a new file with the pattern lastname_firstname_resources.md.
  6. Open the file you just created in your text editor.
  7. Create a list of some of your favorite resources so far related to coding/Turing/git/GitHub/etc. These resources do not need to be ones that we've discussed in class. They can be anything that has helped you so far in your journey to learn software development.
  8. Add your changes.
  9. Commit your changes with a properly formatted commit message.
  10. Push your changes to your fork.

This next part is not something we discussed during Session 3 and will involve some figuring out on your own.

  1. Use the site:help.github.com Googling trick to search GitHub's help area to figure out how to create a pull request from a fork. It may also be helpful to figure out what pull request means.
  2. Open a pull request for your changes.
  • Once your pull request is open, you're done! You don't need to submit or paste anything since we will get a notification that you've opened a pull request.

Task 3: OOP and Bottles (20 min)

  • Watch this video. Next, create an idea for a class of your own. In the space below, outline your class idea.

The class I would use are computers.

What attributes and methods would it have? What data types would those attributes have, and how would the methods use/update those attributes?

Computers all share similar attributes of a screen, keyboard and mouse. Methods could include sending emails, creating documents and surfing the internet.

Depending on how many documents the computer holds could effect the storage space available on the computer. This would update the storage space to a smaller amount of storage available.

Think of an instance of that class. What data would it have stored in its attributes? How would the methods affect or use that data?

An instance of the computer class would be a Macbook Pro. Its attributes would include screen, storage, battery life and keyboard. Methods could include writing code, saving documents, sending emails, and facetiming.

A method like writing code would effect the battery life, the battery life would decrease. Another method of saving documents would effect the storage, it would decrease the storage.

Remember to consider naming conventions!

Class: Computers

attributes: Screen, keyboard, mouse, power button, storage, battery_life.

methods: Sending_emails, creating_documents, saving_documents, writing_code. 
Instance: An instance of a comupter could be a Macbook_Air, Dell_Laptop, Apple_Desktop. 

attributes: Screen, keyboard, mouse, power button, storage, battery_life.

methods: Sending_emails, creating_documents, saving_documents, writing_code.
@brycemara
Copy link
Author

After session 4 and doing an example of the Class vs Class instance I have a much better understanding. Here's my better answer for the 3rd task:

Class: Computers

Attributes: screen_size(integer), has_keyboard(boolean), has_mouse(boolean), battery_life(integer), users(array).

Methods: change_screen_size(increase or decrease screen_size), writing_code(decrease battery_life), add_users(increase users array).

Instance: Bryce's MacBook Pro
Attributes:
screen_size(integer) = 13
has_keyboard(boolean) = true
has_mouse(boolean) = true
battery_life(integer) = 90
users(array) = ["Bryce", "Guest"]

Methods with the instance:
change_screen_size: screen_size = 10
writing_code: battery_life = 50
add_users: users = ["Bryce", "Guest", "Guest2"]

@mschae16
Copy link

@brycemara - Nice work getting in that git practice! With regard to your commit message clarity and creating pull requests, you're doing great. One note on task 1 - I expected to see 3 commits, based off the instructions -- be sure to read and follow directions closely in order to save yourself time later. Usually, the first commit just sets up the skeleton file structure of the project, and follows the format "Initial commit". Additionally, as you read in the readings/responses section of this session's homework, we usually try to format commit messages as a statement in the imperative tense (as if we are giving a command to someone), so for example, the commit "Travels" could become "Add information on travels" (no punctuation) when properly formatted. No need to update here, just something to keep in mind in future.

Great work for your updated class and instance examples - I'm glad you have a much better understanding now and chose to take the time to update your examples. That is the kind of effort that will pay off at Turing. I like that you follow very strong naming conventions for your method names - conveying that an action will take place with verbs/action words. Keep up the great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment