SlideShare a Scribd company logo
1 of 2
Download to read offline
Code:
class Main {
public static void main(String[] args) {
double[] p = new double[12];
p[1] = 100;
int r = 5;
for(int i=2; i < 12; i++){
p[i] = p[i-1]*(1+(r/100.0));
}
System.out.println("Initial Population is : "+p[1]);
System.out.println("Hour --> Population");
for(int i=2; i < 12; i++){
System.out.println(i-1+" --> "+p[i]);
}
}
}
Output:
Solution
Code:
class Main {
public static void main(String[] args) {
double[] p = new double[12];
p[1] = 100;
int r = 5;
for(int i=2; i < 12; i++){
p[i] = p[i-1]*(1+(r/100.0));
}
System.out.println("Initial Population is : "+p[1]);
System.out.println("Hour --> Population");
for(int i=2; i < 12; i++){
System.out.println(i-1+" --> "+p[i]);
}
}
}
Output:

More Related Content

More from sanjeevtandonsre

Water qualities1. Physical qualitiesOdour and taste unobject.pdf
Water qualities1. Physical qualitiesOdour and taste  unobject.pdfWater qualities1. Physical qualitiesOdour and taste  unobject.pdf
Water qualities1. Physical qualitiesOdour and taste unobject.pdf
sanjeevtandonsre
 
Uses of HRIS SystemsThe principle motivation behind keeping up HR.pdf
Uses of HRIS SystemsThe principle motivation behind keeping up HR.pdfUses of HRIS SystemsThe principle motivation behind keeping up HR.pdf
Uses of HRIS SystemsThe principle motivation behind keeping up HR.pdf
sanjeevtandonsre
 
The moving force behind IT decisions are variable as to what context.pdf
The moving force behind IT decisions are variable as to what context.pdfThe moving force behind IT decisions are variable as to what context.pdf
The moving force behind IT decisions are variable as to what context.pdf
sanjeevtandonsre
 
Physiological responce are those in which the functions of the body .pdf
Physiological responce are those in which the functions of the body .pdfPhysiological responce are those in which the functions of the body .pdf
Physiological responce are those in which the functions of the body .pdf
sanjeevtandonsre
 
ExperimentRegionTissue expressedConclusion1ABCLIVER.pdf
ExperimentRegionTissue expressedConclusion1ABCLIVER.pdfExperimentRegionTissue expressedConclusion1ABCLIVER.pdf
ExperimentRegionTissue expressedConclusion1ABCLIVER.pdf
sanjeevtandonsre
 
CIRT is necesary because the problems may come unknowingly but it ha.pdf
CIRT is necesary because the problems may come unknowingly but it ha.pdfCIRT is necesary because the problems may come unknowingly but it ha.pdf
CIRT is necesary because the problems may come unknowingly but it ha.pdf
sanjeevtandonsre
 

More from sanjeevtandonsre (20)

Water qualities1. Physical qualitiesOdour and taste unobject.pdf
Water qualities1. Physical qualitiesOdour and taste  unobject.pdfWater qualities1. Physical qualitiesOdour and taste  unobject.pdf
Water qualities1. Physical qualitiesOdour and taste unobject.pdf
 
Uses of HRIS SystemsThe principle motivation behind keeping up HR.pdf
Uses of HRIS SystemsThe principle motivation behind keeping up HR.pdfUses of HRIS SystemsThe principle motivation behind keeping up HR.pdf
Uses of HRIS SystemsThe principle motivation behind keeping up HR.pdf
 
The moving force behind IT decisions are variable as to what context.pdf
The moving force behind IT decisions are variable as to what context.pdfThe moving force behind IT decisions are variable as to what context.pdf
The moving force behind IT decisions are variable as to what context.pdf
 
The Canadian city with a pre- 1800 historic heart is QuebecSolut.pdf
The Canadian city with a pre- 1800 historic heart is QuebecSolut.pdfThe Canadian city with a pre- 1800 historic heart is QuebecSolut.pdf
The Canadian city with a pre- 1800 historic heart is QuebecSolut.pdf
 
Solution Millennials referred to as narcissistic referred to as n.pdf
Solution Millennials referred to as narcissistic referred to as n.pdfSolution Millennials referred to as narcissistic referred to as n.pdf
Solution Millennials referred to as narcissistic referred to as n.pdf
 
SolutionThe SELECT DISTINCT stamen will returns distinct values. .pdf
SolutionThe SELECT DISTINCT stamen will returns distinct values. .pdfSolutionThe SELECT DISTINCT stamen will returns distinct values. .pdf
SolutionThe SELECT DISTINCT stamen will returns distinct values. .pdf
 
Starting from the topmost column,1. Cerebellum2. Spinocerebellar.pdf
Starting from the topmost column,1. Cerebellum2. Spinocerebellar.pdfStarting from the topmost column,1. Cerebellum2. Spinocerebellar.pdf
Starting from the topmost column,1. Cerebellum2. Spinocerebellar.pdf
 
Rheumatic fever shows various symptoms and signs, out of which sore .pdf
Rheumatic fever shows various symptoms and signs, out of which sore .pdfRheumatic fever shows various symptoms and signs, out of which sore .pdf
Rheumatic fever shows various symptoms and signs, out of which sore .pdf
 
Physiological responce are those in which the functions of the body .pdf
Physiological responce are those in which the functions of the body .pdfPhysiological responce are those in which the functions of the body .pdf
Physiological responce are those in which the functions of the body .pdf
 
NaF is the only oneSolutionNaF is the only one.pdf
NaF is the only oneSolutionNaF is the only one.pdfNaF is the only oneSolutionNaF is the only one.pdf
NaF is the only oneSolutionNaF is the only one.pdf
 
okkkSolutionokkk.pdf
okkkSolutionokkk.pdfokkkSolutionokkk.pdf
okkkSolutionokkk.pdf
 
Minimum IQ is 131SolutionMinimum IQ is 131.pdf
Minimum IQ is 131SolutionMinimum IQ is 131.pdfMinimum IQ is 131SolutionMinimum IQ is 131.pdf
Minimum IQ is 131SolutionMinimum IQ is 131.pdf
 
co2 because of the sqrt of their molar mases.. .pdf
                     co2 because of the sqrt of their molar mases..   .pdf                     co2 because of the sqrt of their molar mases..   .pdf
co2 because of the sqrt of their molar mases.. .pdf
 
L{e^{-t}} = int _0 to infinty [e^{st}e^{-t} dt = int _0 to infinty .pdf
L{e^{-t}} = int _0 to infinty [e^{st}e^{-t} dt = int _0 to infinty .pdfL{e^{-t}} = int _0 to infinty [e^{st}e^{-t} dt = int _0 to infinty .pdf
L{e^{-t}} = int _0 to infinty [e^{st}e^{-t} dt = int _0 to infinty .pdf
 
carbon forms 4 hydrogen forms 1 nitrogen forms 3 .pdf
                     carbon forms 4 hydrogen forms 1 nitrogen forms 3 .pdf                     carbon forms 4 hydrogen forms 1 nitrogen forms 3 .pdf
carbon forms 4 hydrogen forms 1 nitrogen forms 3 .pdf
 
H = H(lattice) + H(first ionisation) +H(second ionization) +2H(elec.pdf
H = H(lattice) + H(first ionisation) +H(second ionization) +2H(elec.pdfH = H(lattice) + H(first ionisation) +H(second ionization) +2H(elec.pdf
H = H(lattice) + H(first ionisation) +H(second ionization) +2H(elec.pdf
 
Heptatomic molecules contain 7 atomsNo. of H atoms = 2No. of S .pdf
Heptatomic molecules contain 7 atomsNo. of H atoms = 2No. of S .pdfHeptatomic molecules contain 7 atomsNo. of H atoms = 2No. of S .pdf
Heptatomic molecules contain 7 atomsNo. of H atoms = 2No. of S .pdf
 
ExperimentRegionTissue expressedConclusion1ABCLIVER.pdf
ExperimentRegionTissue expressedConclusion1ABCLIVER.pdfExperimentRegionTissue expressedConclusion1ABCLIVER.pdf
ExperimentRegionTissue expressedConclusion1ABCLIVER.pdf
 
D . All of the above could be reported within the fund financial sta.pdf
D . All of the above could be reported within the fund financial sta.pdfD . All of the above could be reported within the fund financial sta.pdf
D . All of the above could be reported within the fund financial sta.pdf
 
CIRT is necesary because the problems may come unknowingly but it ha.pdf
CIRT is necesary because the problems may come unknowingly but it ha.pdfCIRT is necesary because the problems may come unknowingly but it ha.pdf
CIRT is necesary because the problems may come unknowingly but it ha.pdf
 

Recently uploaded

Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
EADTU
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
Peter Brusilovsky
 

Recently uploaded (20)

dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdfDiuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
Michaelis Menten Equation and Estimation Of Vmax and Tmax.pptx
Michaelis Menten Equation and Estimation Of Vmax and Tmax.pptxMichaelis Menten Equation and Estimation Of Vmax and Tmax.pptx
Michaelis Menten Equation and Estimation Of Vmax and Tmax.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 

Codeclass Main { public static void main(String[] args) { dou.pdf

  • 1. Code: class Main { public static void main(String[] args) { double[] p = new double[12]; p[1] = 100; int r = 5; for(int i=2; i < 12; i++){ p[i] = p[i-1]*(1+(r/100.0)); } System.out.println("Initial Population is : "+p[1]); System.out.println("Hour --> Population"); for(int i=2; i < 12; i++){ System.out.println(i-1+" --> "+p[i]); } } } Output: Solution Code: class Main { public static void main(String[] args) { double[] p = new double[12]; p[1] = 100; int r = 5; for(int i=2; i < 12; i++){ p[i] = p[i-1]*(1+(r/100.0)); } System.out.println("Initial Population is : "+p[1]); System.out.println("Hour --> Population"); for(int i=2; i < 12; i++){ System.out.println(i-1+" --> "+p[i]); } }