Complete the following tasks a the rockford daily

This preview shows page 19 - 24 out of 36 pages.

3.Complete the following tasks:a.The RockfordDaily Clarionwants you to design a class named Issue. Fields includethe issue number, total number of advertisements sold in the issue, and total19
COM 204 Assignment 7advertising revenue. Include get and set methods for each field. Include a staticmethod that displays the newspaper’s motto (“Everything you need to know”).20
Create the class diagram and write the pseudocode that defines the class.Diagram:Issue-issueNumber: num-numOfAds: num-adRevenue: num+setIssueNumber(number : num) : void+setNumOfAds(ads : num) : void+setAdRevenue(revenue : num) : void+getIssueNumber() : num+getNumOfAds() : num+getAdRevenue() : num+displayMotto() : voidPseudocode:class IssueDeclarationsprivate num issueNumberprivate num numOfAds
COM 204 Assignment 7private num adRevenuepublic Issue()issueNumber = 1numOfAds = 0adRevenue = 0returnpublic Issue(num number, num ads, num revenue)issueNumber = numbernumOfAds = adsadRevenue = revenuereturnpublic Issue(num number, num ads)issueNumber = numbernumOfAds = adsadRevenue = numOfAds * 50returnpublic void setIssueNumber(num number)issueNumber = numberreturnpublic void setNumOfAds(num ads)numOfAds = adsreturnpublic void setAdRevenue(num revenue)adRevenue = revenuereturn21
COM 204 Assignment 7public num getIssueNumber()return issueNumberpublic num getNumOfAds()return numOfAdspublic num getAdRevenue()return adRevenuepublic static void displayMotto()print “Everything you need to know”returnendClassb.Design an application that declares threeIssueobjects using a different constructorversion with each object. Display eachIssue’svalues and then display the motto.Pseudocode:startDeclarationsIssue issueOneIssue issueTwo(12, 123, 175)Issue issueThree(34, 321)output “Issue 1 values:”output issueOne.getIssueNumber()output issueOne.getNumOfAds()output issueOne.getAdRevenue()22
COM 204 Assignment 7output “Issue 2 values:”output issueTwo.getIssueNumber()output issueTwo.getNumOfAds()output issueTwo.getAdRevenue()output “Issue 3 values:”output issueThree.getIssueNumber()output issueThree.getNumOfAds()output issueThree.getAdRevenue()Issue.displayMotto()stop

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 36 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
N/A
Tags
Object Oriented Programming, String Theory, NUM, Void type, Input output

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture