Hi
I know its a bit odd but i am freshly new to java and in a real need to solve few progs by EOD . Really stressed ..please help me out in solving below progs ...
**************************
Task 1
Write a visitor for a structure of Strings (i.e. one for LRStruct and one for BRStruct) which returns, as an Integer, the number of elements in the structure which begin with an upper-case (capital) "A". In the empty case the correct answer is 0.
You must name your LRStruct visitor Task1LinearVisitor
You must name your BRStruct visitor Task1BinaryVisitor
********************************
Task 2
Write a visitor for a structure of Strings (i.e. one for LRStruct and one for BRStruct) which returns, as an Integer, the number of elements in the structure which begin with an upper-case vowel (i.e. "A", "E", "I", "O" or "U"). In the empty case the correct answer is 0.
You must name your LRStruct visitor Task2LinearVisitor
You must name your BRStruct visitor Task2BinaryVisitor
********************************
Task 3
Write a visitor for a structure of any type (i.e. one for LRStruct and one for BRStruct) which returns the "last" element contained in the strucuture (the last element of an LRStruct, and the rightmost elements of a BRStruct). In the empty case the correct answer is to have the structure throw an exception.
You must name your LRStruct visitor Task3LinearVisitor
You must name your BRStruct visitor Task3BinaryVisitor
********************************
Task 4
Write a visitor for a structure of Integers (i.e. one for LRStruct and one for BRStruct) which returns, as an Integer, the sum of all the even integers in the structure. In the empty case the correct answer is to return 0.
You must name your LRStruct visitor Task4LinearVisitor
You must name your BRStruct visitor Task4BinaryVisitor
********************************
Task 5
Write a visitor for a structure of Integers (i.e. one for LRStruct and one for BRStruct) which returns a copy of the structure: i.e. an LRStruct (or BRStruct) which has the same overall structure and which stores the same references. In the empty case the correct answer is to return a new empty structure (LRStruct or BRStruct, as appropriate).
You must name your LRStruct visitor Task5LinearVisitor
You must name your BRStruct visitor Task5BinaryVisitor
**************************