Skip to content

Added question about tracking income#9

Open
eros-mcguire wants to merge 1 commit into
mainfrom
add-Income-Problem
Open

Added question about tracking income#9
eros-mcguire wants to merge 1 commit into
mainfrom
add-Income-Problem

Conversation

@eros-mcguire

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread questions/Tracking Income

Welcome to **Tracking Income**! Here is the problem statement:

You are given a list of revenue and expenses incurred by your company. Revenue is money coming in, Expensises is money going out. Your job is to write a code to calculate how much money the company has at the end of the day.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"write a code" -> "write a program"

Comment thread questions/Tracking Income
Comment thread questions/Tracking Income
```
The first element in `Money` indicates the amount of money the company has at the start of the day. The rest of the elements in the list indicate the amount of money being earned or spent throughout the day. The company should spend 12 dollars, earn 5, spend 6, earn 18, spend 25, spend 30, then earn 20 before the end of the day.

Therefor your function should return

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

therefore is spelt wrong

Comment thread questions/Tracking Income

Welcome to **Tracking Income**! Here is the problem statement:

You are given a list of revenue and expenses incurred by your company. Revenue is money coming in, Expensises is money going out. Your job is to write a code to calculate how much money the company has at the end of the day.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You are given a list of revenue and expenses incurred by your company. Revenue is money coming in, Expensises is money going out. Your job is to write a code to calculate how much money the company has at the end of the day.
You are given a list of revenue and expenses incurred by your company. Revenue is money coming in, Expenses is money going out. Your job is to write a code to calculate how much money the company has at the end of the day.

Comment thread questions/Tracking Income
```python
def Income(Money):
return sum(Money for Money in Money)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

solution could be rewritten to be a little more clearer

Comment thread questions/Tracking Income
Comment on lines +12 to +19
Money = [200, -12, 5, -6, 18, -25, -30, 20]
```
The first element in `Money` indicates the amount of money the company has at the start of the day. The rest of the elements in the list indicate the amount of money being earned or spent throughout the day. The company should spend 12 dollars, earn 5, spend 6, earn 18, spend 25, spend 30, then earn 20 before the end of the day.

Therefor your function should return
```python
170
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would store the starting amount as a separate variable

@AJaccP AJaccP left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check comments

Comment thread questions/Tracking Income

Welcome to **Tracking Income**! Here is the problem statement:

You are given a list of revenue and expenses incurred by your company. Revenue is money coming in, Expensises is money going out. Your job is to write a code to calculate how much money the company has at the end of the day.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could make more of a story here. Like give a scenario where its like "You are the accountant of a big company are you are trying to track money in and money out to make sure the company is not overspending. Here is a balance sheet of the day. Figure out if the company is making money,

Comment thread questions/Tracking Income

Welcome to **Tracking Income**! Here is the problem statement:

You are given a list of revenue and expenses incurred by your company. Revenue is money coming in, Expensises is money going out. Your job is to write a code to calculate how much money the company has at the end of the day.

@shannonpaul3 shannonpaul3 Oct 21, 2023

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You are given a list of revenue and expenses incurred by your company. Revenue is money coming in, Expensises is money going out. Your job is to write a code to calculate how much money the company has at the end of the day.
You are given a list of revenue and expenses incurred by your company. Revenue is money coming in, Expenses is money going out. Your job is to write code that calculates how much money the company has at the end of the day.

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

Projects

No open projects
Status: No status

Development

Successfully merging this pull request may close these issues.

8 participants