Logic7e_Solutions_ch10 - Programming Logic and Design, 7e...

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

Programming Logic and Design, 7eSolutions 10-1Programming Logic and Design, 7th EditionChapter 10Exercises1.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
3.Design a class namedTermPaperthat holds an author’s name, the subject of thepaper, and an assigned letter grade. Include methods to set the values for each datafield and display the values for each data field. Create the class diagram and write thepseudocode that defines the class.
We have textbook solutions for you!
/Java-Programming-9th-Edition-9781337397070-773/
The document you are viewing contains questions related to this textbook.
Chapter 1 / Exercise 5
Java Programming
Farrell
Expert Verified
Programming Logic and Design, 7eSolutions 10-2TermPaper-authorName: string-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 namedAutomobilethat holds the vehicle identification number,make, model, and color of an automobile. Include methods to set the values for eachdata field, and include a method that displays all the values for each field. Create theclass diagram and write the pseudocode that defines the class.
Programming Logic and Design, 7eSolutions 10-3-color: string+setIdNum(id : string) : void+setMake (mk : string) : void+setModel(mod : string) : void+setColor(clr : string) : void+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

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 15 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
N/A
Tags
Subroutine, Return statement, Void type, National identification number
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

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture