SlideShare a Scribd company logo
1 of 4
Download to read offline
//FileName: EX06_1.java
//Programmer: ............
import java.util.Scanner;
import java.util.Arrays;
public class EX06_1
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
System.out.print("Enter a list of SAT scores: ");
String str = input.nextLine();
String[] items = str.split(" ");
double[] values = new double[items.length];
for (int i = 0; i<items.length; i++)
{
values[i] = Double.parseDouble(items[i]);
}
//count
System.out.print("Count: ");
int count = 0;
for (int i=0; i<values.length; i++)
{
count++;
}
System.out.println((count == values.length) ? values.length : count);
//sum
double sum = 0;
for (int i = 0; i<values.length; i++)
{
sum += values[i];
}
System.out.println("Sum: " + sum);
//mean
double mean = (sum/count);
System.out.println("Mean: " + mean);
//min and max
double min = values[0];
double max = values[0];
for (int i=1; i<values.length; i++)
{
if (values[i] < min)
{
min = values[i];
}
if (values[i] > max)
{
max = values[i];
}
}
System.out.println("Minimum: " + min);
System.out.println("Maximum: " + max);
System.out.println("Range: " + (max-min));
//sorting
Arrays.sort(values);
//median
int position = (count+1) / 2;
if (count%2 != 0)
{
System.out.println("Median: " + values[position-1]);
}
else
{
System.out.println("Median: " + (( values[position-1] + values[position]) / 2));
}
//Standard deviation
double sigmap = 0; //for population
double sigmas = 0; //for sample
for (int i=0; i<values.length; i++)
{
sigmap += (values[i] - mean)*(values[i] - mean);
}
sigmas = sigmap;
//sd for population
sigmap = sigmap / count;
System.out.println("Variance of population: " + sigmap);
double sdp = Math.sqrt(sigmap);
System.out.println("Standard Deviation of population: " + sdp);
//sd for sample
sigmas = sigmas / (count - 1);
System.out.println("Variance of sample: " + sigmas);
double sds = Math.sqrt(sigmas);
System.out.println("Standard Deviation of sample: " + sds);
//Skewness
double sigma = 0;
for (int i=0; i<values.length; i++)
{
sigma += (values[i] - mean)*(values[i] - mean)*(values[i] - mean);
}
double N = (double) count;
double sk = (Math.sqrt(N*(N-1)) / (N-2)) * (sigma / (sdp*sdp*sdp*N));
System.out.println("Skewness: " + sk);
//mode
int repeated = -1;
int[] frq = new int[values.length];
for (int i=0; i<values.length; i++)
{
int occ = 1;
for (int j=i+1; j<values.length; j++)
{
if (values[i] == values[j])
{
frq[j] = repeated;
occ++;
}
}
if (frq[i] != repeated)
{
frq[i] = occ;
}
}
int maxFrq = frq[0];
for (int i=0; i<frq.length; i++)
{
if (frq[i] > maxFrq)
{
maxFrq = frq[i];
}
}
System.out.print("Mode: ");
if (maxFrq == 1)
{
System.out.println("N/A");
}
else
{
for (int i=0; i<frq.length; i++)
{
if (frq[i] == maxFrq)
{
System.out.print(values[i] + " ");
}
}
System.out.print("n");
}
double standardError=sds/Math.sqrt(count);
System.out.println("Standard Error: "+standardError);
}
}
Programming Exercise #06_2:
Instruction:
1. Make a copy of your EX06_01.java file and rename it to EX06_2.java.
2. Open the EX06_02.java file, mode the following two lines (be sure to replace YourFullName
with your full name): // FileName: EX06_2.java // Programmer: YourFullName
3. Convert the code, so it can use an input dialog box to ask for inputs and display the output in a
message dialog box as shown below

More Related Content

Similar to FileName EX06_1java Programmer import ja.pdf

Example of JAVA Program
Example of JAVA ProgramExample of JAVA Program
Example of JAVA ProgramTrenton Asbury
 
Java Simple Programs
Java Simple ProgramsJava Simple Programs
Java Simple ProgramsUpender Upr
 
Java AssignmentWrite a program using sortingsorting bubble,sele.pdf
Java AssignmentWrite a program using sortingsorting bubble,sele.pdfJava AssignmentWrite a program using sortingsorting bubble,sele.pdf
Java AssignmentWrite a program using sortingsorting bubble,sele.pdfeyewatchsystems
 
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...MaruMengesha
 
Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
 Problem1 java codeimport java.util.Scanner; Java code to pr.pdf Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
Problem1 java codeimport java.util.Scanner; Java code to pr.pdfanupamfootwear
 
Write the code above and the ones below in netbeans IDE 8.13. (Eli.pdf
Write the code above and the ones below in netbeans IDE 8.13. (Eli.pdfWrite the code above and the ones below in netbeans IDE 8.13. (Eli.pdf
Write the code above and the ones below in netbeans IDE 8.13. (Eli.pdfarihantmum
 
Presentation1 computer shaan
Presentation1 computer shaanPresentation1 computer shaan
Presentation1 computer shaanwalia Shaan
 
VIT351 Software Development VI Unit2
VIT351 Software Development VI Unit2VIT351 Software Development VI Unit2
VIT351 Software Development VI Unit2YOGESH SINGH
 
Java programs - bubble sort, iterator, linked list, hash set, reverse string,...
Java programs - bubble sort, iterator, linked list, hash set, reverse string,...Java programs - bubble sort, iterator, linked list, hash set, reverse string,...
Java programs - bubble sort, iterator, linked list, hash set, reverse string,...Sunil Kumar Gunasekaran
 
import java.uti-WPS Office.docx
import java.uti-WPS Office.docximport java.uti-WPS Office.docx
import java.uti-WPS Office.docxKatecate1
 
An object of class StatCalc can be used to compute several simp.pdf
 An object of class StatCalc can be used to compute several simp.pdf An object of class StatCalc can be used to compute several simp.pdf
An object of class StatCalc can be used to compute several simp.pdfaravlitraders2012
 
Java binary subtraction
Java binary subtractionJava binary subtraction
Java binary subtractionCharm Sasi
 
ch04-conditional-execution.ppt
ch04-conditional-execution.pptch04-conditional-execution.ppt
ch04-conditional-execution.pptMahyuddin8
 
ch03-parameters-objects.ppt
ch03-parameters-objects.pptch03-parameters-objects.ppt
ch03-parameters-objects.pptMahyuddin8
 
Core java pract_sem iii
Core java pract_sem iiiCore java pract_sem iii
Core java pract_sem iiiNiraj Bharambe
 
Code javascript
Code javascriptCode javascript
Code javascriptRay Ray
 

Similar to FileName EX06_1java Programmer import ja.pdf (20)

Example of JAVA Program
Example of JAVA ProgramExample of JAVA Program
Example of JAVA Program
 
PRACTICAL COMPUTING
PRACTICAL COMPUTINGPRACTICAL COMPUTING
PRACTICAL COMPUTING
 
Java Simple Programs
Java Simple ProgramsJava Simple Programs
Java Simple Programs
 
Java AssignmentWrite a program using sortingsorting bubble,sele.pdf
Java AssignmentWrite a program using sortingsorting bubble,sele.pdfJava AssignmentWrite a program using sortingsorting bubble,sele.pdf
Java AssignmentWrite a program using sortingsorting bubble,sele.pdf
 
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...
 
Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
 Problem1 java codeimport java.util.Scanner; Java code to pr.pdf Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
 
Write the code above and the ones below in netbeans IDE 8.13. (Eli.pdf
Write the code above and the ones below in netbeans IDE 8.13. (Eli.pdfWrite the code above and the ones below in netbeans IDE 8.13. (Eli.pdf
Write the code above and the ones below in netbeans IDE 8.13. (Eli.pdf
 
Presentation1 computer shaan
Presentation1 computer shaanPresentation1 computer shaan
Presentation1 computer shaan
 
Parameters
ParametersParameters
Parameters
 
Sam wd programs
Sam wd programsSam wd programs
Sam wd programs
 
VIT351 Software Development VI Unit2
VIT351 Software Development VI Unit2VIT351 Software Development VI Unit2
VIT351 Software Development VI Unit2
 
Java programs - bubble sort, iterator, linked list, hash set, reverse string,...
Java programs - bubble sort, iterator, linked list, hash set, reverse string,...Java programs - bubble sort, iterator, linked list, hash set, reverse string,...
Java programs - bubble sort, iterator, linked list, hash set, reverse string,...
 
import java.uti-WPS Office.docx
import java.uti-WPS Office.docximport java.uti-WPS Office.docx
import java.uti-WPS Office.docx
 
An object of class StatCalc can be used to compute several simp.pdf
 An object of class StatCalc can be used to compute several simp.pdf An object of class StatCalc can be used to compute several simp.pdf
An object of class StatCalc can be used to compute several simp.pdf
 
Java binary subtraction
Java binary subtractionJava binary subtraction
Java binary subtraction
 
ch04-conditional-execution.ppt
ch04-conditional-execution.pptch04-conditional-execution.ppt
ch04-conditional-execution.ppt
 
ch03-parameters-objects.ppt
ch03-parameters-objects.pptch03-parameters-objects.ppt
ch03-parameters-objects.ppt
 
3.Lesson Plan - Input.pdf.pdf
3.Lesson Plan - Input.pdf.pdf3.Lesson Plan - Input.pdf.pdf
3.Lesson Plan - Input.pdf.pdf
 
Core java pract_sem iii
Core java pract_sem iiiCore java pract_sem iii
Core java pract_sem iii
 
Code javascript
Code javascriptCode javascript
Code javascript
 

More from actocomputer

Figure 3 below shows that the survival rate of Blue Wildeb.pdf
Figure 3 below shows that the survival rate of Blue Wildeb.pdfFigure 3 below shows that the survival rate of Blue Wildeb.pdf
Figure 3 below shows that the survival rate of Blue Wildeb.pdfactocomputer
 
FIGURE 241 Refer to Figure 241 Suppose the economy is cur.pdf
FIGURE 241 Refer to Figure 241 Suppose the economy is cur.pdfFIGURE 241 Refer to Figure 241 Suppose the economy is cur.pdf
FIGURE 241 Refer to Figure 241 Suppose the economy is cur.pdfactocomputer
 
Fibroblast cells from patients Jack Karen Agatha and Tony.pdf
Fibroblast cells from patients Jack Karen Agatha and Tony.pdfFibroblast cells from patients Jack Karen Agatha and Tony.pdf
Fibroblast cells from patients Jack Karen Agatha and Tony.pdfactocomputer
 
Fetal pig What is the purpose of the pericardial sac that su.pdf
Fetal pig What is the purpose of the pericardial sac that su.pdfFetal pig What is the purpose of the pericardial sac that su.pdf
Fetal pig What is the purpose of the pericardial sac that su.pdfactocomputer
 
Find the probability PEc if PE019 The probability PE.pdf
Find the probability PEc if PE019 The probability PE.pdfFind the probability PEc if PE019 The probability PE.pdf
Find the probability PEc if PE019 The probability PE.pdfactocomputer
 
Feral pigs are an invasive species around the world They ca.pdf
Feral pigs are an invasive species around the world They ca.pdfFeral pigs are an invasive species around the world They ca.pdf
Feral pigs are an invasive species around the world They ca.pdfactocomputer
 
Find the maximum likelihood estimator of +2 Suppose that .pdf
Find the maximum likelihood estimator of +2 Suppose that .pdfFind the maximum likelihood estimator of +2 Suppose that .pdf
Find the maximum likelihood estimator of +2 Suppose that .pdfactocomputer
 
Find the indicated IQ score The graph to the right depicts .pdf
Find the indicated IQ score The graph to the right depicts .pdfFind the indicated IQ score The graph to the right depicts .pdf
Find the indicated IQ score The graph to the right depicts .pdfactocomputer
 
Female labour force participation rate and economic growth i.pdf
Female labour force participation rate and economic growth i.pdfFemale labour force participation rate and economic growth i.pdf
Female labour force participation rate and economic growth i.pdfactocomputer
 
FedEx construy su negocio sobre la base de la entrega rpid.pdf
FedEx construy su negocio sobre la base de la entrega rpid.pdfFedEx construy su negocio sobre la base de la entrega rpid.pdf
FedEx construy su negocio sobre la base de la entrega rpid.pdfactocomputer
 
fecower Kayimood Dwicyo Soens sherwood Compact dise playe.pdf
fecower Kayimood Dwicyo Soens sherwood Compact dise playe.pdffecower Kayimood Dwicyo Soens sherwood Compact dise playe.pdf
fecower Kayimood Dwicyo Soens sherwood Compact dise playe.pdfactocomputer
 
Find the area of the shaded region The graph to the right de.pdf
Find the area of the shaded region The graph to the right de.pdfFind the area of the shaded region The graph to the right de.pdf
Find the area of the shaded region The graph to the right de.pdfactocomputer
 
Find code that you wrote and apply 2 of the 3 design princip.pdf
Find code that you wrote and apply 2 of the 3 design princip.pdfFind code that you wrote and apply 2 of the 3 design princip.pdf
Find code that you wrote and apply 2 of the 3 design princip.pdfactocomputer
 
Find a current news article or video within the past 12 mon.pdf
Find a current news article or video within the past 12 mon.pdfFind a current news article or video within the past 12 mon.pdf
Find a current news article or video within the past 12 mon.pdfactocomputer
 
Female pig Emmy Lou straight tail whitehaired with the h.pdf
Female pig Emmy Lou straight tail whitehaired with the h.pdfFemale pig Emmy Lou straight tail whitehaired with the h.pdf
Female pig Emmy Lou straight tail whitehaired with the h.pdfactocomputer
 
Financing Assumptions Please assume a traditional bank cons.pdf
Financing Assumptions Please assume a traditional bank cons.pdfFinancing Assumptions Please assume a traditional bank cons.pdf
Financing Assumptions Please assume a traditional bank cons.pdfactocomputer
 
FigURE 01 Needle intersecting the border of the ruled tabl.pdf
FigURE 01 Needle intersecting the border of the ruled tabl.pdfFigURE 01 Needle intersecting the border of the ruled tabl.pdf
FigURE 01 Needle intersecting the border of the ruled tabl.pdfactocomputer
 
Financial InformationFinancial InformationFinancial In.pdf
Financial InformationFinancial InformationFinancial In.pdfFinancial InformationFinancial InformationFinancial In.pdf
Financial InformationFinancial InformationFinancial In.pdfactocomputer
 
Fewer open fNa+ and Ca++ channels during the pacemaker poten.pdf
Fewer open fNa+ and Ca++ channels during the pacemaker poten.pdfFewer open fNa+ and Ca++ channels during the pacemaker poten.pdf
Fewer open fNa+ and Ca++ channels during the pacemaker poten.pdfactocomputer
 
FIN 3100 Principios de Finanzas Caso de estudio Barry y S.pdf
FIN 3100 Principios de Finanzas   Caso de estudio  Barry y S.pdfFIN 3100 Principios de Finanzas   Caso de estudio  Barry y S.pdf
FIN 3100 Principios de Finanzas Caso de estudio Barry y S.pdfactocomputer
 

More from actocomputer (20)

Figure 3 below shows that the survival rate of Blue Wildeb.pdf
Figure 3 below shows that the survival rate of Blue Wildeb.pdfFigure 3 below shows that the survival rate of Blue Wildeb.pdf
Figure 3 below shows that the survival rate of Blue Wildeb.pdf
 
FIGURE 241 Refer to Figure 241 Suppose the economy is cur.pdf
FIGURE 241 Refer to Figure 241 Suppose the economy is cur.pdfFIGURE 241 Refer to Figure 241 Suppose the economy is cur.pdf
FIGURE 241 Refer to Figure 241 Suppose the economy is cur.pdf
 
Fibroblast cells from patients Jack Karen Agatha and Tony.pdf
Fibroblast cells from patients Jack Karen Agatha and Tony.pdfFibroblast cells from patients Jack Karen Agatha and Tony.pdf
Fibroblast cells from patients Jack Karen Agatha and Tony.pdf
 
Fetal pig What is the purpose of the pericardial sac that su.pdf
Fetal pig What is the purpose of the pericardial sac that su.pdfFetal pig What is the purpose of the pericardial sac that su.pdf
Fetal pig What is the purpose of the pericardial sac that su.pdf
 
Find the probability PEc if PE019 The probability PE.pdf
Find the probability PEc if PE019 The probability PE.pdfFind the probability PEc if PE019 The probability PE.pdf
Find the probability PEc if PE019 The probability PE.pdf
 
Feral pigs are an invasive species around the world They ca.pdf
Feral pigs are an invasive species around the world They ca.pdfFeral pigs are an invasive species around the world They ca.pdf
Feral pigs are an invasive species around the world They ca.pdf
 
Find the maximum likelihood estimator of +2 Suppose that .pdf
Find the maximum likelihood estimator of +2 Suppose that .pdfFind the maximum likelihood estimator of +2 Suppose that .pdf
Find the maximum likelihood estimator of +2 Suppose that .pdf
 
Find the indicated IQ score The graph to the right depicts .pdf
Find the indicated IQ score The graph to the right depicts .pdfFind the indicated IQ score The graph to the right depicts .pdf
Find the indicated IQ score The graph to the right depicts .pdf
 
Female labour force participation rate and economic growth i.pdf
Female labour force participation rate and economic growth i.pdfFemale labour force participation rate and economic growth i.pdf
Female labour force participation rate and economic growth i.pdf
 
FedEx construy su negocio sobre la base de la entrega rpid.pdf
FedEx construy su negocio sobre la base de la entrega rpid.pdfFedEx construy su negocio sobre la base de la entrega rpid.pdf
FedEx construy su negocio sobre la base de la entrega rpid.pdf
 
fecower Kayimood Dwicyo Soens sherwood Compact dise playe.pdf
fecower Kayimood Dwicyo Soens sherwood Compact dise playe.pdffecower Kayimood Dwicyo Soens sherwood Compact dise playe.pdf
fecower Kayimood Dwicyo Soens sherwood Compact dise playe.pdf
 
Find the area of the shaded region The graph to the right de.pdf
Find the area of the shaded region The graph to the right de.pdfFind the area of the shaded region The graph to the right de.pdf
Find the area of the shaded region The graph to the right de.pdf
 
Find code that you wrote and apply 2 of the 3 design princip.pdf
Find code that you wrote and apply 2 of the 3 design princip.pdfFind code that you wrote and apply 2 of the 3 design princip.pdf
Find code that you wrote and apply 2 of the 3 design princip.pdf
 
Find a current news article or video within the past 12 mon.pdf
Find a current news article or video within the past 12 mon.pdfFind a current news article or video within the past 12 mon.pdf
Find a current news article or video within the past 12 mon.pdf
 
Female pig Emmy Lou straight tail whitehaired with the h.pdf
Female pig Emmy Lou straight tail whitehaired with the h.pdfFemale pig Emmy Lou straight tail whitehaired with the h.pdf
Female pig Emmy Lou straight tail whitehaired with the h.pdf
 
Financing Assumptions Please assume a traditional bank cons.pdf
Financing Assumptions Please assume a traditional bank cons.pdfFinancing Assumptions Please assume a traditional bank cons.pdf
Financing Assumptions Please assume a traditional bank cons.pdf
 
FigURE 01 Needle intersecting the border of the ruled tabl.pdf
FigURE 01 Needle intersecting the border of the ruled tabl.pdfFigURE 01 Needle intersecting the border of the ruled tabl.pdf
FigURE 01 Needle intersecting the border of the ruled tabl.pdf
 
Financial InformationFinancial InformationFinancial In.pdf
Financial InformationFinancial InformationFinancial In.pdfFinancial InformationFinancial InformationFinancial In.pdf
Financial InformationFinancial InformationFinancial In.pdf
 
Fewer open fNa+ and Ca++ channels during the pacemaker poten.pdf
Fewer open fNa+ and Ca++ channels during the pacemaker poten.pdfFewer open fNa+ and Ca++ channels during the pacemaker poten.pdf
Fewer open fNa+ and Ca++ channels during the pacemaker poten.pdf
 
FIN 3100 Principios de Finanzas Caso de estudio Barry y S.pdf
FIN 3100 Principios de Finanzas   Caso de estudio  Barry y S.pdfFIN 3100 Principios de Finanzas   Caso de estudio  Barry y S.pdf
FIN 3100 Principios de Finanzas Caso de estudio Barry y S.pdf
 

Recently uploaded

Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 

Recently uploaded (20)

Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 

FileName EX06_1java Programmer import ja.pdf

  • 1. //FileName: EX06_1.java //Programmer: ............ import java.util.Scanner; import java.util.Arrays; public class EX06_1 { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter a list of SAT scores: "); String str = input.nextLine(); String[] items = str.split(" "); double[] values = new double[items.length]; for (int i = 0; i<items.length; i++) { values[i] = Double.parseDouble(items[i]); } //count System.out.print("Count: "); int count = 0; for (int i=0; i<values.length; i++) { count++; } System.out.println((count == values.length) ? values.length : count); //sum double sum = 0; for (int i = 0; i<values.length; i++) { sum += values[i]; } System.out.println("Sum: " + sum); //mean double mean = (sum/count); System.out.println("Mean: " + mean); //min and max double min = values[0]; double max = values[0]; for (int i=1; i<values.length; i++) { if (values[i] < min) {
  • 2. min = values[i]; } if (values[i] > max) { max = values[i]; } } System.out.println("Minimum: " + min); System.out.println("Maximum: " + max); System.out.println("Range: " + (max-min)); //sorting Arrays.sort(values); //median int position = (count+1) / 2; if (count%2 != 0) { System.out.println("Median: " + values[position-1]); } else { System.out.println("Median: " + (( values[position-1] + values[position]) / 2)); } //Standard deviation double sigmap = 0; //for population double sigmas = 0; //for sample for (int i=0; i<values.length; i++) { sigmap += (values[i] - mean)*(values[i] - mean); } sigmas = sigmap; //sd for population sigmap = sigmap / count; System.out.println("Variance of population: " + sigmap); double sdp = Math.sqrt(sigmap); System.out.println("Standard Deviation of population: " + sdp); //sd for sample sigmas = sigmas / (count - 1); System.out.println("Variance of sample: " + sigmas); double sds = Math.sqrt(sigmas); System.out.println("Standard Deviation of sample: " + sds); //Skewness double sigma = 0;
  • 3. for (int i=0; i<values.length; i++) { sigma += (values[i] - mean)*(values[i] - mean)*(values[i] - mean); } double N = (double) count; double sk = (Math.sqrt(N*(N-1)) / (N-2)) * (sigma / (sdp*sdp*sdp*N)); System.out.println("Skewness: " + sk); //mode int repeated = -1; int[] frq = new int[values.length]; for (int i=0; i<values.length; i++) { int occ = 1; for (int j=i+1; j<values.length; j++) { if (values[i] == values[j]) { frq[j] = repeated; occ++; } } if (frq[i] != repeated) { frq[i] = occ; } } int maxFrq = frq[0]; for (int i=0; i<frq.length; i++) { if (frq[i] > maxFrq) { maxFrq = frq[i]; } } System.out.print("Mode: "); if (maxFrq == 1) { System.out.println("N/A"); } else { for (int i=0; i<frq.length; i++)
  • 4. { if (frq[i] == maxFrq) { System.out.print(values[i] + " "); } } System.out.print("n"); } double standardError=sds/Math.sqrt(count); System.out.println("Standard Error: "+standardError); } } Programming Exercise #06_2: Instruction: 1. Make a copy of your EX06_01.java file and rename it to EX06_2.java. 2. Open the EX06_02.java file, mode the following two lines (be sure to replace YourFullName with your full name): // FileName: EX06_2.java // Programmer: YourFullName 3. Convert the code, so it can use an input dialog box to ask for inputs and display the output in a message dialog box as shown below