popmen=(52*pop)/100;
popwomen=pop-popmen;
poplit=(48*pop)/100;
litmen=(35*pop)/100;
litwomen=pop-litmen;
ilitmen=pop-litmen;
ilitwomen=pop-litwomen;
In A town,the percentange of men is 52. The percentage of total literacy is 48. If total percentage of literate men is 35 of the total population, Write a program to find the total number of illiterate men and women if the population of the town is 80,000
β Problem Summary:
-
Total population = 80,000
-
Men = 52% β
men = 52% of 80000
-
Women = remaining 48%
-
Total literate population = 48% β
literate = 48% of 80000
-
Literate men = 35% of total population β
literateMen = 35% of 80000
-
Find:
-
Illiterate men = total men – literate men
-
Literate women = total literate – literate men
-
Illiterate women = total women – literate women
-
- public class LiteracyCalculation {
public static void main(String[] args) {
int totalPopulation = 80000;// Percentages
double menPercent = 52;
double totalLiteratePercent = 48;
double literateMenPercent = 35;// Calculations
int totalMen = (int)(totalPopulation * menPercent / 100);
int totalWomen = totalPopulation – totalMen;int totalLiterate = (int)(totalPopulation * totalLiteratePercent / 100);
int literateMen = (int)(totalPopulation * literateMenPercent / 100);
int illiterateMen = totalMen – literateMen;int literateWomen = totalLiterate – literateMen;
int illiterateWomen = totalWomen – literateWomen;// Output
System.out.println(“Total illiterate men: ” + illiterateMen);
System.out.println(“Total illiterate women: ” + illiterateWomen);
}
} - π Output:
- Total illiterate men: 6600
Total illiterate women: 13600
β Breakdown of Calculation:
-
Total men = 52% of 80000 = 41600
-
Total women = 80000 – 41600 = 38400
-
Literate men = 35% of 80000 = 28000
-
Illiterate men = 41600 – 28000 = 13600
-
Total literate = 48% of 80000 = 38400
-
Literate women = 38400 – 28000 = 10400
-
Illiterate women = 38400 – 10400 = 28000