SlideShare a Scribd company logo
1 of 3
Download to read offline
In Java;
Input is from a file. The input is all doubles. You are to input these doubles 2 at a time (the
length and width), create a Rectangle and determine if it has the largest area. Output the
Rectangle with the largest area.
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Lab8Num2 {
public static void main(String[] args) {
File inFile = new File("lab8.in");
Scanner fileInput = null;
try {
fileInput = new Scanner(inFile);
} catch (FileNotFoundException ex) {
}
//get first Rectangle and make it the biggest;
//do NOT put into an arrayList and sort.
while ()
{ //get more data from file
//make Rectangle
//see if it is bigger than biggest so far
//if so, it is the new biggest
}
System.out.println("The biggest rectangle was " + biggest);
}
}
public class Rectangle
{
private double length, width;
public Rectangle()
{
length=0;
width=0;
}
public Rectangle(double len, double wid)
{
length=len;
width=wid;
}
public double getLength() {
return length;
}
public void setLength(double length) {
this.length = length;
}
public double getWidth() {
return width;
}
public void setWidth(double width) {
this.width = width;
}
public double area()
{
return length*width;
}
public double perimeter()
{
return 2*(length+width);
}
public String toString()
{
return "Length: " + length + " Width: " + width;
}
public int compareTo(Rectangle r)
{
}
}
In Java- Input is from a file- The input is all doubles- You are to in.pdf

More Related Content

Similar to In Java- Input is from a file- The input is all doubles- You are to in.pdf

PAGE 1Input output for a file tutorialStreams and File IOI.docx
PAGE  1Input output for a file tutorialStreams and File IOI.docxPAGE  1Input output for a file tutorialStreams and File IOI.docx
PAGE 1Input output for a file tutorialStreams and File IOI.docxalfred4lewis58146
 
Change the code in Writer.java only to get it working. Must contain .pdf
Change the code in Writer.java only to get it working. Must contain .pdfChange the code in Writer.java only to get it working. Must contain .pdf
Change the code in Writer.java only to get it working. Must contain .pdfsecunderbadtirumalgi
 
Hi, I need help with a java programming project. specifically practi.pdf
Hi, I need help with a java programming project. specifically practi.pdfHi, I need help with a java programming project. specifically practi.pdf
Hi, I need help with a java programming project. specifically practi.pdfPRATIKSINHA7304
 
Complete the following Java code such that it opens a file named Fruit.docx
Complete the following Java code such that it opens a file named Fruit.docxComplete the following Java code such that it opens a file named Fruit.docx
Complete the following Java code such that it opens a file named Fruit.docxljohn878
 
This is a java lab assignment. I have added the first part java re.pdf
This is a java lab assignment. I have added the first part java re.pdfThis is a java lab assignment. I have added the first part java re.pdf
This is a java lab assignment. I have added the first part java re.pdffeetshoemart
 
Java căn bản - Chapter12
Java căn bản - Chapter12Java căn bản - Chapter12
Java căn bản - Chapter12Vince Vo
 
Chapter 12 - File Input and Output
Chapter 12 - File Input and OutputChapter 12 - File Input and Output
Chapter 12 - File Input and OutputEduardo Bergavera
 
Active Software Documentation using Soul and IntensiVE
Active Software Documentation using Soul and IntensiVEActive Software Documentation using Soul and IntensiVE
Active Software Documentation using Soul and IntensiVEkim.mens
 
I can not get my code to comply it gets mad that I have run declare mo.docx
I can not get my code to comply it gets mad that I have run declare mo.docxI can not get my code to comply it gets mad that I have run declare mo.docx
I can not get my code to comply it gets mad that I have run declare mo.docxhamblymarta
 
Various types of File Operations in Java
Various types of  File Operations in JavaVarious types of  File Operations in Java
Various types of File Operations in JavaRanjithaM32
 
File Input & Output
File Input & OutputFile Input & Output
File Input & OutputPRN USM
 
Input output files in java
Input output files in javaInput output files in java
Input output files in javaKavitha713564
 

Similar to In Java- Input is from a file- The input is all doubles- You are to in.pdf (20)

IO and threads Java
IO and threads JavaIO and threads Java
IO and threads Java
 
Inheritance
InheritanceInheritance
Inheritance
 
PAGE 1Input output for a file tutorialStreams and File IOI.docx
PAGE  1Input output for a file tutorialStreams and File IOI.docxPAGE  1Input output for a file tutorialStreams and File IOI.docx
PAGE 1Input output for a file tutorialStreams and File IOI.docx
 
Change the code in Writer.java only to get it working. Must contain .pdf
Change the code in Writer.java only to get it working. Must contain .pdfChange the code in Writer.java only to get it working. Must contain .pdf
Change the code in Writer.java only to get it working. Must contain .pdf
 
Hi, I need help with a java programming project. specifically practi.pdf
Hi, I need help with a java programming project. specifically practi.pdfHi, I need help with a java programming project. specifically practi.pdf
Hi, I need help with a java programming project. specifically practi.pdf
 
Complete the following Java code such that it opens a file named Fruit.docx
Complete the following Java code such that it opens a file named Fruit.docxComplete the following Java code such that it opens a file named Fruit.docx
Complete the following Java code such that it opens a file named Fruit.docx
 
This is a java lab assignment. I have added the first part java re.pdf
This is a java lab assignment. I have added the first part java re.pdfThis is a java lab assignment. I have added the first part java re.pdf
This is a java lab assignment. I have added the first part java re.pdf
 
Java căn bản - Chapter12
Java căn bản - Chapter12Java căn bản - Chapter12
Java căn bản - Chapter12
 
Chapter 12 - File Input and Output
Chapter 12 - File Input and OutputChapter 12 - File Input and Output
Chapter 12 - File Input and Output
 
Active Software Documentation using Soul and IntensiVE
Active Software Documentation using Soul and IntensiVEActive Software Documentation using Soul and IntensiVE
Active Software Documentation using Soul and IntensiVE
 
FileHandling.docx
FileHandling.docxFileHandling.docx
FileHandling.docx
 
Chapter 5 Class File
Chapter 5 Class FileChapter 5 Class File
Chapter 5 Class File
 
Java 7
Java 7Java 7
Java 7
 
Oop lecture9 11
Oop lecture9 11Oop lecture9 11
Oop lecture9 11
 
Oop lecture9 12
Oop lecture9 12Oop lecture9 12
Oop lecture9 12
 
I can not get my code to comply it gets mad that I have run declare mo.docx
I can not get my code to comply it gets mad that I have run declare mo.docxI can not get my code to comply it gets mad that I have run declare mo.docx
I can not get my code to comply it gets mad that I have run declare mo.docx
 
Various types of File Operations in Java
Various types of  File Operations in JavaVarious types of  File Operations in Java
Various types of File Operations in Java
 
Lab4
Lab4Lab4
Lab4
 
File Input & Output
File Input & OutputFile Input & Output
File Input & Output
 
Input output files in java
Input output files in javaInput output files in java
Input output files in java
 

More from ColinjSWDavidsonn

In Chapter 8 you were introduced to the water-soluble vitamins- includ.pdf
In Chapter 8 you were introduced to the water-soluble vitamins- includ.pdfIn Chapter 8 you were introduced to the water-soluble vitamins- includ.pdf
In Chapter 8 you were introduced to the water-soluble vitamins- includ.pdfColinjSWDavidsonn
 
In February 2020- the Bureau of Labor Statistics calculated the unempl.pdf
In February 2020- the Bureau of Labor Statistics calculated the unempl.pdfIn February 2020- the Bureau of Labor Statistics calculated the unempl.pdf
In February 2020- the Bureau of Labor Statistics calculated the unempl.pdfColinjSWDavidsonn
 
In relation to the results of the HEBP2 gene- what role does the heme.pdf
In relation to the results of the HEBP2 gene- what role does the heme.pdfIn relation to the results of the HEBP2 gene- what role does the heme.pdf
In relation to the results of the HEBP2 gene- what role does the heme.pdfColinjSWDavidsonn
 
In Python- A palindrome is a word or a phrase that is the same when re.pdf
In Python- A palindrome is a word or a phrase that is the same when re.pdfIn Python- A palindrome is a word or a phrase that is the same when re.pdf
In Python- A palindrome is a word or a phrase that is the same when re.pdfColinjSWDavidsonn
 
In July of 2015 Dr- Ronald Ware executed to United Capital Source a no.pdf
In July of 2015 Dr- Ronald Ware executed to United Capital Source a no.pdfIn July of 2015 Dr- Ronald Ware executed to United Capital Source a no.pdf
In July of 2015 Dr- Ronald Ware executed to United Capital Source a no.pdfColinjSWDavidsonn
 
In Java- Get doubles from input file- Output the biggest import java-i.pdf
In Java- Get doubles from input file- Output the biggest import java-i.pdfIn Java- Get doubles from input file- Output the biggest import java-i.pdf
In Java- Get doubles from input file- Output the biggest import java-i.pdfColinjSWDavidsonn
 
IN java A chessboard has alternating black and white squares- The firs.pdf
IN java A chessboard has alternating black and white squares- The firs.pdfIN java A chessboard has alternating black and white squares- The firs.pdf
IN java A chessboard has alternating black and white squares- The firs.pdfColinjSWDavidsonn
 
In a particular hospital- 6 newborn babies were delivered yesterday- H.pdf
In a particular hospital- 6 newborn babies were delivered yesterday- H.pdfIn a particular hospital- 6 newborn babies were delivered yesterday- H.pdf
In a particular hospital- 6 newborn babies were delivered yesterday- H.pdfColinjSWDavidsonn
 
In Chapter 8 you were introduced to the water-soluble vitamins- includ (1).pdf
In Chapter 8 you were introduced to the water-soluble vitamins- includ (1).pdfIn Chapter 8 you were introduced to the water-soluble vitamins- includ (1).pdf
In Chapter 8 you were introduced to the water-soluble vitamins- includ (1).pdfColinjSWDavidsonn
 
In Chapter 12- you learned about the distribution and marketing channe.pdf
In Chapter 12- you learned about the distribution and marketing channe.pdfIn Chapter 12- you learned about the distribution and marketing channe.pdf
In Chapter 12- you learned about the distribution and marketing channe.pdfColinjSWDavidsonn
 
In detail- please discuss the technical structure of the Customs Tarif.pdf
In detail- please discuss the technical structure of the Customs Tarif.pdfIn detail- please discuss the technical structure of the Customs Tarif.pdf
In detail- please discuss the technical structure of the Customs Tarif.pdfColinjSWDavidsonn
 
In an experiment of rolling a die twce Lel x be random variable to be.pdf
In an experiment of rolling a die twce Lel x be random variable to be.pdfIn an experiment of rolling a die twce Lel x be random variable to be.pdf
In an experiment of rolling a die twce Lel x be random variable to be.pdfColinjSWDavidsonn
 
In a school- 16- of the students have seen a school counselor about an.pdf
In a school- 16- of the students have seen a school counselor about an.pdfIn a school- 16- of the students have seen a school counselor about an.pdf
In a school- 16- of the students have seen a school counselor about an.pdfColinjSWDavidsonn
 
In a Poisson distribution- -2-00- (Round your answers to 4 decimal pla.pdf
In a Poisson distribution- -2-00- (Round your answers to 4 decimal pla.pdfIn a Poisson distribution- -2-00- (Round your answers to 4 decimal pla.pdf
In a Poisson distribution- -2-00- (Round your answers to 4 decimal pla.pdfColinjSWDavidsonn
 
It is a simple program that that parses a simple expression grammar- T.pdf
It is a simple program that that parses a simple expression grammar- T.pdfIt is a simple program that that parses a simple expression grammar- T.pdf
It is a simple program that that parses a simple expression grammar- T.pdfColinjSWDavidsonn
 
it ingents ford It tacks cell watlls Question 4 Bictaterally symimetri.pdf
it ingents ford It tacks cell watlls Question 4 Bictaterally symimetri.pdfit ingents ford It tacks cell watlls Question 4 Bictaterally symimetri.pdf
it ingents ford It tacks cell watlls Question 4 Bictaterally symimetri.pdfColinjSWDavidsonn
 
Is this x-lined dominant or recessive inheritance- Write all possible.pdf
Is this x-lined dominant or recessive inheritance- Write all possible.pdfIs this x-lined dominant or recessive inheritance- Write all possible.pdf
Is this x-lined dominant or recessive inheritance- Write all possible.pdfColinjSWDavidsonn
 
Is the study experimental- observational- or niether- 7) A political p.pdf
Is the study experimental- observational- or niether- 7) A political p.pdfIs the study experimental- observational- or niether- 7) A political p.pdf
Is the study experimental- observational- or niether- 7) A political p.pdfColinjSWDavidsonn
 
Is Ethnicity a Foreign Concept-.pdf
Is Ethnicity a Foreign Concept-.pdfIs Ethnicity a Foreign Concept-.pdf
Is Ethnicity a Foreign Concept-.pdfColinjSWDavidsonn
 
is arguably the most important factor currently shaping the world econ.pdf
is arguably the most important factor currently shaping the world econ.pdfis arguably the most important factor currently shaping the world econ.pdf
is arguably the most important factor currently shaping the world econ.pdfColinjSWDavidsonn
 

More from ColinjSWDavidsonn (20)

In Chapter 8 you were introduced to the water-soluble vitamins- includ.pdf
In Chapter 8 you were introduced to the water-soluble vitamins- includ.pdfIn Chapter 8 you were introduced to the water-soluble vitamins- includ.pdf
In Chapter 8 you were introduced to the water-soluble vitamins- includ.pdf
 
In February 2020- the Bureau of Labor Statistics calculated the unempl.pdf
In February 2020- the Bureau of Labor Statistics calculated the unempl.pdfIn February 2020- the Bureau of Labor Statistics calculated the unempl.pdf
In February 2020- the Bureau of Labor Statistics calculated the unempl.pdf
 
In relation to the results of the HEBP2 gene- what role does the heme.pdf
In relation to the results of the HEBP2 gene- what role does the heme.pdfIn relation to the results of the HEBP2 gene- what role does the heme.pdf
In relation to the results of the HEBP2 gene- what role does the heme.pdf
 
In Python- A palindrome is a word or a phrase that is the same when re.pdf
In Python- A palindrome is a word or a phrase that is the same when re.pdfIn Python- A palindrome is a word or a phrase that is the same when re.pdf
In Python- A palindrome is a word or a phrase that is the same when re.pdf
 
In July of 2015 Dr- Ronald Ware executed to United Capital Source a no.pdf
In July of 2015 Dr- Ronald Ware executed to United Capital Source a no.pdfIn July of 2015 Dr- Ronald Ware executed to United Capital Source a no.pdf
In July of 2015 Dr- Ronald Ware executed to United Capital Source a no.pdf
 
In Java- Get doubles from input file- Output the biggest import java-i.pdf
In Java- Get doubles from input file- Output the biggest import java-i.pdfIn Java- Get doubles from input file- Output the biggest import java-i.pdf
In Java- Get doubles from input file- Output the biggest import java-i.pdf
 
IN java A chessboard has alternating black and white squares- The firs.pdf
IN java A chessboard has alternating black and white squares- The firs.pdfIN java A chessboard has alternating black and white squares- The firs.pdf
IN java A chessboard has alternating black and white squares- The firs.pdf
 
In a particular hospital- 6 newborn babies were delivered yesterday- H.pdf
In a particular hospital- 6 newborn babies were delivered yesterday- H.pdfIn a particular hospital- 6 newborn babies were delivered yesterday- H.pdf
In a particular hospital- 6 newborn babies were delivered yesterday- H.pdf
 
In Chapter 8 you were introduced to the water-soluble vitamins- includ (1).pdf
In Chapter 8 you were introduced to the water-soluble vitamins- includ (1).pdfIn Chapter 8 you were introduced to the water-soluble vitamins- includ (1).pdf
In Chapter 8 you were introduced to the water-soluble vitamins- includ (1).pdf
 
In Chapter 12- you learned about the distribution and marketing channe.pdf
In Chapter 12- you learned about the distribution and marketing channe.pdfIn Chapter 12- you learned about the distribution and marketing channe.pdf
In Chapter 12- you learned about the distribution and marketing channe.pdf
 
In detail- please discuss the technical structure of the Customs Tarif.pdf
In detail- please discuss the technical structure of the Customs Tarif.pdfIn detail- please discuss the technical structure of the Customs Tarif.pdf
In detail- please discuss the technical structure of the Customs Tarif.pdf
 
In an experiment of rolling a die twce Lel x be random variable to be.pdf
In an experiment of rolling a die twce Lel x be random variable to be.pdfIn an experiment of rolling a die twce Lel x be random variable to be.pdf
In an experiment of rolling a die twce Lel x be random variable to be.pdf
 
In a school- 16- of the students have seen a school counselor about an.pdf
In a school- 16- of the students have seen a school counselor about an.pdfIn a school- 16- of the students have seen a school counselor about an.pdf
In a school- 16- of the students have seen a school counselor about an.pdf
 
In a Poisson distribution- -2-00- (Round your answers to 4 decimal pla.pdf
In a Poisson distribution- -2-00- (Round your answers to 4 decimal pla.pdfIn a Poisson distribution- -2-00- (Round your answers to 4 decimal pla.pdf
In a Poisson distribution- -2-00- (Round your answers to 4 decimal pla.pdf
 
It is a simple program that that parses a simple expression grammar- T.pdf
It is a simple program that that parses a simple expression grammar- T.pdfIt is a simple program that that parses a simple expression grammar- T.pdf
It is a simple program that that parses a simple expression grammar- T.pdf
 
it ingents ford It tacks cell watlls Question 4 Bictaterally symimetri.pdf
it ingents ford It tacks cell watlls Question 4 Bictaterally symimetri.pdfit ingents ford It tacks cell watlls Question 4 Bictaterally symimetri.pdf
it ingents ford It tacks cell watlls Question 4 Bictaterally symimetri.pdf
 
Is this x-lined dominant or recessive inheritance- Write all possible.pdf
Is this x-lined dominant or recessive inheritance- Write all possible.pdfIs this x-lined dominant or recessive inheritance- Write all possible.pdf
Is this x-lined dominant or recessive inheritance- Write all possible.pdf
 
Is the study experimental- observational- or niether- 7) A political p.pdf
Is the study experimental- observational- or niether- 7) A political p.pdfIs the study experimental- observational- or niether- 7) A political p.pdf
Is the study experimental- observational- or niether- 7) A political p.pdf
 
Is Ethnicity a Foreign Concept-.pdf
Is Ethnicity a Foreign Concept-.pdfIs Ethnicity a Foreign Concept-.pdf
Is Ethnicity a Foreign Concept-.pdf
 
is arguably the most important factor currently shaping the world econ.pdf
is arguably the most important factor currently shaping the world econ.pdfis arguably the most important factor currently shaping the world econ.pdf
is arguably the most important factor currently shaping the world econ.pdf
 

Recently uploaded

Contoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdfContoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdfcupulin
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismDabee Kamal
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17Celine George
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxCeline George
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesAmanpreetKaur157993
 
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
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnershipsexpandedwebsite
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjMohammed Sikander
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...Gary Wood
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...Nguyen Thanh Tu Collection
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code ExamplesPeter Brusilovsky
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesPooky Knightsmith
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MysoreMuleSoftMeetup
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaEADTU
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMELOISARIVERA8
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....Ritu480198
 

Recently uploaded (20)

Contoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdfContoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdf
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
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
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 

In Java- Input is from a file- The input is all doubles- You are to in.pdf

  • 1. In Java; Input is from a file. The input is all doubles. You are to input these doubles 2 at a time (the length and width), create a Rectangle and determine if it has the largest area. Output the Rectangle with the largest area. import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class Lab8Num2 { public static void main(String[] args) { File inFile = new File("lab8.in"); Scanner fileInput = null; try { fileInput = new Scanner(inFile); } catch (FileNotFoundException ex) { } //get first Rectangle and make it the biggest; //do NOT put into an arrayList and sort. while () { //get more data from file //make Rectangle //see if it is bigger than biggest so far //if so, it is the new biggest } System.out.println("The biggest rectangle was " + biggest); } } public class Rectangle { private double length, width; public Rectangle() { length=0; width=0; } public Rectangle(double len, double wid) {
  • 2. length=len; width=wid; } public double getLength() { return length; } public void setLength(double length) { this.length = length; } public double getWidth() { return width; } public void setWidth(double width) { this.width = width; } public double area() { return length*width; } public double perimeter() { return 2*(length+width); } public String toString() { return "Length: " + length + " Width: " + width; } public int compareTo(Rectangle r) { } }