Home / Quizzes / University of Mpumalanga / Apd201 / Apd201 - Application Development 2A (Java) - QUIZ Apd201 - Application Development 2A (Java) - QUIZ Apd201 · Application Development 2A (Java)
University of Mpumalanga
Questions 10 Questions Practice 10 questions on Apd201 - Application Development 2A (Java) at University of Mpumalanga. Free AI-generated quiz on uNotes — track your score, retake anytime.
Questions 1 According to the Fraction class specification, which pre-processor directives should be used to prevent multiple declarations of the class?
2 What are the initial values assigned to the numerator and denominator by the default constructor?
3 Which members of the Fraction class are defined as private?
4 What is the return type of the calculateFloat() method?
5 If a Fraction object has a numerator of 5 and a denominator of 10, what value will calculateFloat() return?
6 In the front-end program (Main), how many Fraction objects must be declared?
7 Which methods in the Fraction class are responsible for retrieving the values of the private data members?
8 What is the primary purpose of the setValues(int, int) method in this class?
9 Based on the provided output screen, if Fraction 1 is 5/10 and Fraction 2 is 1/4, what is the displayed result of their sum?
10 Why are the numerator and denominator members marked as 'Private'?