SlideShare a Scribd company logo
1 of 2
use integers not doubles- saves on data entry time when testing.
(Find the smallest element) Write a method that finds the smallest element in an array of double
values using the following header: public static double min(double[] array) Write a test program
that prompts the user to enter ten numbers, invokes this method to return the minimum value,
and displays the minimum value. Here is a sample run of the program:
Solution
import java.util.*;
import java.lang.*;
import java.io.*;
class Codechef
{
public static double min(double[] array){ // function to find the minimum
double min = array[0]; // assigning 1st element as min
for(int i=1;i<10;i++){ // looping through the elements of the array
if(min > array[i]) // condition check for current min
min = array[i];
}
return min; // return min value
}
public static void main (String[] args) throws java.lang.Exception // main function for testing the
min function
{
Scanner input = new Scanner(System.in);
System.out.print("Enter ten numbers: ");
double[] array = new double[10];
for(int i=0;i<10;i++){ // for loop for inputting 10 elements
double temp = input.nextDouble(); // getting double values from the user
array[i] = temp;
}
System.out.println("The minimum number is: "+min(array)); // invoking the min function and
printing
}
}
----------------------------------------
output
---------------------------------------

More Related Content

Similar to use integers not doubles- saves on data entry time when testing- (Find.docx

Node.js behind: V8 and its optimizations
Node.js behind: V8 and its optimizationsNode.js behind: V8 and its optimizations
Node.js behind: V8 and its optimizationsDawid Rusnak
 
In JavaIn a 2D Arraya.)Display the row and column with the hig.pdf
In JavaIn a 2D Arraya.)Display the row and column with the hig.pdfIn JavaIn a 2D Arraya.)Display the row and column with the hig.pdf
In JavaIn a 2D Arraya.)Display the row and column with the hig.pdffeelingspaldi
 
CountPositiveNumbersInArray.javapackage org.students;import java.pdf
CountPositiveNumbersInArray.javapackage org.students;import java.pdfCountPositiveNumbersInArray.javapackage org.students;import java.pdf
CountPositiveNumbersInArray.javapackage org.students;import java.pdfaparnatiwari291
 
Write a program that will test a name) method no sorting routine from.docx
 Write a program that will test a name) method no sorting routine from.docx Write a program that will test a name) method no sorting routine from.docx
Write a program that will test a name) method no sorting routine from.docxajoy21
 
java program assigment -2
java program assigment -2java program assigment -2
java program assigment -2Ankit Gupta
 
Python testing using mock and pytest
Python testing using mock and pytestPython testing using mock and pytest
Python testing using mock and pytestSuraj Deshmukh
 
Java performance
Java performanceJava performance
Java performanceSergey D
 
Workshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testingWorkshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testingVisual Engineering
 
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
 
Java Practical File Diploma
Java Practical File DiplomaJava Practical File Diploma
Java Practical File Diplomamustkeem khan
 
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISE
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISEWINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISE
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISEHitesh Mohapatra
 
Step 1You need to run the JAVA programs in sections 3.3 and 3.5 for.pdf
Step 1You need to run the JAVA programs in sections 3.3 and 3.5 for.pdfStep 1You need to run the JAVA programs in sections 3.3 and 3.5 for.pdf
Step 1You need to run the JAVA programs in sections 3.3 and 3.5 for.pdfaloeplusint
 
Average.javaimport java.util.Scanner;   import java.util.Arra.pdf
 Average.javaimport java.util.Scanner;   import java.util.Arra.pdf Average.javaimport java.util.Scanner;   import java.util.Arra.pdf
Average.javaimport java.util.Scanner;   import java.util.Arra.pdfanuragperipheral
 
Assignment Java Programming 2
Assignment Java Programming 2Assignment Java Programming 2
Assignment Java Programming 2Kaela Johnson
 

Similar to use integers not doubles- saves on data entry time when testing- (Find.docx (18)

Node.js behind: V8 and its optimizations
Node.js behind: V8 and its optimizationsNode.js behind: V8 and its optimizations
Node.js behind: V8 and its optimizations
 
In JavaIn a 2D Arraya.)Display the row and column with the hig.pdf
In JavaIn a 2D Arraya.)Display the row and column with the hig.pdfIn JavaIn a 2D Arraya.)Display the row and column with the hig.pdf
In JavaIn a 2D Arraya.)Display the row and column with the hig.pdf
 
Java programs
Java programsJava programs
Java programs
 
CountPositiveNumbersInArray.javapackage org.students;import java.pdf
CountPositiveNumbersInArray.javapackage org.students;import java.pdfCountPositiveNumbersInArray.javapackage org.students;import java.pdf
CountPositiveNumbersInArray.javapackage org.students;import java.pdf
 
Write a program that will test a name) method no sorting routine from.docx
 Write a program that will test a name) method no sorting routine from.docx Write a program that will test a name) method no sorting routine from.docx
Write a program that will test a name) method no sorting routine from.docx
 
java program assigment -2
java program assigment -2java program assigment -2
java program assigment -2
 
Python testing using mock and pytest
Python testing using mock and pytestPython testing using mock and pytest
Python testing using mock and pytest
 
Java performance
Java performanceJava performance
Java performance
 
Workshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testingWorkshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testing
 
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
 
Java Practical File Diploma
Java Practical File DiplomaJava Practical File Diploma
Java Practical File Diploma
 
Java final lab
Java final labJava final lab
Java final lab
 
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISE
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISEWINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISE
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISE
 
Step 1You need to run the JAVA programs in sections 3.3 and 3.5 for.pdf
Step 1You need to run the JAVA programs in sections 3.3 and 3.5 for.pdfStep 1You need to run the JAVA programs in sections 3.3 and 3.5 for.pdf
Step 1You need to run the JAVA programs in sections 3.3 and 3.5 for.pdf
 
CS2309 JAVA LAB MANUAL
CS2309 JAVA LAB MANUALCS2309 JAVA LAB MANUAL
CS2309 JAVA LAB MANUAL
 
Average.javaimport java.util.Scanner;   import java.util.Arra.pdf
 Average.javaimport java.util.Scanner;   import java.util.Arra.pdf Average.javaimport java.util.Scanner;   import java.util.Arra.pdf
Average.javaimport java.util.Scanner;   import java.util.Arra.pdf
 
Java doc Pr ITM2
Java doc Pr ITM2Java doc Pr ITM2
Java doc Pr ITM2
 
Assignment Java Programming 2
Assignment Java Programming 2Assignment Java Programming 2
Assignment Java Programming 2
 

More from kevin792

Two types of closing journal entries are posted to retained earnings a.docx
Two types of closing journal entries are posted to retained earnings a.docxTwo types of closing journal entries are posted to retained earnings a.docx
Two types of closing journal entries are posted to retained earnings a.docxkevin792
 
Unit 5- Discussion - Technology Ethics The textbook- --Technology in A.docx
Unit 5- Discussion - Technology Ethics The textbook- --Technology in A.docxUnit 5- Discussion - Technology Ethics The textbook- --Technology in A.docx
Unit 5- Discussion - Technology Ethics The textbook- --Technology in A.docxkevin792
 
Two parallel plates are seperated by a distance 2H- The plates are mov.docx
Two parallel plates are seperated by a distance 2H- The plates are mov.docxTwo parallel plates are seperated by a distance 2H- The plates are mov.docx
Two parallel plates are seperated by a distance 2H- The plates are mov.docxkevin792
 
ult View History Bookmarks Window Help wps-prenhall-com Problem Solvin.docx
ult View History Bookmarks Window Help wps-prenhall-com Problem Solvin.docxult View History Bookmarks Window Help wps-prenhall-com Problem Solvin.docx
ult View History Bookmarks Window Help wps-prenhall-com Problem Solvin.docxkevin792
 
uestion 5 Krispy Kreme Donuts has a leverage of 2-5 What does this mea.docx
uestion 5 Krispy Kreme Donuts has a leverage of 2-5 What does this mea.docxuestion 5 Krispy Kreme Donuts has a leverage of 2-5 What does this mea.docx
uestion 5 Krispy Kreme Donuts has a leverage of 2-5 What does this mea.docxkevin792
 
Two sound sources- I and 2- are emitting spherical waves in air- The f.docx
Two sound sources- I and 2- are emitting spherical waves in air- The f.docxTwo sound sources- I and 2- are emitting spherical waves in air- The f.docx
Two sound sources- I and 2- are emitting spherical waves in air- The f.docxkevin792
 
Type of financial crisis Type of financial crisisSolutionThere are m.docx
Type of financial crisis   Type of financial crisisSolutionThere are m.docxType of financial crisis   Type of financial crisisSolutionThere are m.docx
Type of financial crisis Type of financial crisisSolutionThere are m.docxkevin792
 
Typing Answer is Mandatory! Explain the difference between cyclic hydr.docx
Typing Answer is Mandatory! Explain the difference between cyclic hydr.docxTyping Answer is Mandatory! Explain the difference between cyclic hydr.docx
Typing Answer is Mandatory! Explain the difference between cyclic hydr.docxkevin792
 
type of accountsSolutionSolution- 1- All of the three are types of Acc.docx
type of accountsSolutionSolution- 1- All of the three are types of Acc.docxtype of accountsSolutionSolution- 1- All of the three are types of Acc.docx
type of accountsSolutionSolution- 1- All of the three are types of Acc.docxkevin792
 
Two KPMG auditors- Kevin Hall and Rosemary Meyer- were accused of impr.docx
Two KPMG auditors- Kevin Hall and Rosemary Meyer- were accused of impr.docxTwo KPMG auditors- Kevin Hall and Rosemary Meyer- were accused of impr.docx
Two KPMG auditors- Kevin Hall and Rosemary Meyer- were accused of impr.docxkevin792
 
Question 28 (3 points) A student performs a titration procedure by add.docx
Question 28 (3 points) A student performs a titration procedure by add.docxQuestion 28 (3 points) A student performs a titration procedure by add.docx
Question 28 (3 points) A student performs a titration procedure by add.docxkevin792
 
Question 26 The stock of Kenny Corp- is owned equally by two brothers-.docx
Question 26 The stock of Kenny Corp- is owned equally by two brothers-.docxQuestion 26 The stock of Kenny Corp- is owned equally by two brothers-.docx
Question 26 The stock of Kenny Corp- is owned equally by two brothers-.docxkevin792
 
Question 2 Which of the following would be a cash flow from financing.docx
Question 2 Which of the following would be a cash flow from financing.docxQuestion 2 Which of the following would be a cash flow from financing.docx
Question 2 Which of the following would be a cash flow from financing.docxkevin792
 
Question 2 1- Which of the following is not a way managers generally b.docx
Question 2 1- Which of the following is not a way managers generally b.docxQuestion 2 1- Which of the following is not a way managers generally b.docx
Question 2 1- Which of the following is not a way managers generally b.docxkevin792
 
Question 19 of 20 5 0 Points A important part of weather science is --.docx
Question 19 of 20 5 0 Points A important part of weather science is --.docxQuestion 19 of 20 5 0 Points A important part of weather science is --.docx
Question 19 of 20 5 0 Points A important part of weather science is --.docxkevin792
 
Question on Exponential and Logarithmic functions Banking The compound.docx
Question on Exponential and Logarithmic functions Banking The compound.docxQuestion on Exponential and Logarithmic functions Banking The compound.docx
Question on Exponential and Logarithmic functions Banking The compound.docxkevin792
 
Question Five- State the advantages and a major limitation of each of.docx
Question Five- State the advantages and a major limitation of each of.docxQuestion Five- State the advantages and a major limitation of each of.docx
Question Five- State the advantages and a major limitation of each of.docxkevin792
 
Question 11- (1 points) (#50 from textbook) The January 2- 2011 eart (1).docx
Question 11- (1 points)  (#50 from textbook)  The January 2- 2011 eart (1).docxQuestion 11- (1 points)  (#50 from textbook)  The January 2- 2011 eart (1).docx
Question 11- (1 points) (#50 from textbook) The January 2- 2011 eart (1).docxkevin792
 
Question Part Points Submissions Used Solution.docx
Question Part     Points     Submissions Used   Solution.docxQuestion Part     Points     Submissions Used   Solution.docx
Question Part Points Submissions Used Solution.docxkevin792
 
Question 11- (1 points) (#50 from textbook) The January 2- 2011 eart.docx
Question 11- (1 points)  (#50 from textbook)  The January 2- 2011 eart.docxQuestion 11- (1 points)  (#50 from textbook)  The January 2- 2011 eart.docx
Question 11- (1 points) (#50 from textbook) The January 2- 2011 eart.docxkevin792
 

More from kevin792 (20)

Two types of closing journal entries are posted to retained earnings a.docx
Two types of closing journal entries are posted to retained earnings a.docxTwo types of closing journal entries are posted to retained earnings a.docx
Two types of closing journal entries are posted to retained earnings a.docx
 
Unit 5- Discussion - Technology Ethics The textbook- --Technology in A.docx
Unit 5- Discussion - Technology Ethics The textbook- --Technology in A.docxUnit 5- Discussion - Technology Ethics The textbook- --Technology in A.docx
Unit 5- Discussion - Technology Ethics The textbook- --Technology in A.docx
 
Two parallel plates are seperated by a distance 2H- The plates are mov.docx
Two parallel plates are seperated by a distance 2H- The plates are mov.docxTwo parallel plates are seperated by a distance 2H- The plates are mov.docx
Two parallel plates are seperated by a distance 2H- The plates are mov.docx
 
ult View History Bookmarks Window Help wps-prenhall-com Problem Solvin.docx
ult View History Bookmarks Window Help wps-prenhall-com Problem Solvin.docxult View History Bookmarks Window Help wps-prenhall-com Problem Solvin.docx
ult View History Bookmarks Window Help wps-prenhall-com Problem Solvin.docx
 
uestion 5 Krispy Kreme Donuts has a leverage of 2-5 What does this mea.docx
uestion 5 Krispy Kreme Donuts has a leverage of 2-5 What does this mea.docxuestion 5 Krispy Kreme Donuts has a leverage of 2-5 What does this mea.docx
uestion 5 Krispy Kreme Donuts has a leverage of 2-5 What does this mea.docx
 
Two sound sources- I and 2- are emitting spherical waves in air- The f.docx
Two sound sources- I and 2- are emitting spherical waves in air- The f.docxTwo sound sources- I and 2- are emitting spherical waves in air- The f.docx
Two sound sources- I and 2- are emitting spherical waves in air- The f.docx
 
Type of financial crisis Type of financial crisisSolutionThere are m.docx
Type of financial crisis   Type of financial crisisSolutionThere are m.docxType of financial crisis   Type of financial crisisSolutionThere are m.docx
Type of financial crisis Type of financial crisisSolutionThere are m.docx
 
Typing Answer is Mandatory! Explain the difference between cyclic hydr.docx
Typing Answer is Mandatory! Explain the difference between cyclic hydr.docxTyping Answer is Mandatory! Explain the difference between cyclic hydr.docx
Typing Answer is Mandatory! Explain the difference between cyclic hydr.docx
 
type of accountsSolutionSolution- 1- All of the three are types of Acc.docx
type of accountsSolutionSolution- 1- All of the three are types of Acc.docxtype of accountsSolutionSolution- 1- All of the three are types of Acc.docx
type of accountsSolutionSolution- 1- All of the three are types of Acc.docx
 
Two KPMG auditors- Kevin Hall and Rosemary Meyer- were accused of impr.docx
Two KPMG auditors- Kevin Hall and Rosemary Meyer- were accused of impr.docxTwo KPMG auditors- Kevin Hall and Rosemary Meyer- were accused of impr.docx
Two KPMG auditors- Kevin Hall and Rosemary Meyer- were accused of impr.docx
 
Question 28 (3 points) A student performs a titration procedure by add.docx
Question 28 (3 points) A student performs a titration procedure by add.docxQuestion 28 (3 points) A student performs a titration procedure by add.docx
Question 28 (3 points) A student performs a titration procedure by add.docx
 
Question 26 The stock of Kenny Corp- is owned equally by two brothers-.docx
Question 26 The stock of Kenny Corp- is owned equally by two brothers-.docxQuestion 26 The stock of Kenny Corp- is owned equally by two brothers-.docx
Question 26 The stock of Kenny Corp- is owned equally by two brothers-.docx
 
Question 2 Which of the following would be a cash flow from financing.docx
Question 2 Which of the following would be a cash flow from financing.docxQuestion 2 Which of the following would be a cash flow from financing.docx
Question 2 Which of the following would be a cash flow from financing.docx
 
Question 2 1- Which of the following is not a way managers generally b.docx
Question 2 1- Which of the following is not a way managers generally b.docxQuestion 2 1- Which of the following is not a way managers generally b.docx
Question 2 1- Which of the following is not a way managers generally b.docx
 
Question 19 of 20 5 0 Points A important part of weather science is --.docx
Question 19 of 20 5 0 Points A important part of weather science is --.docxQuestion 19 of 20 5 0 Points A important part of weather science is --.docx
Question 19 of 20 5 0 Points A important part of weather science is --.docx
 
Question on Exponential and Logarithmic functions Banking The compound.docx
Question on Exponential and Logarithmic functions Banking The compound.docxQuestion on Exponential and Logarithmic functions Banking The compound.docx
Question on Exponential and Logarithmic functions Banking The compound.docx
 
Question Five- State the advantages and a major limitation of each of.docx
Question Five- State the advantages and a major limitation of each of.docxQuestion Five- State the advantages and a major limitation of each of.docx
Question Five- State the advantages and a major limitation of each of.docx
 
Question 11- (1 points) (#50 from textbook) The January 2- 2011 eart (1).docx
Question 11- (1 points)  (#50 from textbook)  The January 2- 2011 eart (1).docxQuestion 11- (1 points)  (#50 from textbook)  The January 2- 2011 eart (1).docx
Question 11- (1 points) (#50 from textbook) The January 2- 2011 eart (1).docx
 
Question Part Points Submissions Used Solution.docx
Question Part     Points     Submissions Used   Solution.docxQuestion Part     Points     Submissions Used   Solution.docx
Question Part Points Submissions Used Solution.docx
 
Question 11- (1 points) (#50 from textbook) The January 2- 2011 eart.docx
Question 11- (1 points)  (#50 from textbook)  The January 2- 2011 eart.docxQuestion 11- (1 points)  (#50 from textbook)  The January 2- 2011 eart.docx
Question 11- (1 points) (#50 from textbook) The January 2- 2011 eart.docx
 

Recently uploaded

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
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
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
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 

Recently uploaded (20)

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...
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
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
 
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
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 

use integers not doubles- saves on data entry time when testing- (Find.docx

  • 1. use integers not doubles- saves on data entry time when testing. (Find the smallest element) Write a method that finds the smallest element in an array of double values using the following header: public static double min(double[] array) Write a test program that prompts the user to enter ten numbers, invokes this method to return the minimum value, and displays the minimum value. Here is a sample run of the program: Solution import java.util.*; import java.lang.*; import java.io.*; class Codechef { public static double min(double[] array){ // function to find the minimum double min = array[0]; // assigning 1st element as min for(int i=1;i<10;i++){ // looping through the elements of the array if(min > array[i]) // condition check for current min min = array[i]; } return min; // return min value } public static void main (String[] args) throws java.lang.Exception // main function for testing the min function { Scanner input = new Scanner(System.in); System.out.print("Enter ten numbers: "); double[] array = new double[10]; for(int i=0;i<10;i++){ // for loop for inputting 10 elements double temp = input.nextDouble(); // getting double values from the user array[i] = temp; } System.out.println("The minimum number is: "+min(array)); // invoking the min function and printing