Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java Programming: I'm trying to write a program where Im taking in a file and counting and outputing the number of correct solutions and the
Java Programming:
I'm trying to write a program where Im taking in a file and counting and outputing the number of correct solutions and the total minutes it took for the right problem. If the problem was right and there was an attempt, add 20 minutes for each attempt made plus the minutes it took for the right answer. Here is an example using the Scanner input = new Scanner(System.in); Also please explain the process in comments if possible.
7 H right 15 B wrong 30 E wrong 35 E right 80 B wrong 80 B right 100 D wrong 100 C wrong 300 C right 300 D wrong This team solved 4 problems, and their total time score (including penalties) is 502, with 7 minutes for H, 35 + 20 for e, 80 + 40 for B, and 300 + 20 for dc Input The input contains n lines forOn 100, with each line describing a particular log entry. A log entry has three parts: an integer m, with 1 S m 3 300, designating the number of minutes at which a submission was received, an uppercase letter designating the problem, and either the word right or wrong. The integers will be in nondecreasing order and may contain repeats. After all the log entries is a line containing just the number -1 Output Output two integers on a single line: the number of problems solved and the total time measure (including penalties) Sample Input 1 Sample Output 1 3 E right 10 A wrong 30 C wrong 50 B wrong 100 A wrong 200 A right 50 C wrong 300 D right 543
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