-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathration.cpp
More file actions
19 lines (16 loc) · 703 Bytes
/
Copy pathration.cpp
File metadata and controls
19 lines (16 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "ration.h" // Header file for ration functions
Ration calculateRation(int income, int familySize) {
Ration ration;
// Basic ration calculation logic
ration.rice = familySize * 5; // 5 kg of rice per family member
ration.wheat = familySize * 3; // 3 kg of wheat per family member
// Additional ration based on income
if (income < 10000) {
ration.sugar = familySize * 1; // 1 kg of sugar per family member for low income
ration.oil = familySize * 2; // 2 liters of oil per family member for low income
} else {
ration.sugar = 0; // No sugar for higher income
ration.oil = 0; // No oil for higher income
}
return ration;
}