SlideShare a Scribd company logo
1 of 2
Download to read offline
import java.util.Scanner;
import java.text.*;
public class AverageRainfall {
public static void main(String[] args) {
int years; // Variable to hold the amount of years
final int MONTHS = 12; // Constant to hold the amount of months in a year
int totalMonths = 0; // Months accumulator variable
double monthlyRain; // Holds the amount of rain in inches for each month
double totalRainfall = 0; // Holds the total rainfall
NumberFormat df = DecimalFormat.getInstance(); // Decimal formating
df.setMaximumFractionDigits(2);
// Create Scanner object
Scanner input = new Scanner(System.in);
// Prompt user for the number of years
System.out.println("Enter the number of years: ");
years = input.nextInt();
System.out.println("Enter the rainfall amount for each month ");
// Construct for-loop for each year
for(int i=0; i < years; i++){
for(int j=1; j
Solution
import java.util.Scanner;
import java.text.*;
public class AverageRainfall {
public static void main(String[] args) {
int years; // Variable to hold the amount of years
final int MONTHS = 12; // Constant to hold the amount of months in a year
int totalMonths = 0; // Months accumulator variable
double monthlyRain; // Holds the amount of rain in inches for each month
double totalRainfall = 0; // Holds the total rainfall
NumberFormat df = DecimalFormat.getInstance(); // Decimal formating
df.setMaximumFractionDigits(2);
// Create Scanner object
Scanner input = new Scanner(System.in);
// Prompt user for the number of years
System.out.println("Enter the number of years: ");
years = input.nextInt();
System.out.println("Enter the rainfall amount for each month ");
// Construct for-loop for each year
for(int i=0; i < years; i++){
for(int j=1; j

More Related Content

Similar to import java.util.Scanner; import java.text.; public class Ave.pdf

Digits.javapackage week04;import java.util.Scanner; public cla.pdf
Digits.javapackage week04;import java.util.Scanner; public cla.pdfDigits.javapackage week04;import java.util.Scanner; public cla.pdf
Digits.javapackage week04;import java.util.Scanner; public cla.pdfannapurnnatextailes
 
Cmis 102 hands on/tutorialoutlet
Cmis 102 hands on/tutorialoutletCmis 102 hands on/tutorialoutlet
Cmis 102 hands on/tutorialoutletPoppinss
 
Hi,I have updated the code as per your requirement. Highlighted th.pdf
Hi,I have updated the code as per your requirement. Highlighted th.pdfHi,I have updated the code as per your requirement. Highlighted th.pdf
Hi,I have updated the code as per your requirement. Highlighted th.pdfannaindustries
 
The java Payroll that prompts user to enter hourly rate .pdf
  The java Payroll that prompts user to enter  hourly rate .pdf  The java Payroll that prompts user to enter  hourly rate .pdf
The java Payroll that prompts user to enter hourly rate .pdfangelfashions02
 
tested on EclipseRainfall.javaimpo.pdf
tested on EclipseRainfall.javaimpo.pdftested on EclipseRainfall.javaimpo.pdf
tested on EclipseRainfall.javaimpo.pdfsutharbharat59
 
commission1Application.javacommission1Application.javaimport.docx
commission1Application.javacommission1Application.javaimport.docxcommission1Application.javacommission1Application.javaimport.docx
commission1Application.javacommission1Application.javaimport.docxmonicafrancis71118
 
Please I am posting the fifth time and hoping to get this r.pdf
Please I am posting the fifth time and hoping to get this r.pdfPlease I am posting the fifth time and hoping to get this r.pdf
Please I am posting the fifth time and hoping to get this r.pdfankit11134
 
C++ Please I am posting the fifth time and hoping to get th.pdf
C++ Please I am posting the fifth time and hoping to get th.pdfC++ Please I am posting the fifth time and hoping to get th.pdf
C++ Please I am posting the fifth time and hoping to get th.pdfjaipur2
 
RainFall.java public class RainFall {    private double months.pdf
RainFall.java public class RainFall {    private double months.pdfRainFall.java public class RainFall {    private double months.pdf
RainFall.java public class RainFall {    private double months.pdfanjaliselectionahd
 
tested on eclipseRainFall.javai.pdf
tested on eclipseRainFall.javai.pdftested on eclipseRainFall.javai.pdf
tested on eclipseRainFall.javai.pdfarasequ
 
1 CMIS 102 Hands-On Lab Week 8 Overview Th.docx
1  CMIS 102 Hands-On Lab  Week 8 Overview Th.docx1  CMIS 102 Hands-On Lab  Week 8 Overview Th.docx
1 CMIS 102 Hands-On Lab Week 8 Overview Th.docxhoney725342
 
The Weather Service Bureau department has data representing .pdf
The Weather Service Bureau department has data representing .pdfThe Weather Service Bureau department has data representing .pdf
The Weather Service Bureau department has data representing .pdfmccarthygaussvanst87
 
Java programI made this Account.java below. Using the attached cod.pdf
Java programI made this Account.java below. Using the attached cod.pdfJava programI made this Account.java below. Using the attached cod.pdf
Java programI made this Account.java below. Using the attached cod.pdffathimafancy
 
I want a java program that can convert a number of base 10 into its .pdf
I want a java program that can convert a number of base 10 into its .pdfI want a java program that can convert a number of base 10 into its .pdf
I want a java program that can convert a number of base 10 into its .pdffashiongallery1
 
Lab101.pptx
Lab101.pptxLab101.pptx
Lab101.pptxKimVeeL
 
Review Questions for Exam 10182016 1. public class .pdf
Review Questions for Exam 10182016 1. public class .pdfReview Questions for Exam 10182016 1. public class .pdf
Review Questions for Exam 10182016 1. public class .pdfmayorothenguyenhob69
 

Similar to import java.util.Scanner; import java.text.; public class Ave.pdf (16)

Digits.javapackage week04;import java.util.Scanner; public cla.pdf
Digits.javapackage week04;import java.util.Scanner; public cla.pdfDigits.javapackage week04;import java.util.Scanner; public cla.pdf
Digits.javapackage week04;import java.util.Scanner; public cla.pdf
 
Cmis 102 hands on/tutorialoutlet
Cmis 102 hands on/tutorialoutletCmis 102 hands on/tutorialoutlet
Cmis 102 hands on/tutorialoutlet
 
Hi,I have updated the code as per your requirement. Highlighted th.pdf
Hi,I have updated the code as per your requirement. Highlighted th.pdfHi,I have updated the code as per your requirement. Highlighted th.pdf
Hi,I have updated the code as per your requirement. Highlighted th.pdf
 
The java Payroll that prompts user to enter hourly rate .pdf
  The java Payroll that prompts user to enter  hourly rate .pdf  The java Payroll that prompts user to enter  hourly rate .pdf
The java Payroll that prompts user to enter hourly rate .pdf
 
tested on EclipseRainfall.javaimpo.pdf
tested on EclipseRainfall.javaimpo.pdftested on EclipseRainfall.javaimpo.pdf
tested on EclipseRainfall.javaimpo.pdf
 
commission1Application.javacommission1Application.javaimport.docx
commission1Application.javacommission1Application.javaimport.docxcommission1Application.javacommission1Application.javaimport.docx
commission1Application.javacommission1Application.javaimport.docx
 
Please I am posting the fifth time and hoping to get this r.pdf
Please I am posting the fifth time and hoping to get this r.pdfPlease I am posting the fifth time and hoping to get this r.pdf
Please I am posting the fifth time and hoping to get this r.pdf
 
C++ Please I am posting the fifth time and hoping to get th.pdf
C++ Please I am posting the fifth time and hoping to get th.pdfC++ Please I am posting the fifth time and hoping to get th.pdf
C++ Please I am posting the fifth time and hoping to get th.pdf
 
RainFall.java public class RainFall {    private double months.pdf
RainFall.java public class RainFall {    private double months.pdfRainFall.java public class RainFall {    private double months.pdf
RainFall.java public class RainFall {    private double months.pdf
 
tested on eclipseRainFall.javai.pdf
tested on eclipseRainFall.javai.pdftested on eclipseRainFall.javai.pdf
tested on eclipseRainFall.javai.pdf
 
1 CMIS 102 Hands-On Lab Week 8 Overview Th.docx
1  CMIS 102 Hands-On Lab  Week 8 Overview Th.docx1  CMIS 102 Hands-On Lab  Week 8 Overview Th.docx
1 CMIS 102 Hands-On Lab Week 8 Overview Th.docx
 
The Weather Service Bureau department has data representing .pdf
The Weather Service Bureau department has data representing .pdfThe Weather Service Bureau department has data representing .pdf
The Weather Service Bureau department has data representing .pdf
 
Java programI made this Account.java below. Using the attached cod.pdf
Java programI made this Account.java below. Using the attached cod.pdfJava programI made this Account.java below. Using the attached cod.pdf
Java programI made this Account.java below. Using the attached cod.pdf
 
I want a java program that can convert a number of base 10 into its .pdf
I want a java program that can convert a number of base 10 into its .pdfI want a java program that can convert a number of base 10 into its .pdf
I want a java program that can convert a number of base 10 into its .pdf
 
Lab101.pptx
Lab101.pptxLab101.pptx
Lab101.pptx
 
Review Questions for Exam 10182016 1. public class .pdf
Review Questions for Exam 10182016 1. public class .pdfReview Questions for Exam 10182016 1. public class .pdf
Review Questions for Exam 10182016 1. public class .pdf
 

More from anitasahani11

2.Kernel need to be protected because non-root user execute kernel.pdf
2.Kernel need to be protected because non-root user execute kernel.pdf2.Kernel need to be protected because non-root user execute kernel.pdf
2.Kernel need to be protected because non-root user execute kernel.pdfanitasahani11
 
1.C. Fate of the blastopore becomes the mouth.2.C. Endodermis Casp.pdf
1.C. Fate of the blastopore becomes the mouth.2.C. Endodermis Casp.pdf1.C. Fate of the blastopore becomes the mouth.2.C. Endodermis Casp.pdf
1.C. Fate of the blastopore becomes the mouth.2.C. Endodermis Casp.pdfanitasahani11
 
1. a. -8 to 4 is 12 unitsb. D to B is 8 unitsc. idk what that de.pdf
1. a. -8 to 4 is 12 unitsb. D to B is 8 unitsc. idk what that de.pdf1. a. -8 to 4 is 12 unitsb. D to B is 8 unitsc. idk what that de.pdf
1. a. -8 to 4 is 12 unitsb. D to B is 8 unitsc. idk what that de.pdfanitasahani11
 
1. Confidential or privileged information cannot be denied to the co.pdf
1. Confidential or privileged information cannot be denied to the co.pdf1. Confidential or privileged information cannot be denied to the co.pdf
1. Confidential or privileged information cannot be denied to the co.pdfanitasahani11
 
The three different 3SolutionThe three different 3.pdf
The three different 3SolutionThe three different 3.pdfThe three different 3SolutionThe three different 3.pdf
The three different 3SolutionThe three different 3.pdfanitasahani11
 
Whales are mammals that breathe into the lungs. Whales contain blow .pdf
Whales are mammals that breathe into the lungs. Whales contain blow .pdfWhales are mammals that breathe into the lungs. Whales contain blow .pdf
Whales are mammals that breathe into the lungs. Whales contain blow .pdfanitasahani11
 
w12-8v6Solutionw12-8v6.pdf
w12-8v6Solutionw12-8v6.pdfw12-8v6Solutionw12-8v6.pdf
w12-8v6Solutionw12-8v6.pdfanitasahani11
 
This site provides illustrative experience in the use of Excel for d.pdf
This site provides illustrative experience in the use of Excel for d.pdfThis site provides illustrative experience in the use of Excel for d.pdf
This site provides illustrative experience in the use of Excel for d.pdfanitasahani11
 
The conch symbolizes social order, respect and power. When the boys .pdf
The conch symbolizes social order, respect and power. When the boys .pdfThe conch symbolizes social order, respect and power. When the boys .pdf
The conch symbolizes social order, respect and power. When the boys .pdfanitasahani11
 
The bone marrow is the wellspring of numerous immune and blood cells.pdf
The bone marrow is the wellspring of numerous immune and blood cells.pdfThe bone marrow is the wellspring of numerous immune and blood cells.pdf
The bone marrow is the wellspring of numerous immune and blood cells.pdfanitasahani11
 
Stanley Miller experiment explains the origin and evolution of earth.pdf
Stanley Miller experiment explains the origin and evolution of earth.pdfStanley Miller experiment explains the origin and evolution of earth.pdf
Stanley Miller experiment explains the origin and evolution of earth.pdfanitasahani11
 
service revenueSolutionservice revenue.pdf
service revenueSolutionservice revenue.pdfservice revenueSolutionservice revenue.pdf
service revenueSolutionservice revenue.pdfanitasahani11
 
public class DecimalToBinary {    public void printBinaryFormat(in.pdf
public class DecimalToBinary {    public void printBinaryFormat(in.pdfpublic class DecimalToBinary {    public void printBinaryFormat(in.pdf
public class DecimalToBinary {    public void printBinaryFormat(in.pdfanitasahani11
 
#includeiostream #includequeue #includefstream using nam.pdf
#includeiostream #includequeue #includefstream using nam.pdf#includeiostream #includequeue #includefstream using nam.pdf
#includeiostream #includequeue #includefstream using nam.pdfanitasahani11
 
package reservation; import java.util.; For Scanner Class .pdf
 package reservation; import java.util.; For Scanner Class .pdf package reservation; import java.util.; For Scanner Class .pdf
package reservation; import java.util.; For Scanner Class .pdfanitasahani11
 
Traffic intersection is a piece of transportation infrastructure wha.pdf
  Traffic intersection is a piece of transportation infrastructure wha.pdf  Traffic intersection is a piece of transportation infrastructure wha.pdf
Traffic intersection is a piece of transportation infrastructure wha.pdfanitasahani11
 
Step1 pH =2 ; [H+] = 1 x10^-2 moleslitre Step2 .pdf
                     Step1 pH =2 ; [H+] = 1 x10^-2 moleslitre  Step2 .pdf                     Step1 pH =2 ; [H+] = 1 x10^-2 moleslitre  Step2 .pdf
Step1 pH =2 ; [H+] = 1 x10^-2 moleslitre Step2 .pdfanitasahani11
 
ZnOCu2OV2O3,Ni2O3MnO .pdf
                     ZnOCu2OV2O3,Ni2O3MnO                         .pdf                     ZnOCu2OV2O3,Ni2O3MnO                         .pdf
ZnOCu2OV2O3,Ni2O3MnO .pdfanitasahani11
 
There is actually a few differences. Firstly, a p.pdf
                     There is actually a few differences. Firstly, a p.pdf                     There is actually a few differences. Firstly, a p.pdf
There is actually a few differences. Firstly, a p.pdfanitasahani11
 
Hg^2+ is soft acid and thus akin to bind to soft .pdf
                     Hg^2+ is soft acid and thus akin to bind to soft .pdf                     Hg^2+ is soft acid and thus akin to bind to soft .pdf
Hg^2+ is soft acid and thus akin to bind to soft .pdfanitasahani11
 

More from anitasahani11 (20)

2.Kernel need to be protected because non-root user execute kernel.pdf
2.Kernel need to be protected because non-root user execute kernel.pdf2.Kernel need to be protected because non-root user execute kernel.pdf
2.Kernel need to be protected because non-root user execute kernel.pdf
 
1.C. Fate of the blastopore becomes the mouth.2.C. Endodermis Casp.pdf
1.C. Fate of the blastopore becomes the mouth.2.C. Endodermis Casp.pdf1.C. Fate of the blastopore becomes the mouth.2.C. Endodermis Casp.pdf
1.C. Fate of the blastopore becomes the mouth.2.C. Endodermis Casp.pdf
 
1. a. -8 to 4 is 12 unitsb. D to B is 8 unitsc. idk what that de.pdf
1. a. -8 to 4 is 12 unitsb. D to B is 8 unitsc. idk what that de.pdf1. a. -8 to 4 is 12 unitsb. D to B is 8 unitsc. idk what that de.pdf
1. a. -8 to 4 is 12 unitsb. D to B is 8 unitsc. idk what that de.pdf
 
1. Confidential or privileged information cannot be denied to the co.pdf
1. Confidential or privileged information cannot be denied to the co.pdf1. Confidential or privileged information cannot be denied to the co.pdf
1. Confidential or privileged information cannot be denied to the co.pdf
 
The three different 3SolutionThe three different 3.pdf
The three different 3SolutionThe three different 3.pdfThe three different 3SolutionThe three different 3.pdf
The three different 3SolutionThe three different 3.pdf
 
Whales are mammals that breathe into the lungs. Whales contain blow .pdf
Whales are mammals that breathe into the lungs. Whales contain blow .pdfWhales are mammals that breathe into the lungs. Whales contain blow .pdf
Whales are mammals that breathe into the lungs. Whales contain blow .pdf
 
w12-8v6Solutionw12-8v6.pdf
w12-8v6Solutionw12-8v6.pdfw12-8v6Solutionw12-8v6.pdf
w12-8v6Solutionw12-8v6.pdf
 
This site provides illustrative experience in the use of Excel for d.pdf
This site provides illustrative experience in the use of Excel for d.pdfThis site provides illustrative experience in the use of Excel for d.pdf
This site provides illustrative experience in the use of Excel for d.pdf
 
The conch symbolizes social order, respect and power. When the boys .pdf
The conch symbolizes social order, respect and power. When the boys .pdfThe conch symbolizes social order, respect and power. When the boys .pdf
The conch symbolizes social order, respect and power. When the boys .pdf
 
The bone marrow is the wellspring of numerous immune and blood cells.pdf
The bone marrow is the wellspring of numerous immune and blood cells.pdfThe bone marrow is the wellspring of numerous immune and blood cells.pdf
The bone marrow is the wellspring of numerous immune and blood cells.pdf
 
Stanley Miller experiment explains the origin and evolution of earth.pdf
Stanley Miller experiment explains the origin and evolution of earth.pdfStanley Miller experiment explains the origin and evolution of earth.pdf
Stanley Miller experiment explains the origin and evolution of earth.pdf
 
service revenueSolutionservice revenue.pdf
service revenueSolutionservice revenue.pdfservice revenueSolutionservice revenue.pdf
service revenueSolutionservice revenue.pdf
 
public class DecimalToBinary {    public void printBinaryFormat(in.pdf
public class DecimalToBinary {    public void printBinaryFormat(in.pdfpublic class DecimalToBinary {    public void printBinaryFormat(in.pdf
public class DecimalToBinary {    public void printBinaryFormat(in.pdf
 
#includeiostream #includequeue #includefstream using nam.pdf
#includeiostream #includequeue #includefstream using nam.pdf#includeiostream #includequeue #includefstream using nam.pdf
#includeiostream #includequeue #includefstream using nam.pdf
 
package reservation; import java.util.; For Scanner Class .pdf
 package reservation; import java.util.; For Scanner Class .pdf package reservation; import java.util.; For Scanner Class .pdf
package reservation; import java.util.; For Scanner Class .pdf
 
Traffic intersection is a piece of transportation infrastructure wha.pdf
  Traffic intersection is a piece of transportation infrastructure wha.pdf  Traffic intersection is a piece of transportation infrastructure wha.pdf
Traffic intersection is a piece of transportation infrastructure wha.pdf
 
Step1 pH =2 ; [H+] = 1 x10^-2 moleslitre Step2 .pdf
                     Step1 pH =2 ; [H+] = 1 x10^-2 moleslitre  Step2 .pdf                     Step1 pH =2 ; [H+] = 1 x10^-2 moleslitre  Step2 .pdf
Step1 pH =2 ; [H+] = 1 x10^-2 moleslitre Step2 .pdf
 
ZnOCu2OV2O3,Ni2O3MnO .pdf
                     ZnOCu2OV2O3,Ni2O3MnO                         .pdf                     ZnOCu2OV2O3,Ni2O3MnO                         .pdf
ZnOCu2OV2O3,Ni2O3MnO .pdf
 
There is actually a few differences. Firstly, a p.pdf
                     There is actually a few differences. Firstly, a p.pdf                     There is actually a few differences. Firstly, a p.pdf
There is actually a few differences. Firstly, a p.pdf
 
Hg^2+ is soft acid and thus akin to bind to soft .pdf
                     Hg^2+ is soft acid and thus akin to bind to soft .pdf                     Hg^2+ is soft acid and thus akin to bind to soft .pdf
Hg^2+ is soft acid and thus akin to bind to soft .pdf
 

Recently uploaded

On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
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 learningMarc Dusseiller Dusjagr
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
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.pptxCeline George
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsNbelano25
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
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.pptxDr. Ravikiran H M Gowda
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17Celine George
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfstareducators107
 

Recently uploaded (20)

Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
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
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
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
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Call Girls in Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in  Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in  Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
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
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 

import java.util.Scanner; import java.text.; public class Ave.pdf

  • 1. import java.util.Scanner; import java.text.*; public class AverageRainfall { public static void main(String[] args) { int years; // Variable to hold the amount of years final int MONTHS = 12; // Constant to hold the amount of months in a year int totalMonths = 0; // Months accumulator variable double monthlyRain; // Holds the amount of rain in inches for each month double totalRainfall = 0; // Holds the total rainfall NumberFormat df = DecimalFormat.getInstance(); // Decimal formating df.setMaximumFractionDigits(2); // Create Scanner object Scanner input = new Scanner(System.in); // Prompt user for the number of years System.out.println("Enter the number of years: "); years = input.nextInt(); System.out.println("Enter the rainfall amount for each month "); // Construct for-loop for each year for(int i=0; i < years; i++){ for(int j=1; j Solution import java.util.Scanner; import java.text.*;
  • 2. public class AverageRainfall { public static void main(String[] args) { int years; // Variable to hold the amount of years final int MONTHS = 12; // Constant to hold the amount of months in a year int totalMonths = 0; // Months accumulator variable double monthlyRain; // Holds the amount of rain in inches for each month double totalRainfall = 0; // Holds the total rainfall NumberFormat df = DecimalFormat.getInstance(); // Decimal formating df.setMaximumFractionDigits(2); // Create Scanner object Scanner input = new Scanner(System.in); // Prompt user for the number of years System.out.println("Enter the number of years: "); years = input.nextInt(); System.out.println("Enter the rainfall amount for each month "); // Construct for-loop for each year for(int i=0; i < years; i++){ for(int j=1; j