Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double getProfit(SolarPanel panel, double price) {
- double profit = panel.kWh();
- return profit * price;
- }
- double getProfit(SolarPanel* panels, int n, double price) {
- double profit = 0;
- for (int i = 0; i < n; i++) {
- profit += panels[i].kWh();
- }
- return profit * price;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement