# Return On Investment Calculator

A group of students have setup a young enterprise at the start of the year and are now evaluating how successful their business was.

One approach to evaluate the profitability of a business is to calculate both the profit (or loss) and the Return On Investment (ROI) of the business.

To perform these calculations the business will need to provide the following information:

• How much money was invested in the business. (e.g. total costs)
• How much money was gained by the business. (e.g. total sales)

The profit or loss can be calculated as follows:

The Return On Investment (ROI) tells you how much money you get back for every pound you spent. It’s expressed as a percentage value.

For example, a ROI of 20% indicates that for every £1 spent, the business has raised £1,20.
An ROI of 100% means that you have doubled your investment (for every £1 spent, you have raised £2).

The formula to calcuate the ROI of a business is as follows:

#### Python Challenge

Write a computer program to evaluate the performance of a business. Your program will ask the user to input:

• The total amount spent/invested on the business: Total costs
• The total amount raised by the business: Total sales

Your program will then calculate and display the Return On Investment (ROI) of the business as a percentage value.

Before attempting to write the code for this task, you may consider designing a flowchart to identify the key steps of your algorithm:

#### Test Plan

Description: PixelArt is a business selling T-Shirts with a unique AI generated design printed on the back of the T-Shirt.
The main costs of the business have been to buy a stock of T-Shirts (£300). An extra £150 was also spent for running costs, stationary, packaging and advertising materials.
The business was quite successful and managed to sell all their T-shirts generating a total revenue of £1,250.

 Test # Input Values Expected Output Pass / Fail #1 Total Costs: £450Total Sales: £1250 Profit: £800ROI: 178%

Description: Podcast-101 is a business that produces short audio clips (jingles, radio adverts, podcasts) for their customers.
The main costs of the business have been to buy some audio recording equipment and audio editing software licenses. The business also spent some money on a social media campaign to advertise their service. In total the business invested £550 to cover all these costs.
The business did attract a few customers and created a range of radio adverts and podcasts. They generated a total income of £940.

 Test # Input Values Expected Output Pass / Fail #2 Total Costs: £550Total Sales: £940 Profit: £390ROI: 71%

#### Setting up your own Young Enterprise…

Would you be interested in setting up a Young Enterprise in your school and compete against other Young Enterprises across the UK? Find out more about the Young Enterprise scheme on: https://www.young-enterprise.org.uk/

[pms-restrict display_to=”not_logged_in” message=” “]

#### Solution...

The solution for this challenge is available to full members!
Find out how to become a member:
[/pms-restrict] [pms-restrict subscription_plans=”14217″ message=” “]

#### Solution...

You are viewing this solution as part of your full membership subscription!

Solution

#### Python Code

#Return on Investment Calculator - www.101computing.net/return-on-investment-calculator

print("£\$¥€£\$¥€£\$¥€£\$¥€£\$¥€£\$¥€£\$¥€£\$¥€£\$¥€")
print("\$                                  £")
print("¥     Profit & ROI Calculator      \$")
print("€                                  ¥")
print("£\$¥€£\$¥€£\$¥€£\$¥€£\$¥€£\$¥€£\$¥€£\$¥€£\$¥€")
print("")

costs = float(input("Total Costs?"))
sales = float(input("Total Sales?"))

profit = sales - costs
print("Profit: £" + str(profit))

if profit>=0:
else:

roi = round(((sales - costs) / costs) * 100, 0)
print("ROI: " + str(roi) + "%")
[/pms-restrict]

Did you like this challenge?

Click on a star to rate it!

Average rating 3.6 / 5. Vote count: 36

No votes so far! Be the first to rate this post.

As you found this challenge interesting...