Question: Implement the method shown below which receives a non-empty string str; extracts the compauting courses in it; and returns the sum of their credit counts.

Implement the method shown below which receives a non-empty string str; extracts the compauting courses in it; and returns the sum of their credit counts. If the received string has no computing course in it then the method returns e: , public static int totalCredit(String str) A computing course is recognized by the prefix EECS or CSE (in upper or lower case) followed by four digits, followed by one or more period, followed by the credit count, which can optionally be bracketed. The credit count of a course is a single digit. Here are four examples of valid computing courses: EECS1022.3, cse4413. .[4], eecs4141... . [6], CSE3481..3 For example, if str is the string "Course EECS1022. .3 and cse1020.[4] with CSE3421 or CSE6215...8 then the return should be 15

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!