Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shortened it as it was too long in C6 #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 35 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,44 +47,51 @@ What's the Data Type of the following?
### Assignment: Requirements
1. Replace lines 36 and 37 and write a loop to print out each day and the emoticon that is associated by analyzing the mood of that day.

Your result will look like:
```
03/01 :-(
03/13 :-|
...
```
Your result will look like:
```
03/01 :-(
03/13 :-|
...
```

**think**: Why does 03/13 come out as _neutral_ when it should be _happy_? How could we fix this?
#### Test & Verify
Run the resulting code & ensure that each day is printed with the correct emoticon. **think** which does should be happy, which sad and which

**think**: Why does 03/13 come out as _neutral_ when it should be _happy_? How could we fix this?

2. To make the results a little more accurate, let's write and utilize a method called `strip_punctuation` to strip out the punctuation that affects the results. Namely, remove exclamation marks (!), periods (.), commas (,), and hashtags (#).

Your method should take a string as an argument and return the string without the above mentioned punctuation.
Your method should take a string as an argument and return the string without the above mentioned punctuation.

After writing this method, our new result should be:
```
03/01 :-(
03/13 :-)
...
```

#### Test & Verify
Run the resulting code & check to see if days where there is punctuation change. You can also put test `puts` messages in your code to verify that your method is removing punctuation.


After writing this method, our new result should be:
```
03/01 :-(
03/13 :-)
...
```
**think**: Where should we call `strip_punctuation`? Does it matter? Why?

**think**: Where should we call `strip_punctuation`? Does it matter? Why?

3. Write a method called `happy_days` to determine how many logged entries it takes until there have been three :-) happy days.
## Optional Enhancements

Your output could be something like:
```
It takes 5 entries for 3 happy days to occur
```

**think**: What are you going to do if there aren't at least 3 happy days? Where do you need to handle that case?
1. Write a method called `happy_days` to determine how many logged entries it takes until there have been three :-) happy days.

4. Write a method called `overall_mood` to determine the most common mood across all logged entries.
Your output could be something like:
```
It takes 5 entries for 3 happy days to occur
```

Your output could be something like:
```
The most common mood is :-)
```
**think**: What are you going to do if there aren't at least 3 happy days? Where do you need to handle that case?

**think**: Should you use an array or a hash to solve this problem? Why?
2. Write a method called `overall_mood` to determine the most common mood across all logged entries.

**think**: What if we eventually want to add feelings to our analysis? Can we write this code in a way that will prevent us from having to re-write it later?
Your output could be something like:
```
The most common mood is :-)
```