Simple object-oriented program, C/C++ Programming

Assignment Help:

This assignment is to be undertaken individually - no group work is permitted. Background information This assignment is an exercise in simple object-oriented programming and, accordingly, you should adhere to basic object-oriented programming guidelines when designing and writing your classes, such as:

a) Setting the visibility of all instance variables to private.

b) Setting the visibility of all methods in your classes to public

c) Encapsulating both the data for a class and the methods that work with and/or manipulate that data, within the same class.

The scenario we are modelling is simulation of a computerised Auction tracking system operated by an auction house that helps customers sell their items in live auctions. Customers can both buy and sell items in the system and sellers can choose to have either an "open" auction, where the highest bid that that equals or exceeds the starting price will win the auction when it comes to an end), or a "reserve" auction, where there is a hidden reserve price that must be reached before the item if effectively "on the market" (ie. once a bid had been placed which exceeds the hidden reserve price the highest bid from that point on will win the auction when it comes to an end). Auctions will also be "opened" and "closed" manually in the system by administrators of the system when the actual auction is commenced and ended respectively. In this assignment we are focusing on the tracking of item auction information in the system - the auction company also maintains details about customers who participate in their auctions (both buyers and sellers), these requirements will be discussed in assignment 5. The auction company offers two types of auction to it's customers as follows:

  • Open auctions in which the item is effectively "on the market" when the auction begins, which means the highest valid bid (which exceeds the starting price) will win the item when the auction is ends.
  • Reserve auctions in which there is a "hidden" reserve price which needs to be met before the item is "on the market" - bids will still be accepted below the reserve price (as long as they equal or exceed the starting price), but the item will only be sold if the highest bid has equalled or exceeded the reserve price that has been set when the auction comes to an end..
  • The details required for the handling of reserve auction information will be discussed later on in assignment 4.

You are required to design and implement an object-oriented program that models some basic functionality required in such an auction system. RMIT School of CS&IT Written by Craig Hamilton 2

Part A: AuctionItem class implementation (25 marks) An auction item requires the following details to be maintained in the system: item ID, item description, seller ID, starting price and the auction status (open or closed). Once the auction has been opened the system will also need to maintain the details of the highest bidder and the amount they have bid on the item. You should start by designing and implementing a basic AuctionItem class, as follows:

1. Define instance variables for the item ID (an int), item description (a String), seller ID (a String), starting price (a double), auction status (a String which can be "Pending", "Open" or "Closed") the current highest bid (a double) and the ID of the current highest bidder (a String).

2. Define a constructor for the AuctionItem class which accepts the item ID, item description, seller ID and starting price as parameters and stores the information in the corresponding instance variables.

This constructor should also set the auction status to "Pending" and the highest bid to zero (0). NOTE: You should not have parameters for auction status, highest bid (which are both initialised as discussed in the point above) or the bidder ID (which will be updated when a valid bid is placed on the item).

3. Define appropriate accessors for the each of the instance variables in this class.

4. Define a method public boolean hasBids(), which returns true if a valid bid has been placed on the item and false if no bid has been made (hint: a valid bid has been made if the current highest bid is equal to or greater than the starting price).

5. Define a method public double open(), which functions as described below:

If the current auction status is "Closed" "Pending" then it changes the status to "Open", calculates the listing fee for the item based on the starting price and returns the result. The price structure for listing fees is as follows: Starting Price                 Listing Fee

$0.01 - $5.00                       $0.25

$5.01 - $20.00                     $0.50

$20.01 - $ 100.00                 $1.00

$100.01 - $250.00                 $2.50

> $250.00                             $5.00


Related Discussions:- Simple object-oriented program

C program for merge two strings , v\:* {behavior:url(#default#VML);} o\:* ...

v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} Normal 0

Pascal programming , 1. The management of a company would like to determine...

1. The management of a company would like to determine the median annual salary of its employees.Write a pascal program that display the number of employees and their median salary

What is some instance of operator overloading?, A: Here are a few of the ma...

A: Here are a few of the many instance of operator overloading: myString + yourString may concatenate two std::string objects myDate++ may increment a Date object a * b may m

C++, write a c++ program for minimum shelf downloads

write a c++ program for minimum shelf downloads

C program to demonstrate call by reference, C program to demonstrate call b...

C program to demonstrate call by reference: void disp(int *,int*,int*,int*); void main() {                 int a=2,b=3, sum,mul;                 printf("Enter 1st n

Does improper inheritance have potential to wreck a project, Does improper ...

Does improper inheritance have a potential to wreck a project? Many projects meet a dead end due to bad inheritance. Hence it certainly has potential to wreck a project. Sma

What are the debugging methods you employ while came across , What are the ...

What are the debugging methods you employ while came across a problem? A: Debugging with tools such as: 1.      DBG, GDB ,Forte, Visual Studio. 2.      Using tusc to trace

Program for construct a struct - user defined data type, Define a user-defi...

Define a user-defined data type (struct) called Car to represent a car in the context of a car dealership database. Car must have at least the following characteristics: Make Model

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd