Question: please help with these java questions thanks CSSE2002/7023 Tute Week 5 1 XFiles The following class maintains a collection of strings all begining with X.

please help with these java questions thanks CSSE2002/7023 Tute Week 5 1please help with these java questions thanks

CSSE2002/7023 Tute Week 5 1 XFiles The following class maintains a collection of strings all begining with X. class XFiles I public LinkedList files; public void add (String s) f if (s.charAt (0)--'X') I files .add (s); public void remove (String s) { files .remove (s); public List getWords ) return files; . Fix the above code, so it won't throw any exceptions [without using try/catch] Find two ways to break the invariant for this class 2 Black box testing The following class tracks how many passengers are on a bus public class Bus {[ public Bus (int capacity); int getCurrent (); int getAverageCount (); //average passengers between stops void stop (int on, int off); // Passenger changeover at a bus stop how many on the bus right nou //passengers get off before any new get on 1. What would you test? ie what situations and inputs would you test. You don't need to specify expected output

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!