Ch10 Examples - Programming Logic and Design 8e Solutions...

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

We have textbook solutions for you!
The document you are viewing contains questions related to this textbook.
Java Programming
The document you are viewing contains questions related to this textbook.
Chapter 1 / Exercise 5
Java Programming
Farrell
Expert Verified
Programming Logic and Design, 8eSolutions 10-1Programming Exercises1.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
We have textbook solutions for you!
The document you are viewing contains questions related to this textbook.
Java Programming
The document you are viewing contains questions related to this textbook.
Chapter 1 / Exercise 5
Java Programming
Farrell
Expert Verified
Programming Logic and Design, 8eSolutions 10-2-subject: string-letterGrade: string+setAuthorName(name : string) : void+setSubject(sub : string) : void+setLetterGrade(grade : string) : void+displayValues() : voidPseudocode:class TermPaperDeclarationsprivate string authorNameprivate string subjectprivate string letterGradepublic void setAuthorName(string name)authorName = namereturnpublic void setSubject(string sub)subject = subreturnpublic void setLetterGrade(string grade)letterGrade = gradereturnpublic void displayValues()output “Author name: ”, authorNameoutput “Subject: ”, subjectoutput “Letter grade: ”, letterGradereturnendClass4.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, 8eSolutions 10-3+displayValues() : voidPseudocode:class AutomobileDeclarationsprivate string idNumprivate string makeprivate string modelprivate string colorpublic void setidNum(string id)idNum = idreturnpublic setMake(string mk)make = mkreturnpublic setModel(string mod)model = modreturnpublic setColor(string clr)color = clrreturnpublic void displayValues()output “ID Number: ”, idNumoutput “Make: ”, makeoutput “Model: ”, modeloutput “Color: ”, colorreturnendClass

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture