Question: Complete the following tasks: a. Design a class named ItemForSale that holds data about items placed for sale on Carloss List, a classified advertising website.

Complete the following tasks:

a. Design a class named ItemForSale that holds data about items placed for sale on Carlos’s List, a classified advertising website. Fields include an ad number, item description, asking price, and phone number. Include get and set methods for each field. Include a static method that displays the website’s motto (“Sell Stuff Locally!”). Include two overloaded constructors as follows:

  • A default constructor that sets the ad number to 101, the asking price to $1, and the item description and phone number both to XXX
  •  A constructor that allows you to pass values for all four fields

Create the class diagram and write the pseudocode that defines the class.

b. Design an application that declares two ItemForSale objects using a different constructor version with each object. Display each Issue’s values and then display the motto.

Step by Step Solution

3.32 Rating (152 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a Diagram ItemForSale adNumber num itemDesc string askingPrice num phoneNum string setAdNumbernumber ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Logic & Design Questions!