The Accounting firm?LambdaCalculator?is running out of money. In the past few months, they’ve struggled to find n
The Accounting firm LambdaCalculator is running out of money. In the past few months, they've struggled to find new clients, and as a result they are looking at laying off staff. They've hired you to build some software that fulfills the role of their accountants. As the first step, you will write some code that calculates the gross profit (total revenue minus total expenses) for monthly financial reports.
Write a function called calculateGrossProfit
that takes in two int[]
parameters, the revenue for each day of a month then the expenses for each day of a month, and returns the gross profit (revenues minus expenses) as an int
. You may assume that both passed arrays will not be null
and the same length.
Example:
int grossProfit = calculateGrossProfit(new int [] {30, 20, 50, 10}, new int[] {20, 30, 10, 20});
System.out.println(grossProfit); // prints 30
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.