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:

If the costs exceed the sales, your business will have made a loss (a negative profit!)

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 profit made by the business and indicate whether the business made a profit or a loss.
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:
Flowchart Studio

Python Code

Your task is to complete the code below…

Test Plan

Business Name: PixelArt
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: £450
Total Sales: £1250
Profit: £800
ROI: 178%

Business Name: Podcast-101
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: £550
Total Sales: £940
Profit: £390
ROI: 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/

unlock-access

Solution...

The solution for this challenge is available to full members!
Find out how to become a member:
➤ Members' Area

Did you like this challenge?

Click on a star to rate it!

Average rating 3.9 / 5. Vote count: 14

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

As you found this challenge interesting...

Follow us on social media!