What is the output of the following program?public class Tes…

What is the output of the following program?public class Test {  public static void main(String[] args) {    String s = “edcba”;    System.out.println(foo(s));  }  public static String foo(String s) {    if (s==null || s.length()==1) return s;    else {      return s.charAt(s.length()-1) + foo(s.substring(0,s.length()-1));    }  }} [BLANK-1]

This assessment is a Paper 2 Style Assessment so you are ALL…

This assessment is a Paper 2 Style Assessment so you are ALLOWED to use a calculator. TOTAL AMOUNT OF TIME: 80 minutes Time allowed for printing and reading: 10 minutes Duration of assessment: 65 minutes Time allowed for scanning and uploading: 5 minutes INSTRUCTIONS TO ALL STUDENTS Section A: answer all questions. Answers must be written on the exam paper within the answer boxes provided. Alternatively, answer each question on a separate sheet of lined or blank paper. Remember to include a cover page with your name and the boxes set up for your scores. Section B: answer all questions on a separate paper. Label each question clearly. Start each question on a new page. Unless otherwise stated in the question, all numerical answers must be given exactly or correct to three significant figures. A clean copy of the mathematics: analysis and approaches formula booklet is required for this paper. The maximum mark for this assessment is [65 marks].