Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The file material_mr.csv located in the /examples/ folder contains information the name and the machinability rating for multiple materials. Remember that material rating is given
The file material_mr.csv located in the /examples/ folder contains information the name and the machinability rating for multiple materials. Remember that material rating is given as a percentage. A material_mr.csv file with two materials would look similar to the following: Titanium, .21 Stainless Steel, .45 Class files H2_Q1.java and MRData.java are provided for you as a starting point and are located in the /src/student Work folder. Modify the code in both files to accomplish the following: a. Read in (using OpenCSV) both the name and machinability rating for each material. b. Calculate the cutting speed for each material using the information provided and the fact that the cutting velocity for B1112 Steel is 165 surface feet per minute. c. Output the cutting speed for each material to the console with material name. MRData.java x package studentwork; import com.opencsv.bean. CsvBindByName; 5 000 wou A WNA public class MRData { 6 H2_Q1.java x 1 package studentwork; import ... 600 v w NP public class H2_Q1 { public static void main(String[] args) throws FileNotFoundException { 22 //the IDE warnings (yellow) can be ignored since we know the type List dataList = new CsvToBeanBuilder(new FileReader("examples/material_mr.csv")); .withType (MRData.class).build() .parse(); 14 15 16 for(MRData mrd: dataList){ 17 18 19 20 21 22 The file material_mr.csv located in the /examples/ folder contains information the name and the machinability rating for multiple materials. Remember that material rating is given as a percentage. A material_mr.csv file with two materials would look similar to the following: Titanium, .21 Stainless Steel, .45 Class files H2_Q1.java and MRData.java are provided for you as a starting point and are located in the /src/student Work folder. Modify the code in both files to accomplish the following: a. Read in (using OpenCSV) both the name and machinability rating for each material. b. Calculate the cutting speed for each material using the information provided and the fact that the cutting velocity for B1112 Steel is 165 surface feet per minute. c. Output the cutting speed for each material to the console with material name. MRData.java x package studentwork; import com.opencsv.bean. CsvBindByName; 5 000 wou A WNA public class MRData { 6 H2_Q1.java x 1 package studentwork; import ... 600 v w NP public class H2_Q1 { public static void main(String[] args) throws FileNotFoundException { 22 //the IDE warnings (yellow) can be ignored since we know the type List dataList = new CsvToBeanBuilder(new FileReader("examples/material_mr.csv")); .withType (MRData.class).build() .parse(); 14 15 16 for(MRData mrd: dataList){ 17 18 19 20 21 22
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started