subject

Given the pseudocode below: Class Animal Private String _name Public Module setName(String name) Set _name = name End Module Public Module vocalize() Display _name + " makes a noise." End Module End Class Class Dog Extends Animal Public Module vocalize() Display _name + " woofs." End Module End Class Class Cat Extends Animal Public Module vocalize() Display _name + " meows." End Module End Class Class Bird Extends Animal Public Module vocalize() Display _name + " chirps." End Module End Class Module main() Declare Animal pets[3] Declare Integer counter = 0 Set pets[0] = New Dog() Set pets[1] = New Cat() Set pets[2] = New Bird() Call pets[0].setName("Dorothy") Call pets[1].setName("Ginger") Call pets[2].setName("Ralph") While counter < 3 Call pets[counter].vocalize() counter = counter + 1 End While End Module What will be the output from calling the main module? Important! This time, write each output in its own box, instead of separating each output with a single space. You should have three separate outputs. 2. For the pseudocode below: Class Musician Private String _name Private Integer _rating Private String _song Public Module Musician(String name, Integer rating, String song) Set _name = name Set _rating = rating Set _song = song End Module Public Module display() Display name, rating, song End Module Public Function Boolean matches(String name) Return name == _name End Function End Class Module main(String name) Declare Musician musicians[4] Declare Integer counter = 0 Set musicians[0] = New Musician("John", 10, "Imagine") Set musicians[1] = New Musician("Paul", 9, "Listen to What the Man Said") Set musicians[2] = New Musician("George", 8, "Here Comes the Sun") Set musicians[3] = New Musician("Ringo", 7, "With a Little Help From My Friends") While counter < 4 If musicians[counter].matches(name) Then Call musicians[counter].display() End If counter = counter + 1 End While End Module What will be the output when main("George") is called? Separate each output with a single space. 3. Given the pseudocode below: Class Material Private String _type Public Module Material(String type) _type = type End Module Public Module display() Display _type End Module End Class Class Furniture Private Material _material Private String _type Public Module set_material(Material material) Set _material = material End Module Public Module display() Display _type Call _material. display() End Module End Class Class Chair Extends Furniture Public Module Chair() Set _type = "Chair" End Module End Class Module main() Declare Furniture furniture = New Chair() Call furniture. set_material(New Material("Wood")) Call furniture. display() End Module What will be the output when the main module is called? Separate each output with a single space. 4. When all tests in a test plan pass, you have proved that the software is bug-free. True or False

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 11:30
Auser is given read permission to a file stored on an ntfs-formatted volume. the file is then copied to a folder on the same ntfs-formatted volume where the user has been given full control permission for that folder. when the user logs on to the computer holding the file and accesses its new location via a drive letter, what is the user's effective permission to the file? a. read b. full control c. no access d. modify e. none of the above
Answers: 1
question
Computers and Technology, 24.06.2019 12:50
Write a new lc-3 trap subroutine (i.e. a subroutine that will be invoked via the trap instruction) that will receive a numeric digit entered at the keyboard (i.e. an ascii character), echo it to the screen, and return in r0 the corresponding numeric value: so if the user types the digit '7', the character '7' will appear on the screen, but the value returned in r0 will be b0000 0000 0000 0111 (#7) you may not use any trap calls in your code - you must implement the "polling" code that interrogates the keyboard status and data registers. ; getnum_tsr ; a subroutine for obtaining a numeric value ; given ascii numeric digit input to keyboard. ; the numeric digit is echoed to the console (e.g. '7' = b0000 0000 0011 0111), ; but the value returned in r0 is the actual numeric value ; corresponding to the digit (e.g. b0000 0000 0000 0111 =
Answers: 3
question
Computers and Technology, 24.06.2019 13:10
Write a program that has a conversation with the user. the program must ask for both strings and numbers as input. the program must ask for at least 4 different inputs from the user. the program must reuse at least 3 inputs in what it displays on the screen. the program must perform some form of arithmetic operation on the numbers the user inputs. turn in your .py file as well as a screenshot of your program's output. include comments in your code to explain how it works an example program run might look like (have fun with this and be creative): β€˜what is your name? ’ β€œjosh” β€˜, josh. what is your favorite color? ’ β€œgreen” β€˜mine too. do you also like ice cream? ’ β€œno” β€˜josh, how old are you? ’ β€œ40” β€˜ and how many siblings do you have? ’’ β€œ3” β€˜that means you are one of 4 kid(s). is green the favorite color of anyone else in your house? ’
Answers: 3
question
Computers and Technology, 24.06.2019 21:00
When replacing a thermostat or water pump, coolant drained from the cooling system should be
Answers: 1
You know the right answer?
Given the pseudocode below: Class Animal Private String _name Public Module setName(String name) Set...
Questions
question
Mathematics, 23.12.2020 17:00
question
Mathematics, 23.12.2020 17:00
Questions on the website: 13722363