Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class MethodsAndArray {
- public static void main(String[] args) {
- Scanner in = new Scanner (System.in);
- int s=0;
- String v = " ";
- String ans = "TFFTFFTTTTFFTFTFTFTT" ;
- char arr[] = ans.toCharArray();
- System.out.print(arr);
- System.out.println();
- String a = "TFFTFFTTTTFFTFTFT TT";
- String c[] = {"ABC54301","ABC59310","ABC39583","ABC38493","ABC10394",
- "ABC10005","ABC10007","ABC38558","ABC10011","ABC10512",
- "ABC10013","ABC10014","ABC10415","ABC10016","ABC10017"};
- char b[] = a.toCharArray();
- for (int i=0 ; i<arr.length ; i++)
- {
- if (b[i] == ' ')
- s+= 0;
- else
- if (b[i] == arr[i])
- s+=2;
- else
- s++;
- }
- double ave = s*100/40;
- System.out.println("Student answer: " + a + " Score:" + s + " ave:" + ave +"% " + v );
- if (ave >= 0 && ave <=59.99)
- v = "F";
- else if (ave >= 60 && ave <=69.99)
- v = "D";
- else if (ave >= 70 && ave <=89.99)
- v = "C";
- else if (ave >= 80 && ave <=89.99)
- v = "B";
- else
- v = "A";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement