This is an assignment I need help on (I\'m a Graduate Student) Make a graph for
ID: 3781133 • Letter: T
Question
This is an assignment I need help on (I'm a Graduate Student)
Make a graph for 2 fields Students_withStraightA and Students_DeanList% or make a graph comparing any 4 different (random) data points given in the excel file
Question) Using any of the programming language you know (Java, C++,C or Python)
Write a code/program that imports the given Excel (XLSX) file [link of excel file] -> (https://www.dropbox.com/s/agrizm8ycruf302/Excel.xlsx?dl=0)
and outputs a GRAPH for the Excel file saved in XLSX file format.
Import that file in using matplot.lib or whatever package you think would be better suited for this puprose. Write the code that outputs a graph and paste the code here.
If possible attach screenshots also. (Please only use the excel file given) Thank You
Excel File Link - https://www.dropbox.com/s/agrizm8ycruf302/Excel.xlsx?dl=0
Explanation / Answer
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Iterator;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
public class Excel {
public static void main(String[] args) throws IOException {
String excelFilePath = "https://www.dropbox.com/s/agrizm8ycruf302/Excel.xlsx?dl=0";
FileInputStream inputStream = new FileInputStream(new File(excelFilePath));
Workbook workbook = new XSSFWorkbook(inputStream);
Sheet firstSheet = workbook.getSheetAt(0);
Iterator<Row> iterator = firstSheet.iterator();
while (iterator.hasNext()) {
Row nextRow = iterator.next();
Iterator<Cell> cellIterator = nextRow.cellIterator();
while (cellIterator.hasNext()) {
Cell cell = cellIterator.next();
switch (cell.getCellType()) {
case Cell.CELL_TYPE_STRING:
System.out.print(cell.getStringCellValue());
break;
case Cell.CELL_TYPE_BOOLEAN:
System.out.print(cell.getBooleanCellValue());
break;
case Cell.CELL_TYPE_NUMERIC:
System.out.print(cell.getNumericCellValue());
break;
}
System.out.print(" - ");
}
System.out.println();
}
workbook.close();
inputStream.close();
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.