subject
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.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:00
Aisha has finished working on a word processing document that contains 15 pages. she has added some special elements in the first three pages, page 9 and 10, and page 15 from the document. she wants to print only these pages to see how they look. which option is the correct way to represent (in the print dialog box) the pages that aisha wants to print?
Answers: 3
question
Computers and Technology, 22.06.2019 15:20
The north and south regions had very diferent economies in the 1800s.
Answers: 1
question
Computers and Technology, 23.06.2019 21:40
Simon says is a memory game where "simon" outputs a sequence of 10 characters (r, g, b, y) and the user must repeat the sequence. create a for loop that compares the two strings. for each match, add one point to user_score. upon a mismatch, end the game. sample output with inputs: 'rrgbryybgy' 'rrgbbrybgy'
Answers: 3
question
Computers and Technology, 24.06.2019 01:00
How can the temperature of a room be raised by 5degreesf?
Answers: 1
You know the right answer?
We are in the midst of designing the Cat class. We have already created a class diagram and written...
Questions
question
Mathematics, 24.08.2019 02:30
Questions on the website: 13722362