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

add question about affording a phone #23

Open
wants to merge 1 commit into
base: main
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
52 changes: 52 additions & 0 deletions questions/chunga.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Can I Get a New Phone Now?

## With the money I have made from odd jobs, can I finally get a new phone?

# My current phone is all kinds of busted. The technology I currently have seems near illegal to be selling in the 21st century. I worked a couple odd jobs and now I hope to purchase the newest ePhone for the low price of $1400. Can I afford it?

# We will need to compile the appropriate payouts and add them together to find out if it is greater than that of the newest ePhone. Get a paper and make note! I babysat 5 times, cat sitted once, cleaned 2 times and did taxes 3 times.

#Help a girl out.

## Input

```python
ephone = 1400

jobs = [babysitting, cat sitting, cleaning, tax filing]
babysitting = 100
catsitting = 200
cleaning = 50
taxes = 90

```

# Now, we will specify how many times each job was done. We multiply this by the pay for each type of job. Then we will add them together. If this value is enough to purchase the phone, print "new phone!" and if not, print "just forget it".

Therefore, your function should return:

```python
# print(result)
```

Here are some criteria for marking someone's code:

- Correctness: Does the code produce correct results for all test cases?
- Readability: Is the code easy to read and understand?
- Efficiency: Does the code run efficiently?
- Style: Does the code follow good coding style and conventions?

Here is a sample solution in Python:

```python
def can_i_get_it(babysitting, catsitting, cleaning, tax :int) -> str:
savings = 5(jobs[0]) + jobs[1] + 2(jobs[2]) + 3(jobs[3])

if savings >= ephone:
result = "new phone!"
else:
result = "just forget it"
return can_i_get_it
can_i_get_it ()
print (result)
```