Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

6. Vanguard

Answered: 1 week ago

Question

1. PricewaterhouseCoopers

Answered: 1 week ago