Logic7e_Solutions_ch10 - Programming Logic and Design 7e Solutions 10-1 Programming Logic and Design 7th Edition Chapter 10 Exercises 1 Identify three

Logic7e_Solutions_ch10 - Programming Logic and Design 7e...

This preview shows page 1 - 4 out of 15 pages.

Programming Logic and Design, 7e Solutions 10-1 Programming Logic and Design, 7th Edition Chapter 10 Exercises 1.Identify three objects that might belong to each of the following classes:a.Buildingb.Artistc.BankLoan 2.Identify three different classes that might contain each of these objects:a.William Shakespeareb.My favorite red sweaterc.Public School 23 in New York City
Programming Logic and Design, 7e Solutions 10-2 TermPaper -authorName: string -subject: string -letterGrade: string +setAuthorName(name : string) : void +setSubject(sub : string) : void +setLetterGrade(grade : string) : void +displayValues() : void Pseudocode: class TermPaper Declarations private string authorName private string subject private string letterGrade public void setAuthorName(string name) authorName = name return public void setSubject(string sub) subject = sub return public void setLetterGrade(string grade) letterGrade = grade return public void displayValues() output “Author name: ”, authorName output “Subject: ”, subject output “Letter grade: ”, letterGrade return endClass 4.Design a class named Automobilethat holds the vehicle identification number, make, model, and color of an automobile. Include methods to set the values for each data field, and include a method that displays all the values for each field. Create the class diagram and write the pseudocode that defines the class.
Programming Logic and Design, 7e Solutions 10-3 -color: string +setIdNum(id : string) : void +setMake (mk : string) : void +setModel(mod : string) : void +setColor(clr : string) : void +displayValues() : void Pseudocode: class Automobile Declarations private string idNum private string make private string model private string color public void setidNum(string id) idNum = id return public setMake(string mk) make = mk return public setModel(string mod) model = mod return public setColor(string clr) color = clr return public void displayValues() output “ID Number: ”, idNum output “Make: ”, make output “Model: ”, model output “Color: ”, color return endClass

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture