The Student Room Group

Can someone help me with this question?

A business wants to store data about companies they supply. The data to be stored includes: company name,email address and number of contracts.

Design a class Company and draw the class diagram (Simply show data parts and methods part separate )Write a program to implement the above (in Pascal).

Assign different values of your choice to the data parts to test your program.

Help please?
Reply 1
Well your class diagram fro Data would be something like company_id company_name str(30), company_email_address1 str(40), company_n_contract int

and you methods would be something like

get_company_name
set_company_name
..............
getters and setters for each entity
.............

The Pascal code might depend a bit on you flavour of Pascal (e.g. Delphi) but shoudl flow really easily from the UML
Reply 2
Original post by nerak99
Well your class diagram fro Data would be something like company_id company_name str(30), company_email_address1 str(40), company_n_contract int

and you methods would be something like

get_company_name
set_company_name
..............
getters and setters for each entity
.............

The Pascal code might depend a bit on you flavour of Pascal (e.g. Delphi) but shoudl flow really easily from the UML


Thanks :smile:
Reply 3
Original post by The learner
Thanks :smile:

You might also.add an initialise method as well. Which is also an opportunity to demonstrate a bit of overloading.

Quick Reply

Latest