Question: Part II. (80 pts) Write a program to solve the following problem. Name the Java program A3YourName ava (use your own name) and upload this
Part II. (80 pts) Write a program to solve the following problem. Name the Java program A3YourName ava (use your own name) and upload this file to Blackboard Assignment " in Comments and documentation requirements on successive program are the same as Assignnm will not be repeated. Th is program performs for friction coefficient where a computations on a sample of skis from a production line. Each ski is measured high value indicates poor surface conditioning. A ski is rejected if the lue exceeds 1.23. Skis with a model number beginning with "RC" have a component cost of $21.99 s a model number beginning with "ED" have a component cost of $24.99. Since this program is reading both numbers and strings, all data should be read as string and converted to integer or double as needed Ex. int count- 0; ll number of data points String strcount; strcount-scan.nextLine); count- Integer.parselnt(strcount); convert string to integer I/ read next line as a string Input: 1. 2. 3. 4. Read the number of data points using an error checking loop on invalid numbers Use a loop to process the desired number of skis. Use an error checking loop on invalid ski IDs. Use an error checking loop on invalid friction coefficient values. Output: For each ski, report the component cost, noting any rejected skis as shown below. After all data points are read, report the statistics shown below. Output should use the NumberFormat classes to display the , currency and percentage output and the DecimalFormat class to control precision. Do not use the printf method. Programer: Your Name Enter number of data points:1 Enter number of data points: 4 Enter ski ID: xxee Enter ski ID: RC100 Enter friction coefficient for ski RC1e0: -1 Enter friction coefficient for ski RC100: 1.e5 Component cost for ski RC18e: $21.99 Enter ski ID: E0200 Enter friction coefficient for ski ED200: 1.15 Component cost for ski ED200: $24.99 Enter ski IO: RC101 Enter friction coefficient for ski RC181: 1.35 Component cost for skl RC101: S21.99 .. REECT Enter ski ID: ED201 Enter friction coefficient for ski ED281: 1.45 komponent cost for ski ED201: $24.99 -REJECT Number of Data Points: 4 Average Friction Coefficient: 1.25 Number of rejected skis: 2 Percentage of rejected skis: 58% Cost of rejected skis: $46.98
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
