The Accounting firm LambdaCalculator is running out of money. In


 

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 

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions