Computers and Technology
Computers and Technology, 02.08.2021 20:10, memeE15

We are in the midst of designing the Cat class. We have already created a class diagram and written most of the pseudocode for the Cat class, which contains attributes for the name of the cat and the gender of the cat, as shown below. +Cat -name: String -gender: Character +Cat() +getName(): String +setName(new Name: String) +getGender(): Character +setGender(newGender: Character) +inputCatData(Ref catFile: InputFile)
Class Cat
Private String name
Private Character gender
Public Module Cat()
Set name = " "
Set gender = ' '
End Module
Public Module setName(String newName)
Set name = newName
End Module
Public Function String getName()
Return name
End Function
Public Module setGender (Character newGender)
If newGender == 'F' OR newGender == 'M' Then
Set gender = newGender
Else
Display "Error: only M or F is allowed for gender, not: ", newGender
Set gender = ' '
End If
End Module
Public Function Character getGender()
Return gender
End Function
Public Module inputCatData(InputFile Ref catFile)
Write this statement
End Module
End Class
Type the exact text for the line of the pseudocode to replace Write this statement, which is the statement that inputs the data for a Cat object from the catFile. The file contains, on each line, the name of the cat, then the gender of the cat.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 14:20, babyrocks7300
Consider a byte-addressable computer with 16mb of main memory, a cache capable of storing a total of 64kb of data and block size of 32 bytes. (a) how many bits in the memory address? (b) how many blocks are in the cache? (c) specify the format of the memory address, including names and sizes, when the cache is: 1. direct-mapped 2. 4-way set associative 3. fully associative
Answers: 2
image
Computers and Technology, 22.06.2019 15:20, brookemcelhaney
The north and south regions had very diferent economies in the 1800s.
Answers: 1
image
Computers and Technology, 23.06.2019 12:30, legend101xD
Animations and transitions are added from the
Answers: 1
image
Computers and Technology, 23.06.2019 13:00, torresnoemi899
Which of the following statements is false? a. a class can directly inherit from class object. b. if the class you're inheriting from declares instance variables as private, the inherited class can access those instance variables directly. c. a class's instance variables are normally declared private to enforce good software engineering. d. it's often much more efficient to create a class by inheriting from a similar class than to create the class by writing every line of code the new class requires.
Answers: 3
Do you know the correct answer?
We are in the midst of designing the Cat class. We have already created a class diagram and written...

Questions in other subjects: