Answered step by step
Verified Expert Solution
Question
1 Approved Answer
LG Lucida Sans10 A A Aa A v ar BI U 6 X, X ADA E 21 OB- AaBbc.de Code Malheldkk AaBbCcD Emphasis Heading 1
LG Lucida Sans10 A A Aa A v ar BI U 6 X, X ADA E 21 OB- AaBbc.de Code Malheldkk AaBbCcD Emphasis Heading 1 Aalb eDdl Normal 1. AaBbceDd AubbeDdl Aabbcode Question Strong Paste Style 19. Given the following variable, which holds a reference to a Printer object, and the following method headers from the Printer class, write one possible method call for each of the methods (2 marks). // variable holding the reference to a Printer object Printer pl; // method headers from printer class (rest of methods are omitted) public void print (String filename, boolean double Sided) public int getStatus(int delay) 20. Write a declaration for a new ArrayList of Person objects, called students. Initialise the new ArrayList. Note: you may leave it empty. (2 marks) 21. What sort of loop is most commonly used to iterate through collections? (1 mark) If the Person class in Q20 has a method called "printName" that takes no parameters, and returns a String, write a loop that will print out all the students' names, one per line. (2 marks). 22. What are the three main control structures in programming? (1 mark) 23. Name two ways of producing output for the user. Use examples to illustrate your answer. (2 marks)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started