Document 15352015


Kingdom of Saudi Arabia

Ministry of Higher Education

College of Computer & Information Sciences

Majmaah University

Assignment Due by Sun April 5

Assignment 2

Write C++ program that has a class named store to store information related to the items in the store. The UML representation of the class is shown below.

- s_name: string

- s_city: string

-s_monthlyprofit: double []

+ store(in name: string ,in city: string )

+display_info() : void


The class contains:

 s_monthlyprofit: Array to store the monthly profit of the store in 12 months.

Parameterized constructor : That initializes s_name, s_city to a given value.

 display_info() : prints all information about the store(name,city and annual profit).

Hint: annual profit = total profit of the 12 months that stored in s_monthlyprofit array.

Main function:

Create a store object named by store1 and make the city and name of store entered by the user.

Fill the array by the profit for the 12 month of store1.

Print store information (name,city and annual profit).