0% found this document useful (0 votes)
17 views8 pages

H SDD 2024

The document describes a software design problem of analyzing CEO salary data from multiple companies. It provides requirements, design details, and pseudocode for a program to find the highest CEO salary, display the difference for a chosen company, and find statistics on employee counts. It includes tasks to identify requirements, design a function, implement the program, and test it.

Uploaded by

scottjdohnston
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views8 pages

H SDD 2024

The document describes a software design problem of analyzing CEO salary data from multiple companies. It provides requirements, design details, and pseudocode for a program to find the highest CEO salary, display the difference for a chosen company, and find statistics on employee counts. It includes tasks to identify requirements, design a function, implement the program, and test it.

Uploaded by

scottjdohnston
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

ownloaded by [email protected] from 217.181.30.

13 on 17/01/2024 10:2

Task 1: software design and development


Problem description
A research organisation gathers and stores data on the salaries paid to the chief executive
officers (CEOs) of the top 100 technology companies in the country. They want a program
to help them use this data effectively.

Purpose
A CSV file stores the following data about the 100 companies:

♦ company name
♦ number of employees
♦ salary paid to CEO

This data will be read into parallel arrays.

The program will allow the user to enter the name of a company to find and display the
difference between that company’s CEO’s salary and the highest paid CEO of all 100
companies.

The program will also find the highest number of employees employed by a single
company, and the number of companies who employ within 10% of that figure.

Examples of the program outputs are shown below.

Enter the name of the company you would like to check:

Goldman

GameGo company has the highest paid CEO.


The Goldman CEO earns £222817 less than the highest paid CEO.

The highest number of employees employed by a single company is 888.


11 companies employ within 10% of 888.

Assumptions
♦ the external file is current and updated regularly

Version 1.0 11
ownloaded by [email protected] from 217.181.30.13 on 17/01/2024 10:2

Task 1: software design and development (part A)


1a Using the problem description, identify the missing functional requirements of the
program.
(2 marks)

Input(s)

♦ Read the company name, number of employees and CEO salary from the file.

Process(es)

♦ Find the highest CEO salary.

♦ Search for the CEO salary for chosen company.

♦ Find the highest number of employees employed by a single company.

♦ Calculate how many companies employ within 10% of the highest number of
employees.

Output(s)

♦ Display the name of the chosen company, the name of the company with the
highest CEO salary and the difference between the two salaries or display
“Company not found”.

♦ Display the number of companies who employ within 10% of the highest number
of employees.

♦ Check your answers carefully, as you cannot return to part A after you hand it in.
♦ When you are ready, hand part A to your teacher or lecturer and collect part B.

Candidate name___________________________ Candidate number____________________

Version 1.0 12
ownloaded by [email protected] from 217.181.30.13 on 17/01/2024 10:2

Task 1: software design and development (part B)


Your teacher or lecturer will provide you with a CSV file called ‘companies.csv’.

The file has data for 100 companies.

Each line of the CSV file stores the company name, the number of employees and the CEO
salary as shown below:

Fidelity,319,582235
iShares,853,523579
Aviragen,548,636367
Aviragen Therapeutics,501,630486
Southern,269,369821
Southern First,141,791140
Southern First Bancshares,623,304523
Goldman,440,850580
Nuveen,599,834853

Program top level design (pseudocode)

A top level design for the main steps of the program is shown below.

Steps 2 and 3 will call the same function to return the position of the highest value.

1 Read from file into parallel arrays. OUT: company(), numEmployees(),


ceoSalary()

2 Find and display the difference between IN: company(), ceoSalary()


the chosen company’s CEO salary and the
highest CEO salary.

3 Find and display the highest number of IN: numEmployees()


employees employed by a single company,
and the number of companies who employ
within 10% of that figure.

Version 1.0 13
ownloaded by [email protected] from 217.181.30.13 on 17/01/2024 10:2

1b Using a recognised design technique, design a function called findMaxPos that will
return the position of the highest value in an array. This function will be used in
steps 2 and 3 of the program.

(4 marks)

♦ Check your answers carefully, as you cannot return to part B after you hand it in.
♦ When you are ready, hand part B to your teacher or lecturer and collect part C.

Candidate name___________________________ Candidate number____________________

Version 1.0 14
ownloaded by [email protected] from 217.181.30.13 on 17/01/2024 10:2

Task 1: software design and development (part C)


A top level design for the main steps of the program (with partial refinements) is shown
below.

1 Read from file into parallel arrays. OUT: company(), numEmployees(),


ceoSalary()

2 Find and display the difference between IN: company(), ceoSalary()


the chosen company’s CEO salary and the
highest CEO salary.

3 Find and display the highest number of IN: numEmployees()


employees employed by a single company,
and the number of companies who employ
within 10% of that figure.

Refinements

2.1 Ask user to enter the name of chosen company


2.2 Set found to false
2.3 Set found position to -1
2.4 Call findMaxPos function to return the position of highest CEO salary
2.5 Loop for each company
2.6 If current company is the chosen company
2.7 Set found to true
2.8 Set found position to current index
2.9 End if
2.10 End loop
2.11 If chosen company name is in list
2.12 Calculate and store the difference between salaries
2.13 Display message containing name of company with highest CEO salary
2.14 Display the name of the chosen company, and difference in salaries
2.15 Else
2.16 Display “Company not found”
2.17 End if

3.1 Call findMaxPos function to return position of highest number of employees


3.2 Set count to 0
3.3 Loop for each number of employees in array
3.4 If current employees is greater than or equal to maximum employees*0.9
3.5 Set count to count + 1
3.6 End If
3.7 End Loop
3.8 Display message showing number of companies that employ within 10% of the
highest number of employees

Version 1.0 15
ownloaded by [email protected] from 217.181.30.13 on 17/01/2024 10:2

1c Using the problem description and design, implement the program in a language of
your choice.

You should:

♦ use a single function to find and return the position of the highest CEO salary, and
the position of highest number of employees
♦ use procedures to:
— read data from the ‘companies.csv’ file to parallel arrays
— find and display the difference between the chosen company’s CEO salary and
the highest CEO salary
— find and display the highest number of employees employed by a single
company, and the number of companies who employ within 10% of that figure.
♦ test your program by using the company name ‘Goldman’
(15 marks)

Print evidence of:

♦ your program code


♦ program outputs (expected outputs can be found in the problem description)

Version 1.0 16
ownloaded by [email protected] from 217.181.30.13 on 17/01/2024 10:2

1d Step 2 of the program is tested with the following sample test data.

Grap,724,375000
Ver,163,1031000
Meto,728,816000
TelTo,252,1031000
Selop,555,842000
Sever,307,569000
Lehar,805,564000
EastA,401,320000

(i) Explain why the output from the refinements provided for step 2 would be incorrect
if the sample test data was used with ‘Selop’ entered as the company name.
(1 mark)

(ii) Describe the additional refinements that would be required before step 2.13 to
ensure that the correct company name(s) are found.
(2 marks)

Candidate name___________________________ Candidate number____________________

Version 1.0 17
ownloaded by [email protected] from 217.181.30.13 on 17/01/2024 10:2

1e Evaluate the efficiency of your own program, with reference to the use of the
findMaxPos function.
(1 mark)

Candidate name___________________________ Candidate number____________________

Version 1.0 18

You might also like