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

Multiple Choice Questions (Computer Systems, Information Security, Software Design, Management, Strategy)

Uploaded by

ChaSe Yeon
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 views229 pages

Multiple Choice Questions (Computer Systems, Information Security, Software Design, Management, Strategy)

Uploaded by

ChaSe Yeon
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/ 229

10

Afternoon Exam
Section

Multiple Choice Questions


(Computer Systems,
Information Security,
Software Design,
Management, Strategy)

Learning Objectives
(Computer System)
1. Be able to explain the hardware, including the expression of information,
operation principle of the CPU, and system configuration, by using examples.
2. Be able to explain the software, including the OS functions, by using examples.
3. Be able to explain the consistency of database, normalization, SQLs, and failure
recovery process, by using examples.
4. Be able to explain the network, including the meaning of an IP address, TCP/IP, and
the function of a connecting device between LANs, using examples, and be able to
calculate the transmission rate, speed, and time.
(Information Security)
5. Be able to specifically explain information security, including the mechanism of
encryption and authentication. Be able to explain the security management of an
organization, including access management, permissions, antivirus measures, and
security policies, by using examples.
(Software Design)
6. Be able to explain the software design, including the structured design (DFD
and module structure diagram), object orientation, as well as the creation of test
data and execution of a test, by using examples.
(Management)
7. Be able to understand examples of project management, including the scope
(WBS creation) schedule and cost management.
8. Be able to explain service management, including the system performance and
reliability, as well as the role of service desk and service level management.
(Strategy)
9. Be able to explain the business and information strategy, including
improvement of business operations and business strategy techniques, by
using examples. Be able to understand examples of linear programming,
inventory control, and quality inspection techniques, as an optimization
strategy.
10. Be able to explain finance and accounting, including the profit and break-even
point, and calculation of the cost, by using examples. Be able to explain the
content of the Labor Law and the Copyright Act, by using examples.

217
Afternoon Exam Section 10 Selected Questions (Computer System)

10.1 Selected Questions (Computer System)


Q10-1 
Read the following description of the execution of hardware instructions, and then
answer the Subquestion.

(1) One word consists of 16 bits, and the instruction length is 1 word. Fig. 1 shows the
instruction format.

15 8 7 0 (Bit number)
Instruction part Operand part
op r v
Fig. 1 Instruction format

(2) Table 1 shows the meanings of op, r and v.


There are 16 registers (register numbers 0 to F), each 1 word in length. op, r, v and
the register contents are all described in hexadecimal notation.

Table 1 Meanings of op, r and v


Meaning
op Operation code (00 ≤ op ≤ FF)
r Register number (0 ≤ r ≤ F)
v Register number or constant (0 ≤ v ≤ F)

(3) Table 2 shows the instruction specifications (partial).

218
Afternoon Exam Section 10 Selected Questions (Computer System)

Table 2 Instruction specifications (partial)


op
Name Operation
(Operation code)

LR
10 Sets the contents of register v in register r.
(Load Register)

AR Obtains the sum of the register r and register


20
(Add Register) v contents, and sets the results in register r.

Obtains the logical sum of the register r and


OR
30 register v contents, and sets the results in
(Or Register)
register r.

Shifts the contents of register r to the left by


SL the number of bits specified by the constant
40
(Shift Left) v, and sets “0” in empty bit positions
resulting from the shift.

Shifts the contents of register r to the right by


SR the number of bits specified by the constant
50
(Shift Right) v, and sets “0” in empty bit positions
resulting from the shift.

Subquestion
From the answer groups below, select the correct answers to insert in the blanks
in the following description.
The contents of registers 1 through 5 are as shown in Fig. 2.

(Register number) Contents


1 1234
2 8361
3 5F2A
4 C38B
5 0010
Fig. 2 Contents of registers 1 through 5

219
Afternoon Exam Section 10 Selected Questions (Computer System)

(1) When the following instruction is executed with the register status as shown in Fig.
2, the contents of register 2 become A .
Instruction:3021
(2) When the following 4 instructions are executed in order with the register status as
shown in Fig. 2, the contents of register 3 become B , and the contents of
register 4 become C .

Instructions: 1034
4038
5048
3043

(3) When the following 4 instructions are executed in order with the register status as
shown in Fig. 2, the contents of register 5 increase by a factor of 10 (Register 5:
0010 → 00A0).

Instructions: 1065
4063
40 D
2056

Answer group for A:


a) 9375 b) 9395
c) 9575 d) 9595

Answer group for B and C:


a) 005F b) 008B
c) 00C3 d) 2A00
e) 2A5F f) 8B00
g) 8BC3 h) C38B

Answer group for D:


a) 51 b) 52
c) 61 d) 62

220
Afternoon Exam Section 10 Selected Questions (Computer System)

Q10-2 
Read the following description concerning a floating point number (IEEE 754)
represented by 32 bits, and then answer the Subquestion.

[Explanation of a floating point number]


A floating point number is composed of a sign part, a mantissa part, and an exponent
part.
For example, the numeric value 8.625 becomes:

8.625 = + 8.625 × 100


sign mantissa exponent

and is expressed as a floating point number as follows:

Sign part Exponent part Mantissa part


0 1 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
31 30 23 22 0
Fig. 1 Bit position

This is interpreted as below:


(1) The + sign is expressed by 0 and the − sign is expressed by 1, and these are saved in
the most significant bit.

0 1 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Fig. 2 Bit position (sign)

(2) Perform radix conversion of 8.625 to a binary number.


(i) Convert the integer part to a binary number.

8(10) = 1000(2)

221
Afternoon Exam Section 10 Selected Questions (Computer System)

(ii) Convert the decimal fraction part to a binary number. Conversion is performed by
lining up the integer parts of values obtained upon multiplication with 2.
For example, in the case of 0.625,

0.625 × 2 = 1.250

0.250 × 2 = 0.500

0.500 × 2 = 1.000 End here because there are no more numbers after the decimal point.
101
0.625(10) = 0.101(2)

(iii)Therefore, when 8.625 are converted to a binary number, it becomes 1000.101,


which is a mantissa.
(3) The exponent part is saved in 8 bits, however, to support the exponent even when it
becomes a negative number, 127 is taken as the reference value. That is, if the
exponent part is less than 127, the exponent is negative, and if the exponent part is
127 or more, it becomes either 0 or a positive number.
Adjust (normalize) this exponent part such that the integer part of the mantissa
becomes 1.
For example, because the mantissa described earlier (in (2)) is 1000.101, the integer
part of this mantissa is changed to 1 as follows:
1000.101 = 1.000101 × 23
which means that the exponent becomes 3, while the mantissa becomes 1.000101.
Therefore, with 127 as the reference, 127 + 3 = 130, and the exponent part becomes
10000010(2) as a binary number.

0 1 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Fig. 3 Bit position (exponent part)

(4) Because the mantissa part is adjusted so that the integer part of the mantissa
becomes 1, only the numbers after the decimal point are saved in the mantissa part.
That is, when the mantissa is 1.000101, then only 000101 is saved.

0 1 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
▲ (Position of the virtual decimal point)
Fig. 4 Bit position (mantissa part)

222
Afternoon Exam Section 10 Selected Questions (Computer System)

Subquestion
The sentences below describe the process of converting data containing a 32-bit floating
point number to a 32-bit integer. From the answer group below, select the correct answer to
be inserted in the blank in the description below.

0 1 0 0 0 0 1 0 1 0 0 1 1 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Fig. 5 Conversion to an integer (basic)

(1) Sign
The sign bit is 0. Therefore, the sign is positive.

0 1 0 0 0 0 1 0 1 0 0 1 1 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Fig. 6 Conversion to an integer (sign part)

(2) Exponent part


The exponent part is 10000101, which becomes 133 when it is converted to decimal,
and is expressed as the A -th power of 2.

0 1 0 0 0 0 1 0 1 0 0 1 1 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Fig. 7 Conversion to an integer (exponent part)

(3) Mantissa part


1 is added to the mantissa part since only the mantissa part is extracted and adjusted
such that the integer part becomes 1.

(i) 0 1 0 0 0 0 1 0 1 0 0 1 1 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0

(ii) 0 0 0 0 0 0 0 0 1 0 0 1 1 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
▲ (Position of the virtual decimal point)
Fig. 8 Conversion to an integer (mantissa part)

223
Afternoon Exam Section 10 Selected Questions (Computer System)

(4) Conversion to integer


Because the numeric value is obtained by multiplying the A -th power of 2
by (ii) of Fig. 8, the position of the virtual decimal point is A digits towards
the right from (ii) of Fig. 8 ((i) of Fig. 9). Therefore, when the virtual decimal point
is shifted B bits to the right from (i) of Fig. 9, the decimal point moves to
the right end, and the integer part is extracted ((ii) in the figure below).

00 0 00 0 0 0 1 0 0 1 1 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
▲ (Position of the virtual decimal point)

(i) 0000 00 001 00 11 01 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0


▲ (Position of the virtual decimal point)

(ii) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 0 1
(Position of the virtual decimal point) ▲
Fig. 9 Conversion to an integer (integer value)

According to this concept, when the power of 2 exceeds C , the entire bit must
be shifted to the left in order to determine the position of the virtual decimal point.
Furthermore, when the power of 2 exceeds D , the range that can be displayed as a
32-bit integer value is also exceeded.
(5) Adding a sign
To the value of Fig. 9, add the sign obtained in (1).

Answer group:
a) 1 b) 6 c) 8 d) 17
e) 22 f) 23 g) 30 h) 31

224
Afternoon Exam Section 10 Selected Questions (Computer System)

Q10-3 
Read the following description regarding “overlay” and answer Subquestions 1 and 2.

In recent years, overlay has become increasingly necessary as a result of the expansion
of the program size used in embedded systems. Overlay means a method by which a
program is divided into a number of overlay segments (hereinafter, “segment[s]”), and
only those segments which include modules required for the execution of the program at a
given time, are read by the OS and loaded into the main memory areas.

(1) There is a program composed of 10 modules, namely modules A through J. Each


module is of a call structure as shown in Fig. 1. For example, module G calls two
modules, namely, modules H and I.

B D J

C E F G

H I

Fig. 1 Call structure for modules

(2) The execution sequence of the modules in this program is as shown in Fig. 2.

A→B→C→D→ E →G→H→ F →G→ I → J

α
Fig. 2 Execution sequence of modules

(3) The sizes of main memory required for the execution of individual modules are as
shown in the table below. The size of each segment is equal to the sum of the sizes
of the modules constituting the segment.

Table Sizes of modules


Module A B C D E F G H I J
Size (Mbytes) 10 8 6 5 6 4 6 2 3 15

225
Afternoon Exam Section 10 Selected Questions (Computer System)

Subquestion 1
From the answer group below, select the correct answer to be inserted into the blank
in the following description.

Fig. 3 below shows a program overlay structure and modules constituting each segment.
Fig. 3 signifies that segments P0 and P2 are read into the main memory area when module
D is called from module A. Furthermore, it is also shown that segments P1, P2, and P3
are read into spaces starting at the same address in the main memory area.

Segment Constituent module


Main memory

P0
P0 A
area

P1 P2 P3
P1 B, C
P2 D, E, F, G, H, I
P3 J

Fig. 3 Overlay structure and segments

When this program is executed, segments P0, P1, P2, and P3 are read into the main
memory in this order, resulting in a total of only four loadings by the time the execution of
the program is completed. The size of the main memory area required for execution in
the overlay structure in Fig. 3 is Mbytes.

Answer group:
a) 24 b) 25 c) 35 d) 36
e) 37 f) 38 g) 39 h) 40

226
Afternoon Exam Section 10 Selected Questions (Computer System)

Subquestion 2
From the answer groups below, select the correct answers to be inserted into the blanks
in the following description.

It became necessary to reduce the main memory area used during the execution of the
program. Therefore, the overlay structure and the segments were reviewed, and two plans
were prepared as shown in Figures 4 and 5.

Segment Constituent module


Main memory area

Q0
Q0 A
Q1 Q2 Q5
Q1 B, C

Q3 Q4 Q2 D
Q3 E, F
Q4 G, H, I
Q5 J

Fig. 4 Plan 1 for overlay structure and segments

Segment Constituent module


R0
Main memory area

R0 A
R1 R2 R8
R1 B, C

R3 R4 R5 R2 D
R3 E
R6 R7 R4 F
R5 G
R6 H

R7 I
R8 J

Fig. 5 Plan 2 for overlay structure and segments

227
Afternoon Exam Section 10 Selected Questions (Computer System)

In comparison with the overlay structure in Fig. 3, the size of the main memory area
used in the execution of the program can be reduced by 10 Mbytes in plan 1 and by
A Mbytes in plan 2.
The number of times a segment is loaded into the main memory area by the time the
execution of module F located at α in Fig. 2 is completed, is 6 in plan 1 and
B in plan 2.
In comparison with the overlay structure in Fig. 3, the number of times the segments are
loaded into the main memory area by the time the execution of the program is completed
increases by C in plan 1 or by 6 in plan 2.

Answer group for A:


a) 10 b) 11 c) 12
d) 13 e) 14 f) 15

Answer group for B and C:


a) 1 b) 2 c) 3 d) 4
e) 5 f) 6 g) 7 h) 8
i) 9 j) 10

228
Afternoon Exam Section 10 Selected Questions (Computer System)

Q10-4 
Read the following description concerning task control, and then answer Subquestions 1
through 3.

Task control is one of the functions of an operating system. A task is a processing unit of
an operating system, which is also the unit in which the CPU is assigned. Multiprocessing
(multi-task) is a function by which several tasks are executed in parallel in a single CPU by
performing state transition of tasks. During state transition of a task, a control for assigning
the CPU to the task is necessary, which is called task scheduling.

[Explanation of state transition of a task]


There are three (3) states of a task: the running state in which the CPU is assigned to the
task, the ready state in which the task is waiting for the CPU to be assigned, and the waiting
state in which the task is waiting for the input/output processing to terminate. As shown in
Fig. 1, a task transits through these three (3) states.

Running
state

(i) (iii)
(ii)

Ready Waiting
state state

(iv)

Fig. 1 State transition of the task

The factors responsible for state transition of the task in Fig. 1 are as follows:
(i) The right to use the CPU is transferred to the task with a higher execution priority.
(ii) The right to use the CPU is assigned.
(iii)The task has entered the input/output processing.
(iv) The input/output processing has terminated.

229
Afternoon Exam Section 10 Selected Questions (Computer System)

The state transition described in (iii) is performed when the program requests the
input/output processing to the operating system, and A occurs. The state
transition described in (iv) is performed with B , which provides notification of the
termination of the input/output processing, as the trigger.

[Explanation of the scheduling method]


Control of the state transition (i) and (ii) in Fig. 1 is referred to as task scheduling. The
scheduling methods include the round robin method and the priority scheduling method.
(1) Round robin method
A fixed CPU time is assigned sequentially to the tasks in the ready state. This CPU
time is called a time slice. When C occurs, and it is determined that the
time slice in the handler has been used up, the task in the running state is sent to the
end of the ready queue. Thus, the next task changes to the running state. The next
task changes to the running state even when it enters the input/output processing
before the time slice is used up. Also, once a task in the waiting state is reached, that
task is skipped, and the next task is set to the running state.
If the time slice is shortened, generally, the termination time of the task with a
D CPU processing time is faster as compared to other tasks.
(2) Priority scheduling method
When a task with a higher priority order than a task in the running state is set to the
ready state, the task in the running state transits to the ready state. Therefore, the task
with a higher priority order transits from the ready state to the running state. When a
task in the running state enters the input/output processing and changes to the waiting
state, the task with the next priority order is set to the running state.
If the priority order of the task with a E CPU processing time is increased,
then in comparison with the input/output processing time, generally, the overall
throughput improves.

230
Afternoon Exam Section 10 Selected Questions (Computer System)

Subquestion 1
From the answer groups below, select the correct answer to be inserted in the blanks
in the question. However, the answers may be duplicated.

Answer group for A through C:


a) SVC interrupt b) Timer interrupt
c) I/O interrupt d) Program interrupt
e) Machine check interrupt

Answer group for D and E:


a) Long b) Short

Subquestion 2
From the answer group below, select the correct description concerning the number of
tasks in the running state and the number of tasks in the ready state, when three (3) tasks are
operating simultaneously in a single processor, and then enter the answer in the answer
column F. However, input/output processing using the same I/O device (the input/output
processing of the other tasks is awaited until the input/output processing of the task that
started using the I/O device first is complete) is performed for the three (3) tasks. Here,
when the task is in the waiting state, it is waiting only for the input/output processing.

Answer group:
a) The number of tasks in the running state is either zero (0) or one (1), and the number
of tasks in the ready state is between zero (0) and two (2).
b) The number of tasks in the running state is either zero (0) or one (1), and the number
of tasks in the ready state is between zero (0) and three (3).
c) The number of tasks in the running state is always one (1), and the number of tasks
in the ready state is either one (1) or two (2).
d) The number of tasks in the running state as well as the number of tasks in the ready
state is always one (1).

231
Afternoon Exam Section 10 Selected Questions (Computer System)

Subquestion 3
From the answer groups below, select the correct answer to be inserted in the blanks
in the description below.

There are three (3) tasks T1, T2, and T3. Fig. 2 shows the usage order and processing
time of the CPU and the I/O device when each task is executed independently. The
processing time is the time from the start of processing of a task until its end. The three (3)
tasks use different I/O devices that can be operated separately. There is one (1) CPU.
Furthermore, the execution time of the operating system is shorter than the execution time
of a task, and is ignored.

Task Processing time (milliseconds)

T1 10 50 10 40 10 30 10

T2 30 40 20 30 30

T3 60 30 10

In the figure, indicates that the CPU processing is in progress, and


indicates that the input/output processing is in progress.

Fig. 2 Usage order and processing time of the CPU and I/O device

The three (3) tasks T1, T2, and T3 are executed by the round robin method in the order
T1→T2→T3→T1→…... The time slice is 20 milliseconds. In such a case, the task
terminating in the end is G and the processing time is H milliseconds.

Answer group for G:


a) T1 b) T2 c) T3

Answer group for H:


a) 160 b) 170 c) 180 d) 190
e) 200 f) 210 g) 220 h) 230

232
Afternoon Exam Section 10 Selected Questions (Computer System)

Q10-5 
Read the following description of a relational database, and then answer Subquestions 1
through 3.

Company X operates a transport business. There are branch offices strategically located
to cover a certain region, and distribution centers that manage these branch offices. A
region is divided into districts, and each branch office is responsible for delivery within its
district. Branch offices accept parcels from customers for delivery, and issue receipt
numbers that are unique numbers throughout Company X.
A branch office delivers a parcel when its destination address is within that branch
office’s district. Otherwise, a branch office transfers a parcel to its managing distribution
center, as there are no transferring paths between any two branch offices. When a
distribution center accepts a transferred parcel and the branch office responsible for
delivering that parcel is managed by that same distribution center, the distribution center
transfers the parcel to that branch office. Otherwise, it transfers the parcel to the
distribution center that manages the branch office responsible for delivery. Fig. 1 shows
the relationship between the branch offices and distribution centers when transferring
parcels.

Distribution Distribution
Center A01 Center A02

Branch Branch Branch Branch Branch


Office S11 Office S12 Office S13 Office S21 Office S22

Note: The dotted line sections represent each branch office’s district.
Fig. 1 Relationship between branch offices and distribution centers
when transferring parcels

233
Afternoon Exam Section 10 Selected Questions (Computer System)

Company X controls the parcel status using a relational database that has the structure
shown in Fig. 2. Underlined items in the figure indicate key items.

Delivery Area Table Branch Office Table


District Branch office code Branch office code Distribution center code

Parcel Table

Date and Accepting


Receipt Sender Sender Sender Destination Destination Destination
time branch
number district address name district address name
accepted office code

Transfer History Table


Passed branch office
Receipt Passed date Status
or distribution center
number and time code
code
Fig. 2 Relational database structure

Delivery Area Table: This table holds the codes (3 characters starting with S) of
the branch offices responsible for each district.
Branch Office Table: This table holds the codes (3 characters starting with A) of
the distribution centers that manage the branch offices for
each branch office code.
Parcel Table: This table holds the parcel sender, destination and other
information for each receipt number.
Transfer History Table:This table holds the date and time and the in/out history for
each time a parcel enters or leaves a collection and
distribution location (branch office or distribution center).
‘I’ is stored in the status code when a parcel enters, or ‘O’
when a parcel leaves a collection and distribution location.

234
Afternoon Exam Section 10 Selected Questions (Computer System)

Subquestion 1
From the answer group below, select the SQL statement that correctly obtains the
number of branch offices managed by the distribution center A01.

Answer group:
a) SELECT COUNT (Branch_office_code) FROM Branch_Office_Table
WHERE Distribution_center_code NOT IN (‘A01’)
b) SELECT COUNT (Branch_office_code) FROM Branch_Office_Table
WHERE Distribution_center_code = ‘A01’
c) SELECT COUNT (Branch_office_code) FROM Branch_Office_Table
WHERE Branch_office_code = ‘A01’
d) SELECT Branch_office_code FROM Branch_Office_Table
WHERE Distribution_center_code = ‘A01’
e) SELECT Distribution_center_code FROM Branch_Office_Table
WHERE Branch_office_code = ‘A01’ ORDER BY Distribution_center_code

Subquestion 2
The following SQL statement creates a list of the delivery destinations for parcels
delivered directly by branch office S11 from among the parcels accepted by that branch
office thus far. From the answer group below, select the correct answer to insert in each
blank in the following SQL statement.

SELECT Destination_district, Destination_address, Destination_name


FROM A
WHERE Accepting_branch_office_code = ‘S11’ B
Destination_district
C (SELECT District FROM Delivery_Area_Table
WHERE Branch_office_code = ‘S11’)

Answer group:
a) Transfer_History_Table b) Branch_Office_Table
c) Delivery_Area_Table d) Parcel_Table
e) AND f) IN
g) NOT IN h) OR

235
Afternoon Exam Section 10 Selected Questions (Computer System)

Subquestion 3
An inquiry was made to the Transfer History Table using the following SQL statement.
From the answer group below, select the correct answer that can be determined from the
results of this inquiry.

SELECT Passed_date_and_time,
Passed_branch_office_or_distribution_center_code, Status_code
FROM Transfer_History_Table
WHERE Receipt_number = ‘0000004’ AND
Passed_date_and_time = (SELECT MAX (Passed_date_and_time)
FROM Transfer_History_Table
WHERE Receipt_number = ‘0000004’)

Answer group:
a) The branch office that stored the parcel with the receipt number ‘0000004’ for the
longest time
b) The sender of the parcel with the receipt number ‘0000004’
c) The entire transfer history of the parcel with the receipt number ‘0000004’
d) The most recent collection and distribution location and its passed date and time of
the parcel with the receipt number ‘0000004’
e) The number of days and hours from acceptance to delivery of the parcel with the
receipt number ‘0000004’

236
Afternoon Exam Section 10 Selected Questions (Computer System)

Q10-6 
Read the following description concerning a component order-receiving system using a
relational database, and then answer Subquestions 1 through 4.

There is an order-receiving system that handles electric components for consumer


electronic appliances. The E-R diagram of this system is shown in the figure. The entities in
the E-R diagram are implemented as corresponding tables of the relational database. The
entity name and attribute name in the E-R diagram correspond to the table name and item
name, respectively, on the relational database. This system performs search of the “Stock”
table, allocation from the “Stock” table, creation of the “Stock allocation” table, and
creation of the “Receipt of order” table for orders from online terminals of the distributors.
The electric components are stocked in multiple warehouses, and as a principle, delivery is
made to each distributor from the warehouse with the least transportation cost. The
transportation costs between the distributor and warehouse are recorded in the
“Transportation cost” table. A maximum of 5 types of alternative components are available
for each electric component. Alternative components are registered in the “Component”
table. When n types of alternative components are available, they are recorded from
alternative component #1 to alternative component #n in the component table, and the
alternative component #n+1 to alternative component #5 have NULL values. Alternative
components of the alternative component are not used as the alternative component of the
original component.

[Stock allocation process]


The process of stock allocation is as follows:
(1) The ordered quantity of the components ordered is allocated from the stock in the
warehouse with the least transportation cost as seen from the distributor.
(2) When the stocked quantity does not meet the ordered quantity, the amount remaining
after the allocation of the stocked quantity is allocated from the alternative
components.
(3) If the alternative components also do not suffice, the lacking amount is allocated
from the warehouse with the second least transportation cost. Even in such a case,
step (1) is performed first followed by step (2).

[Assignment of a serial number]


An order number is assigned to each order received from the online terminal. In the stock
allocation process, if several warehouses or several components are allocated to a single
received order, then apart from the order number, a serial number is assigned in a sequence
starting from 1, which is registered as a separate line on the “Stock allocation” table. If a

237
Afternoon Exam Section 10 Selected Questions (Computer System)

single warehouse and a single component can be allocated to a received order, only a line
with the serial number 1 is registered.
The components that are actually allocated to a received order are called the allocated
components. If the ordered quantity is not met even after the allocation of all components
that can be allocated, the allocated quantity of the “Stock allocation” table becomes less
than the ordered quantity of the “Receipt of order” table.

Distributor Transportation cost Warehouse

Distributor code Warehouse code


A
Distributor name Warehouse name
B
Transportation cost
Stock
Warehouse code

C
Stock allocation
Stocked quantity
Order number
Serial number
B
C
Receipt of order
D Component
Order number
Component number
A
Component name
Ordered component number
Price
Ordered quantity
Alternative component #1
Alternative component #2
Alternative component #3
Entity name Legend Alternative component #4
: One-to-one Alternative component #5
Attribute name
: One-to-many
Attribute name
Attribute name : Many-to-many

Note: The solid underline of an attribute name indicates the primary key,
and the broken underline indicates the external key.
For an attribute name which has a solid underline, a broken underline is omitted.

Fig. E-R diagram of the order-receiving system (partially incomplete)

238
Afternoon Exam Section 10 Selected Questions (Computer System)

Subquestion 1
From the answer group below, select the appropriate attribute name to be inserted in each
blank in the figure.

Answer group:
a) Stocked quantity b) Ordered quantity
c) Order number d) Warehouse code
e) Distributor code f) Allocated quantity
g) Component number

Subquestion 2
From the answer group below, select the relationship (corresponding relationship)
between each of the pair of entities (1) and (2) below.

(1) Warehouse - Component


(2) Distributor - Receipt of order

Answer group:
a) One-to-one b) One-to-many c) Many-to-one d) Many-to-many

239
Afternoon Exam Section 10 Selected Questions (Computer System)

Subquestion 3
A SELECT clause is created to investigate the ordered quantity that is not fulfilled by the
allocation of the stock. From the answer group below, select the correct answer to be
inserted in each blank in the following SELECT clause.

SELECT Receipt_of_order.Order_number, E , Ordered_quantity,


F (Allocated_quantity)
FROM Receipt_of_order, Stock_allocation
WHERE Receipt_of_order.Order_number = Stock_allocation.Order_number
GROUP BY Receipt_of_order.Order_number, Ordered_component_number, Ordered_quantity
HAVING Receipt_of_order.Ordered_quantity > F (Allocated_quantity)

Answer group:
a) AVG
b) COUNT
c) MAX
d) SUM
e) Order_number
f) Ordered_component_number
g) Warehouse_code
h) Component_number

240
Afternoon Exam Section 10 Selected Questions (Computer System)

Q10-7 
Read the following description concerning an IP address (IPv4), and then answer
Subquestions 1 and 2.

An IP address (IPv4) is composed of a network part and a host part, and has a total of 32
bits. Furthermore, the number of bits of the network part and host part is decided based on
the class. For example, the number of bits of the network part is eight (8) for class A, 16 for
class B, and 24 for class C.

IP address (32 bits)


Network part Host part

Because an IP address has a large number of bits which make it difficult to use the IP
address as is, the 32 bits are divided into four (4) blocks of eight (8) bits each, and each
block is represented by a decimal number. Each block is separated from the other by a dot
(.). An example of decimal notation is described below.

255 . 255 . 255 . 128 ← Decimal notation


11111111 11111111 11111111 10000000

When all bits of the host part are “0”, the address refers to the network itself, and when
all bits of the host part are “1”, the address is used for broadcasting to all hosts connected to
the network, and therefore, such addresses cannot be used as the host address.
The host part of class A has 24 bits, and therefore, the number of hosts that can be
24
represented is 2 − 2. Similarly, the number of hosts that can be represented in class C is
8
2 − 2, which implies that class A is used for large networks, class B for medium-size
networks, and class C for small-size networks. However, in terms of class A, a real
problem is that it is difficult to assume that a number of hosts close to the theoretical value
8
exist at all times. Also, in class C, if the number of hosts becomes more than 2 − 2, the
addresses become insufficient. Therefore, a variable-length subnet mask that enables the bit
length of the network address and the host address to be changed flexibly, without being
restricted by a class, is available.
By using a variable-length subnet mask, a high-order bit of the host address can be
included in the network address, and an IP address assignment method making use of this is
called the CIDR (Classless Inter-Domain Routing) method.
A bit array representing how many bits from the first bit of the IP address are to be used
as the network part is called the subnet mask, and the part of the bit array of the subnet
mask with all bits set to one (1) is the network part, and the part with all bits set to zero (0)

241
Afternoon Exam Section 10 Selected Questions (Computer System)

is the host part. The value of the subnet mask in class B is “255.255.0.0” in decimal
notation since the first 16 bits represent the network part. According to the CIDR method,
after the IP address, the bit count of the network part is indicated as the prefix (after the
specification of the IP address, a “/” mark is used as a delimiter followed by the
specification of the bit count of the network part in decimal notation). For example, the
prefix of class B is “/16”.

Subquestion 1
From the answer groups below, select the correct answer to be inserted in the blanks
in the description below.

(1) For an IP address, when the bit pattern for the first eight (8) bits is A
, it is the
IP address of class C. Also, in class C, the number of hosts (devices) that can actually
be allocated is B .
(2) The number of hosts (devices) connected to a network is 30 or less. When the
network address and host address are specified in terms of the least required bit
length of the host address, the decimal notation of the subnet mask is C .
Also, in terms of specification according to the CIDR method, the prefix is
D .

Answer group for A:


a) 00100100 b) 01010101 c) 10010010
d) 10101010 e) 11011011 f) 11101110

Answer group for B:


a) 126 b) 127 c) 128
d) 254 e) 255 f) 256

Answer group for C:


a) 255.255.255.0 b) 255.255.255.128
c) 255.255.255.192 d) 255.255.255.224
e) 255.255.255.240 f) 255.255.255.248

Answer group for D:


a) “/25” b) “/26” c) “/27”
d) “/28” e) “/29” f) “/30”

242
Afternoon Exam Section 10 Selected Questions (Computer System)

Subquestion 2
The management and usage of the IP address based on the CIDR method rather than the
class is practically very useful. From the answer group below, select the appropriate
description concerning the effect of the CIDR method, and then enter it in the answer
column E.

Answer group:
a) The network part of each class can be recognized immediately.
b) The management is easy because the subnet masks are different.
c) The number of useless IP addresses that cannot actually be assigned reduces.
d) The management is easy because path information such as the network address need
not be set in the router.

243
Afternoon Exam Section 10 Selected Questions (Computer System)

Q10-8 
Read the following description concerning data transmission and data encoding, and then
answer Subquestions 1 through 3.

(1) Device A has a sensor connected to it and retrieves 4-byte signed integer values
(hereinafter measurement values) from the connected sensor 100 times per second.
Here, 1 byte is 8 bits.
(2) Device A stores measurement values in packets having the structure shown in the
figure below, and transmits the packets via the network. Multiple continuous
measurement values are stored in a packet. The network has sufficient bandwidth
to transmit the data.
(3) A packet consists of a 150-byte header and a sequence of measurement values. The
maximum length of a packet is 1,478 bytes.
(4) The header holds the number of measurement values that are stored in a packet.
The number varies within the range that meets the condition mentioned in (3).
(5) Device A retrieves certain number of measurement values from the sensor, and
transmits them without delay.
(6) Device A has sufficient capability to simultaneously retrieve and transmit
measurement values.

Header Sequence of measurement values


( 150 bytes ) ( 4 bytes × number of values )

Max. 1,478 bytes


Fig. Structure of a packet

Subquestion 1
From the answer group below, select the correct answer that describes the relationship
between the number of measurement values that are stored in a packet and the
transmission volume (total volume of the header and measurement values) per unit time.

Answer group:
a) As the number of measurement values that are transmitted per packet increases, the
transmission volume per unit time becomes larger.
b) As the number of measurement values that are transmitted per packet increases, the
transmission volume per unit time becomes smaller.
c) Even if the number of measurement values that are transmitted per packet changes,
the transmission volume per unit time does not change.

244
Afternoon Exam Section 10 Selected Questions (Computer System)

Subquestion 2
From the answer groups below, select the correct answer to be inserted in each blank
in the following description.

Measurement values of up to A seconds can be stored in a packet.


The network bandwidth w required to transmit measurement values can be represented
by the expression below. Here, the number of measurement values that are stored in a
packet is n.

w= B × 8 × ( 150 + C ) bits/second

Answer group for A:


a) 1.66 b) 3.32 c) 6.64
d) 13.28 e) 26.56

Answer group for B and C:


a) 100 b) 150 c) 1,200
d) 4n e) 32n f) 100n
g) 1/n h) 100/n i) n
j) n/100

245
Afternoon Exam Section 10 Selected Questions (Computer System)

Subquestion 3
From the answer group below, select the correct answer to be inserted in the blank
in the following description.

Measurement values change little with time in many cases. For example, it is known
that 70% of all measurement values differ from the preceding measurement value within
the range of –128 to 127 (–2 7 to 2 7 –1).
Therefore, measurement values are compressed by using the method described below
when they are transmitted.
(1) The measurement value stored at the beginning of the packet is stored as before.
(2) As for the second or subsequent measurement value to be stored, the difference
from the preceding measurement value is encoded into the compressed code as
shown in the Table, and then placed bit by bit in the packet. Bit length of the
compressed code varies depending on the value of difference. For example, the
bit length of the second or subsequent measurement value will be 9 if the
difference from the preceding measurement value is 10, or the bit length will be
18 if the difference is 200.
The bit length of the sequence of the compressed measurement values is set in the
header.

Table Encoding method of difference and probability of occurrence


−215 to 215−1 −223 to 223−1 −231 to 231−1
Range of
−27 to 27−1 (excluding (excluding (excluding
difference 7 7 15 15
−2 to 2 −1) −2 to 2 −1) −223 to 223−1)
Compressed Difference Difference Difference Difference
0 10 110 111
code (8 bits) (16 bits) (24 bits) (32 bits)
Bit length of
compressed 9 18 27 35
code
Probability
of 70 % 25 % 4% 1%
occurrence

When the distribution of differences from the preceding measurement value is as


indicated by the “probability of occurrence” in the table above, the expected value of the
bit length of the compressed code for the second and subsequent measurement values is
D bits per measurement value.

246
Afternoon Exam Section 10 Selected Questions (Computer System)

Answer group:
a) 9.0 b) 12.23 c) 15.575
d) 22.25 e) 32.0

247
Afternoon Exam Section 10 Selected Questions (Information Security)

10.2 Selected Questions (Information Security)

Q10-9 
Read the following description concerning packet filtering, and then answer
Subquestions 1 and 2.

Company X has built a network shown in the figure, and uses it to publish its Web site to
the Internet and to exchange e-mails.

the Internet

Router

Firewall A Web server Mail server

DMZ

Firewall B
Corporate
LAN
Database Management
server PC

Fig. Network configuration at Company X

Company X’s network is divided by 2 firewalls into 2 segments: DMZ and corporate
LAN. Web server, Mail server, and Database server (hereinafter referred to as DB server)
play the following roles:
(1) Web server
As a Web site, Web server publishes information about the company to the Internet.
On Web server, a program for processing transactions with external entities is
running. Data used by this program is stored on DB server.
(2) Mail server
Mail server sends and receives e-mails to and from external entities. In addition, it
runs a program that automatically distributes e-mails to business partners. The data
for distributing e-mails is stored on DB server.
(3) DB server
DB server maintains the data used by Web server and Mail server.

248
Afternoon Exam Section 10 Selected Questions (Information Security)

From the management PC connected to the corporate LAN, it is possible to login to


each server using SSH, and send and receive e-mails to and from external entities via Mail
server. Although it is possible to access the corporate Web server from the management
PC, access to external Web sites is not permitted.
Table 1 shows the protocols and port numbers used in the network.

Table 1 Protocols and port numbers


Service Protocol Port number
Web HTTP 80
Mail transfer SMTP 25
Secure shell (remote login) SSH 22
Mail reception POP3 110
DB access Specific to DB 1999

Subquestion 1
From the answer groups below, select the correct answer to be inserted into each blank
in the following description. If needed, select the same answer more than
once.

Table 2 shows the packet filtering settings for firewall A, which connects the Internet
and the DMZ. Table 3 shows the packet filtering settings for firewall B, which connects
the DMZ and the corporate LAN.
Each filtering rule allows or denies communication by specifying the source IP address,
destination IP address, and destination port number. Each rule is examined beginning
from the top, and the action of the first row whose condition is met is performed. Here,
no settings are required for response packets since they are automatically allowed by the
dynamic filtering function.

Table 2 Filtering settings for firewall A


Condition
Action
Source Destination Port number
Any Web server 80 Allow
Any Mail server 25 Allow
A Any B Allow
Any Any Any Deny

249
Afternoon Exam Section 10 Selected Questions (Information Security)

Table 3 Filtering settings for firewall B


Condition
Action
Source Destination Port number
Web server DB server 1999 Allow
Mail server DB server 1999 Allow
Management PC C D Allow
Management PC Mail server 22 Allow
Management PC Mail server 25 Allow
Management PC Web server 80 Allow
Management PC Web server 22 Allow
Any Any Any Deny

Answer group for A and C


a) DB server b) Web server c) Management PC
d) Mail server e) Any

Answer group for B and D


a) 22 b) 25 c) 80 d) 110 e) 1999

Subquestion 2
In Company X’s network, security risks associated with Internet connections are reduced
through packet filtering by firewalls, but packet filtering cannot protect the network from
all threats. From the answer group below, select the correct answer for the security risks
that can be prevented with packet filtering.

Answer group
a) Wiretapping and falsification of data exchanged with the Web site
b) SQL injection attacks on the Web site
c) Connection attempts from the Internet to servers within the DMZ via unauthorized
ports
d) Attacks by unauthorized access from the Internet to the corporate LAN
e) Leakage of files from the company via e-mail

250
Afternoon Exam Section 10 Selected Questions (Information Security)

Q10-10 
Read the following description concerning a server certificate, and then answer
Subquestions 1 and 2.

The figure below shows an overview of the exchange between the client and the server
until the actual encryption communication based on SSL (Secure Sockets Layer)
communication starts:

Client Web server

(i)
Phase 1
(ii)

(iii) Phase 2

(iv)

(v)
Phase 3
(vi)
(vii)

The encryption communication starts from here.

Fig. Exchange between the client and server until the start of encryption
communication

[Overview of processing]
(1) Phase 1
(i) The client provides the list of encryption algorithms that the client supports and
the list of compression methods to the server.
(ii) Based on the provided algorithm, the server selects the strongest encryption
algorithm it possesses, and notifies the client of it.
(2) Phase 2
(iii) The entire certificate chain up to the digital certificate of the server (hereinafter,
simply the server certificate), and the certificate by A is sent to the client
(however, this does not include cases where a certificate does not exist).

251
Afternoon Exam Section 10 Selected Questions (Information Security)

(3) Phase 3
(iv) The appropriateness of the server certificate is checked.
(v) The B of the server is extracted from the server certificate.
(vi) The B of the server is used to encrypt the value that acts as the basis of
the C used for communication, and is then sent to the server.
(vii) The server encrypts the received encryption data with its own private key, and
safely acquires the premaster secret.

[Verification of the certificate]


The client and the server generate a common key from the premaster secret, and start
encryption communication (SSL) with this key. The certificate sent from the server in (iii)
is the server certificate issued officially by applying to the certificate authority, and is duly
signed by the certificate authority. The signature of the certificate authority indicates that
the D of the content of the certificate is encrypted by the private key of the
certificate authority. Additionally, along with the server certificate, the certificate of the
certificate authority is also sent to the client. If the certificate authority that has signed the
server certificate is an intermediate certificate authority that has been certified by another
certificate authority, the certificate authority also appends the certificate of the higher-level
certificate authority from whom it has received the attestation. In this way, finally, the
certificate of the A is always sent. The browsers and PCs that are used come
installed with several certificates from root certificate authorities (hereinafter, root
certificates) from the beginning. In (iv), the client ensures that the already installed
certificate and the received root certificate are matching, which enables it to check the
appropriateness of the received root certificate. After this, it uses the public key in the root
certificate to check the lower-level certificate authority that had received the signature of
the root certificate authority, or the appropriateness of the server certificate. By repeating
this operation, all received certificates are verified.

252
Afternoon Exam Section 10 Selected Questions (Information Security)

Subquestion 1
From the answer groups below, select the correct answer to be inserted in the blanks
in the question.

Answer group for A and D:


a) MD5 b) hash value c) certificate authority
d) root certificate authority

Answer group for B and C:


a) common key b) public key c) certificate
d) private key

Subquestion 2
From the answer group below, select two (2) correct answers concerning authentication
and cryptography used in SSL, and then enter them in the answer columns E and F.

Answer group:
a) In SSL-based communication, both public key cryptography and common key
cryptography are used.
b) Common key cryptography is used for checking the appropriateness of the server
certificate.
c) The server certificate is encrypted by the public key of the certificate authority.
d) Common key cryptography is used for encryption communication after the
appropriateness of the server has been confirmed.

253
Afternoon Exam Section 10 Multiple-choice Questions (Software design)

10.3 Multiple-choice Questions (Software


design)
Q10-11 
Read the following description of program design, and then answer Subquestions 1
through 3.
This is an update program that updates the contents of a master file containing member
information with the contents of a transaction file and outputs them to a new master file, at
the end of every month.

[File Description]
(1) Both the master file and the transaction file use the same record format that
consists of the following items.

Member number Name Email address Service rank

(2) The member number is a 5-digit number, and is a required item. There is no
member with the maximum member number value of 99999.
(3) Both the master file and the transaction file are sorted in ascending order using
the member number as the key.
(4) Neither the master file nor the transaction file has multiple records with the same
member number.
(5) The transaction file consists of records used to add new members and records
used to change member information of already registered members.
(6) The records used to change member information contain non-blank data in items
to be changed, and blank data in items that are not to be changed.

[Process Description]
The following key matching process is performed with the master file records as M and
the transaction file records as T.
(1) When there is a T with the same member number as in M, update items in M
corresponding to items in T with non-blank data, but do not update items in M
corresponding to items in T with blank data, and output the record to a new
master file.
(2) When there is no T with the same member number as in M, that M is output to
the new master file as is.
(3) When there is no M with the same member number as in T, that T is output to the
new master file.

254
Afternoon Exam Section 10 Multiple-choice Questions (Software design)

Fig. 1 shows the flow of update program.

The matching keys KM and KT hold, respectively, the member number value in M and
the member number value in T, or the maximum value 99999 indicating that the
corresponding file has been completely read.

Main process

Open each file

M input process

T input process

Compare
KM = Maximum value
and
KT = Maximum value
Note: M' is a storage for work

< >
KM :KT

Copy non-blank items in T to


the corresponding items in M’ α

T input process

Output M' to new master file Output T to new master file β

A B

Compare

Close each file

End

M input process T input process

Read master file Read transaction file

No
File end? No
File end?
Yes KM ß Member number in M
Yes
KM Maximum value M' M KT Maximum value KT ß Member number in T

End End

Fig. 1 Flow of update program

255
Afternoon Exam Section 10 Multiple-choice Questions (Software design)

Subquestion 1
In Fig. 1, the master file update process using key matching is realized by the portion
enclosed by the dotted line.
From the answer group below, select the correct answers to insert in the blanks
in Fig. 1.

Answer group:

a) M’ input process b) M input process c) T input process

Subquestion 2
From the answer groups below, select the correct answers to insert in the blanks
in the following description.

The following changes (1) to (5) will be made to add a process for member information
deletion to this update program
(1) Add a new item named “Type of transaction” to the transaction file record format.
(2) Type of transaction “U” indicates new registration or change, and type of
transaction “D” indicates deletion.
(3) Change the processes α and β in Fig. 1 to support the record format change in
step (1).
(4) Change the main process as shown in Fig. 2.
(5) Add a process to set type of transaction to “U” when the file has been completely
read in the T input process.
Here, the error processes 1 and 2 in Fig. 2 display information related to error records.
The condition X2 is C , and error process 2 is executed when D .

Answer group for C:

a) Type of transaction = “D”


b) Type of transaction = “U”
c) Type of transaction ≠ “D”
d) Type of transaction ≠ “U”
e) (Type of transaction ≠ “D”) AND (Type of transaction ≠ “U”)
f) (Type of transaction ≠ “D”) OR (Type of transaction ≠ “U”)

256
Afternoon Exam Section 10 Multiple-choice Questions (Software design)

Answer group for D:


a) Type of transaction is incorrect
b) The master file does not contain a record with the member number to be deleted
c) The master file already contains a record with the member number to be newly
registered
d) The master file does not contain a record with the member number to be changed

Main process

Open each file

M input process

T input process

Compare
KM = Maximum value
and
KT = Maximum value

Condition X1 Condition X3
Type of transaction

Condition X2 < >
KM:KT

Same as the =
portion enclosed
by the dotted line Output M' to new master file
in Fig. 1

Error process 1 T input process Error process 2

T input process M input process T input process

Compare

Close each file

End

Fig. 2 Flow of update program after change

257
Afternoon Exam Section 10 Multiple-choice Questions (Software design)

Subquestion 3
From the answer groups below, select the correct answers to insert in the blanks
in the following description.

Change the specification to allow multiple records with the same member number in the
transaction file. When multiple records exist, these are processed in order of occurrence of
records. To achieve this, the following changes (1) and (2) will be made.
(1) Add a new item named “Date and time occurred” to the transaction file record
format.
(2) Add a sort program and a record aggregation program to the transaction file
process to generate a new transaction file separately from the update program
shown in Fig. 2.

The sort program rearranges the records in ascending order of sorting keys. Here, the
first sorting key is E and the second sorting key is F .
The record aggregation program has two main functions as follows.
(i) When type of transaction of all input records with the same member
number are “U”, overwrite the contents of change items with non-blank
data to work area, and output the final status.
(ii) When a record with type of transaction “D” is found, output that record.
When a record with that same member number is found thereafter, it is not
processed and is identified as an error.
The execution order for these programs is as follows.

Execution order: G

Answer group for E and F:


a) Member number b) Type of transaction
c) Service rank d) Date and time occurred

258
Afternoon Exam Section 10 Multiple-choice Questions (Software design)

Answer group for G:


a) Update program → Sort program → Record aggregation program
b) Update program → Record aggregation program → Sort program
c) Sort program → Update program → Record aggregation program
d) Sort program → Record aggregation program → Update program
e) Record aggregation program → Update program → Sort program
f) Record aggregation program → Sort program → Update program

259
Afternoon Exam Section 10 Multiple-choice Questions (Software design)

Q10-12 
Read the following description concerning program design, and then answer the
Subquestions 1 through 3.

Company C offers a music download system (hereinafter called the system) where
members can download digital music.

[Description of the system]


(1) The information of each piece of music is stored in a music management file
using a music number as a key. The music number is a unique number assigned to
each music data. The record format of the music management file is shown in
Fig. 1.

Storing
Size of
Music Music Artist Playing Production location of
Genre the music
number name name time company the music
data
data
Note: An underlined part indicates a key item.
Fig. 1 The record format of the music management file

(2) The information of each member is stored in a member file using a member
number as a key. The member number is assigned uniquely to each member. The
member file stores the encrypted passwords, names, and admission dates as well
as member numbers. The record format of the member file is shown in Fig. 2.

Encrypted Admission
Member number Name
password date

Note: An underlined part indicates a key item.


Fig. 2 The record format of the member file

(3) The members must enter their member numbers and passwords to login to the
system.

260
Afternoon Exam Section 10 Multiple-choice Questions (Software design)

(4) The system searches the member file using the member number entered at (3) as
a key. It extracts the encrypted password in the record whose member number is
matched. When both the encrypted password and the entered password that is
encrypted match with each other, login is allowed, and the music search screen
opens. When they are not matched, the login refusal message is displayed, and
the process is finished.
(5) The music search screen displays the items from Music name to Genre
(hereinafter called search items) in the music management file. A member who is
logged in specifies search conditions by entering search words for one or more
search items. When multiple search conditions are specified, all the conditions
entered are joined with AND for search. When searching is unnecessary, the
member selects “Logout”.
(6) The system searches the music management file using the search words entered
in (5). It extracts all the records that match the conditions and displays the music
numbers, the music names, and the artist names on the music selection screen.
When no record matches the conditions, it displays a message on the music
search screen as a notification.
(7) As soon as the member selects one music name on the music selection screen
displayed in (6), downloading the music is started. When the member selects
“New search”, the screen returns to the music search screen.
(8) When the download is completed, the download date and time are stored in a
download result file. The system displays the download completion message and
returns to (5). The record format of the download result file is shown in Fig. 3.

Member number Download date Download time Music number

Note: Underlined parts indicate key items.


Fig. 3 The record format of the download result file

(9) The screen transition and the module structure of the system are shown in Fig. 4
and Fig. 5, respectively.

261
Afternoon Exam Section 10 Multiple-choice Questions (Software design)

Music Download System

Member No. 12345


Password **************

Login Exit

Music Download System Music Download System

Search item Search Search Music No. Music name Artist name
words condition
Information Song of information
Music name processing Includes 852596 processing i.n.f.o
Artist name i.n.f.o THE information
Equals 864295 processing i.n.f.o
Playing time You and information
959806 processing i.n.f.o
Production
company


Genre

Search Logout New search

Music search screen Music selection screen

Fig. 4 Screen transition of the system

Process

Initial Main Termination


process process process

Login process Download process Logout process

Enter member No. Search member Match Error


and password file password handling

Music selection
process Main download
process

Display music Search music Display music Download Add record to


search screen management file selection screen music download result file

Fig. 5 Module structure of the system

262
Afternoon Exam Section 10 Multiple-choice Questions (Software design)

Subquestion 1
A new function is designed to limit the number of music that a member can download in
one day up to the allowable number specified by the system. From the answer groups
below, select the correct answers to be inserted in the blanks in the following
description of the procedure for obtaining the download count on that day by a member
who logged in.

The current date is obtained from the system. Then, A of the logged in member
and the current date are used as keys to search the download result file for counting the
number of records. If the date has changed until downloading since logged in, the
download count must be obtained for the new date. Therefore, the module to obtain the
download count must be performed just before the B module.

Answer group for A:


a) Member number b) Size of the music data c) Music number
d) Download date e) Admission date f) Password

Answer group for B:


a) Search member file b) Search music management file
c) Display music search screen d) Display music selection screen
e) Download music

263
Afternoon Exam Section 10 Multiple-choice Questions (Software design)

Subquestion 2
A new function is designed to add the last download date for music that the member has
already downloaded to the items displayed on the music selection screen. From the answer
groups below, select the correct answers to be inserted in each blank in the
following description.

The music management file is searched using the search words entered by the member to
extract all the records that match the conditions. Whether the music numbers of the
extracted records are those of the music that the member has already downloaded can be
checked by searching the download result file with C . In search of download
results by the member, the number of corresponding records in the download result file is
D per one record extracted from the music management file.

Answer group for C:


a) Member number
b) Member number and Music number
c) Member number, Music number and Download date
d) Member number and Download date
e) Music number
f) Music number and Download date
g) Download date

Answer group for D:


a) 0 b) 0 or more c) 0 or 1
d) 1 e) 2 or more

264
Afternoon Exam Section 10 Multiple-choice Questions (Software design)

Subquestion 3
A new list, which displays download counts by genre for the downloads done by all
members during their first week after they have admitted, is designed in order to grasp the
download status of members just after admission. Fig. 6 shows an example of the list of
download counts by genre. Fig. 7 shows the flow for creating the list of download counts
by genre, and the table shows the description of each process. From the answer groups
below, select the correct answers to be inserted in the blanks in the table.
As shown in Fig.6, the list of download counts by genre displays the download counts
and the number of downloaded music by genre.

List of download counts by genre


2008-10-19
Genre Download count No. of music
Classical 23,456 54
Jazz 4,012 130
Pops 123,456 434
Country 34,567 120
Folk song 7,410 87
.. .. ..

Fig. 6 Example of the list of download counts by genre

E
List of
File X download
Process Process Process Process Process Process Process
1 2 3 4 5 6 7 counts by
File Y genre

Note: Each of files X and Y represents one of three files; the music management file,
member file, and download result file.
Intermediate files created during the processes are omitted.
Fig. 7 Flow for creating the list of download counts by genre

265
Afternoon Exam Section 10 Multiple-choice Questions (Software design)

Table Description of each process


Process Type Description

Match the records in files X and Y using a member number as


a key. When the key matches and the download date is within
Process 1 Matching one week after the member has admitted, extract the values
of necessary items from the records in files X and Y and
output them. Repeat this process for all members.

Read the result in Process 1. Sort it using a music number as


Process 2 Sorting
a key and output it.
Read the result in Process 2. Count the number of records
with the same music numbers. Then, output the music
Process 3 Counting
numbers and the counted number of records to an
intermediate file.
Match E and the records in the intermediate file
using a music number as a key. When the keys match,
Process 4 Matching extract the values of necessary items from the records of
E and the intermediate file and output them. Repeat
this process for all the music.
Read the result in Process 4. Sort it using F as a
Process 5 Sorting
key and otuput it.
Read the result in Process 5. Count the number of records by
genre and obtain the number of music. Obtain the download
Process 6 Counting count using the counted number of records in the output at
Process 3. Output each genre with its download count and
number of music.
Read the result in Process 6 and output the list of download
Process 7 Tabulation
counts by genre.

Answer group for E:


a) Member file b) Music management file
c) Download result file

Answer group for F:


a) Member number b) Size of the music data c) Music number
d) Genre e) Download count

266
Afternoon Exam Section 10 Multiple-choice Questions (Software design)

Q10-13 
Read the following description concerning the business system of a distribution center
(warehouse), and then answer Subquestions 1 through 3.

In Company A, goods are directly delivered to customers, in addition to the head office,
from 3 distribution centers (warehouses) spread across the country. Each distribution center
has 3 to 10 delivery staff members. Company A is facing a problem with complaints from
customers about significant delays in deliveries. As a result of organizing and analyzing the
business operations, it comes to light that in the slip-based delivery process; there are areas
that are prone to errors. Therefore, Company A decided to automate the conventional paper
based processing of slips for receiving and dispatch operations.

[Details of current operations]


(1) Consignment
Consignment refers to an actual individual package, and every consignment has
good codes indicating the type of goods. Furthermore, every consignment is
linked to a consignee and destination address by the mission-critical system
installed in the head office, and these details are printed on a delivery slip.
(2) Receipt of consignments in a warehouse
Consignments are loaded onto large trucks, and are transported to the relevant
distribution centers. At this time, delivery slips for the relevant consignments
are handed over by the driver to the delivery staff in the distribution center.
After that, the delivery staff stores the respective consignments on racks inside
the distribution center, and delivery slips are stored in the delivery slip box of
the corresponding rack number.
(3) Retrieval and dispatch of consignments
When a small truck that is delivering packages to customers arrives, a delivery
staff member picks up delivery slips for consignments in the truck’s area from
the delivery slip box. Based on the delivery slips, the relevant goods are loaded
onto the truck and the slips are handed over to the driver of the small truck.
After that, the delivery slips and consignments are delivered to the relevant
customers.

267
Afternoon Exam Section 10 Multiple-choice Questions (Software design)

[New system]
Based on an analysis of the current situation, it comes to light that a problem lies in the
manual search of delivery slips at the time of retrieval and dispatch of consignments. In
order to improve this, the decision is made to perform online management of the slips
handled by the distribution centers. The changes described below are incorporated during
the implementation of the new system.
(1) Facilities at distribution centers
A warehouse management server and handheld terminals are installed in the
distribution centers. The handheld terminals are equipped with a bar code
reader, and delivery staff can move around with these terminals by attaching
them to their belt.
(2) Receipt of consignments in warehouse
Once delivery slips are handed over by driver to the delivery staff of the
distribution center, a delivery staff member starts the process of receiving
consignments in the warehouse with handheld terminals. First, a bar code reader
reads the bar codes that are printed on slips and that indicate consignment
codes. Next, bar codes that are affixed to the storage racks and that indicate the
rack number are read. Because the coding system for codes indicating
consignment goods and the coding system for codes indicating rack number are
different, reading these codes in the incorrect sequence results in error.
Furthermore, the information concerning rack numbers where consignments are
stored is managed by the system installed at distribution centers in order to
minimize the addition of functions to the mission-critical system.
(3) Retrieval and dispatch of consignments
When a small truck delivering packages to customers arrives, the bar code
reader on the handheld terminal of the delivery staff reads the TR bar code
(indicating the truck number) carried by the truck driver. Consignments to be
loaded onto the corresponding truck are managed by the mission-critical system.
The warehouse management system creates the list of consignments using the
truck number as a key and displays this list on the handheld terminals of the
delivery staff. The decision is also made to use the mission-critical system to
manage information about which truck is to be used for loading the
consignments. After that, the delivery staff reads the bar code of consignments
to be loaded and completes the retrieval and dispatch process. Since it is
expected that multiple consignments will be loaded, bar code input is allowed
multiple times. Upon the completion of the loading process with the handheld
terminals, the bar code input of consignments to be retrieved and dispatched is
completed.

268
Afternoon Exam Section 10 Multiple-choice Questions (Software design)

Based on these system requirements, a class diagram for the new system was created
and cardinality between classes was defined.

Terminal control Warehouse management server


Bar code reader
B -Bar code reading status C -Rack
Power supply
+Start receipt process () +Receipt process()
+Power ON() +Start dispatch process() +Dispatch process()
+Power OFF() +Bar code info. input() +TR loading consignment
1 search ()
1 1
Terminal screen *
-Display strings Rack
-Rack number
+Consignment bar code input instruction -Storage consignment
display() +Receipt()
+Rack bar code input instruction display() +Dispatch()
+TR bar code input instruction display() +Storage consignment
+Consignment info. display() inquiry()
+Receiving complete display()
+Dispatch complete display()

(Legend)
Class A Class B
1 0..* Attribute
Attribute
Role Role
Operation Operation

* A rectangular box indicates a class. A line connecting two classes indicates a relation
between those classes.
* Cardinality between classes is shown above or on the left side of a direct line. In this
legend, it indicates that 1 object of class A is related to 0 or more objects of class B.
* Near each class, the role is written on the opposite side of cardinality.

Fig. 1 Class diagram

Creation of a class diagram allows the methods of the relevant class to be designed.
Therefore, based on the precondition of using the methods defined in class diagram, a
sequence diagram for the process of receiving consignments in a warehouse is prepared.

269
Afternoon Exam Section 10 Multiple-choice Questions (Software design)

Delivery staff : Bar code reader : Terminal : Warehouse : Rack : Mission-critical system
: Terminal screen
control management server

Start receipt process


Power ON
D
Bar code info. input
E
Bar code info. input
Power OFF F
G
Receiving
Receipt process
Receiving Receiving
complete Receiving complete
complete
display

Fig. 2 Sequence diagram of the receiving process

: Delivery staff : Terminal : Warehouse


: Bar code : Terminal screen : Rack : Mission-critical system
control management server

Start dispatch process


Power ON
H TR loading
consignment
Bar code info. input search
TR loading consignment search
TR loading
items list Return search results
display Response
(list of results)
Bar code info. input 1
Bar code info. input 2
Bar code info. input 3
Loading complete
Power OFF
I
J
Dispatch complete
Dispatch process
Dispatch complete
Dispatch Dispatch
complete complete
display

Fig. 3 Sequence diagram of the dispatch process

270
Afternoon Exam Section 10 Multiple-choice Questions (Software design)

Subquestion 1
From the answer group below, select the appropriate description which states the root
cause of the problem in the current operations.

Answer group:
a) The names and addresses of customers are linked in the mission-critical system.
b) Delivery slips are handed over manually by the delivery staff to the truck driver
at the time of retrieval and dispatch of consignments.
c) Delivery slips are searched for manually at the time of retrieval and dispatch of
consignments.
d) Delivery slips are handed over manually by the truck driver to the delivery staff
at the time of receipt of consignments at the warehouse.

Subquestion 2
From the answer group below, select the appropriate cardinality description to be
inserted in each blank in the class diagram of Fig. 1.

Answer group:
a) * *
b) * 1
c) 1 *
d) 1 1

271
Afternoon Exam Section 10 Multiple-choice Questions (Software design)

Subquestion 3
From the answer group below, select the appropriate terms and phrases to be inserted in
each blank in the sequence diagrams of Fig. 2 and Fig. 3.

Answer group:
a) TR loading consignment search
b) TR bar code input instruction display
c) Dispatch
d) Dispatch process
e) Rack bar code input instruction display
f) Receipt
g) Receipt process
h) Consignment bar code input instruction display

272
Afternoon Exam Section 10 Multiple Choice Questions (Management)

10.4 Multiple Choice Questions (Management)

Q10-14 
Read the following description of risk management in a project, and then answer
Subquestions 1 through 4.

Company E is a medium-sized software development company. Company E receives an


inquiry about the development of a sales management system from Company L, a company
that manufactures everyday products, and then Company L places an order. Company E
appoints Mr. O as the project manager for this system development.
The schedule for the project is as shown below:

Months
1 2 3 4 5 6 7 8 9 10
elapsed

Current point
Company L
Requirements Internal Integration
activity design test
definition
Company E
activity
External Manufacturing System
design test

Fig. 1 Schedule

273
Afternoon Exam Section 10 Multiple Choice Questions (Management)

[Creation of procedure for risk management]


In order to start this project, Mr. O develops the procedure for risk management shown
below.

Risk identification

Qualitative risk analysis


(Risk prioritization)

Quantitative risk analysis


(Risk quantification)

Risk response planning

Fig. 2 Risk management procedure for the project in Company E

(1) Risk identification


Identify risks that exist in the project.
(2) Qualitative risk analysis
For each risk that is identified, calculate a risk value with the formula below and
prioritize the risks.
Risk value = A × impact
Here, risks are divided into risks that require measures and risks (i) that require no
special measures.
(3) Quantitative risk analysis
Quantitatively evaluate and analyze identified risks that have an effect on the
overall goal of the project.
(4) Risk response planning
For risks that require action, create a response plan that specifically states what kind
of action is to be taken by when.

274
Afternoon Exam Section 10 Multiple Choice Questions (Management)

[Preconditions for the development of the sales management system]


For development of the sales management system, Mr. O sorts the preconditions for the
project and compiles these preconditions as below:
(1) For the phases after external design, Company E is to undertake work with a service
contract.
(2) Through the requirements definition performed by Company L, the data items are
already fixed and identification of the necessary screens and forms is complete.
However, the business priority of these things is not clear, and for some screens and
forms it is not yet decided if they will be included in the development scope.
(3) An estimate is complete for the scope that is currently set. Based on this estimate,
Company E and Company L will reach an agreement concerning the cost and
schedule.
(4) Company E is to outsource some activities to its partner company, Company I.

[Risk identification]
At the start of the project, Mr. O decides to identify risks, and he discovers factors that
may potentially lead to the risks below:
(1) There is a high possibility that the number of screens and forms in the development
scope will increase beyond that in the estimate.
(2) In order to perform external design and a review of it, an understanding of Company
L’s business is required. However, there is currently no one in Company E’s staff
who sufficiently understands Company L’s business. No one in the staff of Company
I sufficiently understands Company L’s business either.
(3) In order to ensure simplicity in future changes, Company L would like to use SOA
(Service Oriented Architecture). However, Company E does not have any know-how
or experience concerning SOA.
Based on this situation, Mr. O considers that if risk response is not implemented urgently
then this project will probably not succeed. Furthermore, as well as the identified risks,
there are also concerns that new risks will appear as the project progresses. As such, Mr. O
decides to consider D , a countermeasure for when a risk actually materializes.

275
Afternoon Exam Section 10 Multiple Choice Questions (Management)

Subquestion 1
From the answer group below, select the correct answer to be inserted in blank
A in the description.

Answer group:
a) Weighted average b) Mode value
c) Probability of occurrence d) Standard deviation

Subquestion 2
From the answer group below, select the correct answer corresponding to underlined
section (i).

Answer group:
a) Risk transfer b) Risk avoidance
c) Risk reduction d) Risk acceptance

Subquestion 3
Mr. O creates a plan for risk response. The table below is an excerpt from this plan.

Table Plan for risk response


Risk Risk response
After the conclusion of the -(ii) Before the conclusion of the
contract, the number of contract, negotiate to finalize
screens and forms that are the number of screens and
included in the development forms.
scope increases. -If the above is not achieved,
B
There are no members of - C
staff who sufficiently -Implement training concerning
understand the business of Company L’s business.
Company L.
No know-how or experience -(iii) Secure staff familiar with
concerning SOA. SOA.

(1) From the answer group below, select the correct answer corresponding to underlined
section (ii) in the Table.

276
Afternoon Exam Section 10 Multiple Choice Questions (Management)

Answer group:
a) Risk transfer b) Risk avoidance
c) Risk reduction d) Risk acceptance

(2) From the answer groups below, select the correct answer to be inserted in each blank
in the Table.

Answer group for B:


a) perform requirements definition again from the beginning on Company E’s own
initiative.
b) decide the specifications for screens and forms with prototyping with the
cooperation of Company L’s end users.
c) go ahead with the project within the development scope without an agreement.
d) decide the maximum number of screens and forms as well as the deadline for the
finalization of the specifications in advance. If the number of screens and forms
exceeds the maximum, create a new estimate.

Answer group for C:


a) Get support from representatives of Company L.
b) Perform external design as far as possible even though Company L’s business is not
understood.
c) If a problem with the contract occurs, ensure that an escalation to superior managers
at Company L is possible.
d) Increase the number of staff members.

(3) If the risk response in the underlined section (iii) is adopted, a problem may occur
where the cost of securing staff exceeds the assumed cost. From the answer group
below, select the correct answer that represents this.

Answer group:
a) Occurrence of secondary risks
b) Identification of unknown risks
c) Indication of the occurrence of a risk
d) Materialization of risks

277
Afternoon Exam Section 10 Multiple Choice Questions (Management)

Subquestion 4
From the answer group below, select the correct answer to be inserted in blank
D in the description.

Answer group:
a) circumvention measures b)a contingency plan
c) a business continuation plan d)a risk assessment

Q10-15 
Read the following description of system development planning, and then answer
Subquestions 1 and 2.

Company X is building a new business system. This business system requires new
hardware installation and software development. In the software development,
programs that are commonly used in multiple application programs (hereinafter
“shared components”) will be developed separately from the main application
programs by another team. Development tasks and the required number of days are
shown in the table.

Table Tasks and required number of days

Number of
Task ID Details
Days
S1 System architectural design 6
G1 Definition of shared components of application programs 2
G2 Function design of application programs 4
G3 Detailed design of application programs 6
G4 Coding and unit testing for application programs 6
C1 Design of shared components (interface determination) 6
C2 Coding and unit testing for shared components 4
H1 Hardware procurement 15
H2 Building the hardware environment 6
S2 Integration test 6
S3 Production test 4

To plan the schedule for these tasks, the arrow diagram shown in the figure is
created. The dotted line in the figure represents dummy work.

278
Afternoon Exam Section 10 Multiple Choice Questions (Management)

6
G2 G3
S1 G1 G4 S2 S3
1 2 3 7 8 9 10
C1 C2

5
H1 H2

Fig. Arrow diagram for scheduling

Subquestion 1
Following the arrow diagram for task scheduling, select two answers from the answer
group that correctly describe the relationship of dependency of tasks.

Answer group:
a) Detailed design of application programs (G3) cannot be started until coding and unit
testing for shared components (C2) is finished.
b) Coding and unit testing for application programs (G4) cannot be started until coding
and unit testing for shared components (C2) is finished.
c) Detailed design of application programs (G3) can be started when function design of
application programs (G2) is finished.
d) Coding and unit testing for shared components (C2) can be started even without real
computing environment, but coding and unit testing for application programs (G4)
cannot be started without real computing environment.
e) Hardware procurement (H1) is conducted after system architectural design (S1) is
finished.

Subquestion 2
From the answer groups below, select the correct answers to insert in the blanks
in the following description.

In this business system development, the critical path is A , and the least number
of days required is B . Additionally, the overall development period can be
shortened by shortening C .

279
Afternoon Exam Section 10 Multiple Choice Questions (Management)

Answer group for A:


a) (1) → (2) → (3) → (5) → (6) → (7) → (8) → (9) → (10)
b) (1) → (2) → (3) → (5) → (7) → (8) → (9) → (10)
c) (1) → (2) → (3) → (6) → (7) → (8) → (9) → (10)
d) (1) → (2) → (4) → (9) → (10)

Answer group for B:


a) 31 b) 32 c) 33
d) 34 e) 35 f) 36

Answer group for C:


a) Design of shared components (C1)
b) Coding and unit testing for shared components (C2)
c) Function design of application programs (G2)
d) Hardware procurement (H1)

280
Afternoon Exam Section 10 Multiple Choice Questions (Management)

Q10-16 
Read the following description concerning fault management in a project, and then
answer Subquestions 1 and 2.

Company A, a consumer credit company, performs data entry for membership


applications with an internal data entry staff of 100. To each member of the data entry staff,
one PC for data entry is assigned. Each PC for data entry is connected to a business server
via an internal LAN. If the business server stops, the PCs for data entry cannot be used.
The system configuration of the data entry system is shown in the figure.

Business
server

PC for ・・・・・・ PC for


data entry 100 data entry

Fig. System configuration diagram

Recently, a backlog of data entry due to hardware faults is causing problems. As such,
Company A’s operation manager, Mr. T, decides to review the data entry system.

[Investigation into the situation of fault occurrences]


Mr. T decides to evaluate the hardware fault situation in the data entry system. As a
reference for the evaluation, Mr. T converts the stoppage time of data entry into a lost cash
amount. Based on previous records, it is understood that if work on one PC for data entry
stops for one hour then the lost cash amount is 10,000 yen. Based on the results of last year,
the amount of stoppage time and lost cash amount that can be assumed over the course of a
year is compiled in Table 1.

Table 1 Amount of stoppage time and lost cash amount that can be assumed over the
course of a year
Stoppage Extended
Number of Lost cash
Hardware time (hours) stoppage time
failures amount
device for (hours) for PCs
(times/year) (k yen)
one fault for data entry
PC for data
10 10 100 1,000
entry
Business server 2 4 A B

281
Afternoon Exam Section 10 Multiple Choice Questions (Management)

[Proposals for countermeasures and evaluation of proposals]


As failure measures, Mr. T investigates the following two proposals for countermeasures.

Table 2 Proposals for countermeasures


Name of proposal for Details of countermeasure
countermeasure
Proposal A (countermeasures Install spare PCs for data entry at a ratio of 1 for
for PCs for data entry) every 20 PCs. With this countermeasure, stoppage
time will be eliminated. The cost of the
countermeasure is 20,000 yen per month for each
spare PC. A switch to a spare PC will be performed
by moving to different seat, but the cost of this can
be ignored here because this takes only a relatively
short period of time.
Proposal B (countermeasures Purchase one spare business server and create a
for the business server) redundant configuration. If a failure occurs with the
business server, processing is continued on the spare
business server. However, the switch to the spare
business server will take 1 hour and during that time
business will be stopped. For this countermeasure, a
cost of 2,000,000 yen is required annually.

Next, Mr. T compiles the lost cash amount that can be avoided with the two proposals
and the cost of countermeasures in Table 3.

Table 3 Lost cash amount that can be avoided and the cost of countermeasures
Avoidable
Avoidable lost Annual cost of
Proposal for extended stoppage
cash amount countermeasures
countermeasure time (hours) for
(k yen) (k yen)
PCs for data entry
Proposal A 100 1,000 C
Proposal B D E 2,000

282
Afternoon Exam Section 10 Multiple Choice Questions (Management)

Subquestion 1
From the answer group below, select the correct answer to be inserted in each blank
in the description below concerning the amount of stoppage time and lost cash
amount that can be assumed over the course of a year shown in Table 1. Here, the answers
for blanks A and B in the description below are also inserted into the
same blanks in Table 1.

Based on the number of failures of PCs for data entry and the stoppage time for each
failure, the total stoppage time is 100 hours. Because the lost cash amount if a PC for data
entry stops for 1 hour is 10,000 yen, the lost cash amount is 1,000,000 yen.
However, if the business server stops, none of the PCs for data entry can be used, so for
the business server the total stoppage time for data entry is A hours, and the lost
cash amount is B k yen.

Answer group for A and B :


a) 8 b) 10 c) 80 d) 100
e) 800 f) 1,000 g) 8,000 h) 10,000
i) 80,000

Subquestion 2
From the answer groups below, select the correct answer to be inserted in each blank
in the description below about the proposals for countermeasures shown in
Table 2. Here, blanks C through E in the description below are inserted
into the same blanks in Table 3.

In consideration of proposal A, based on Table 1, the avoidable total stoppage time is 100
hours, and the avoidable lost cash amount is 1,000k yen. However, the annual cost of
countermeasures is C k yen.
In consideration of proposal B, the time for the switch to the spare server is 1 hour, and in
that time business is stopped, so in Table 1, the stoppage time for each failure of the
business server changes from 4 hours to 1 hour. Thus, the avoidable total stoppage time
for PCs for data entry is D hours, and the avoidable lost cash amount is
E k yen.
The cash amount after the deduction of the cost of countermeasures from the avoidable
lost cash amount is considered to be the effect of the countermeasures. If the proposal that
has a positive effect of countermeasures is chosen then the answer is F . As such,
the activity to find and eliminate the root cause of the failure applies to G of ITIL
service support.

283
Afternoon Exam Section 10 Multiple Choice Questions (Management)

Answer group for C:


a) 20 b) 100 c) 200 d) 240
e) 1,000 f) 1,200 g) 2,000 h) 2,400

Answer group for D:


a) 3 b) 6 c) 100 d) 200
e) 300 f) 600

Answer group for E:


a) 1,000 b) 2,000 c) 3,000 d) 6,000
e) 8,000

Answer group for F:


a) proposal A
b) both proposal A and proposal B
c) neither proposal A nor proposal B
d) proposal B

Answer group for G:


a) incident management b) configuration management
c) change management d) problem management
e) release management

284
Afternoon Exam Section 10 Multiple Choice Questions (Management)

Q10-17 
Read the following description concerning incident and problem management, and then
answer the Subquestion.

In Company F engaged in logistics business, the systems department operates the order
reception system. This system is used by Company F and its affiliate companies.
One day, the order reception system becomes unavailable from morning. When an
employee of an affiliate company who has learned of this incident asks the contact person
of Company F, it is found that an application fault has occurred in the order reception
system and that the affiliate company has not been notified of it.
After the recovery of the service, the systems department investigates the cause of this
notification mistake and finds that the list of contacts in case of a fault is old and does not
include the affiliate company. The systems department recognizes that the incident and
problem management processes are not always functioned successfully. Therefore, the
systems department decides to review whole processes with the cooperation of the auditor
from the risk management department.
The auditor summarizes the findings identified in the review and the recommendations
on those findings, as shown in Table 1, and submits a report to the manager of the systems
department.
Company F controls the faults from the occurrence of an incident to the analysis and
resolution of problems by using a fault management database (hereinafter the DB). The
items of the DB are as follows:
(1) Fault control number (sequential number)
(2) Fault occurrence date and time
(3) System name
(4) Component name
(5) Status of the fault (description)
(6) Resolution method (description)
(7) Name of the person in charge of resolution
(8) Resolution date and time

285
Afternoon Exam Section 10 Multiple Choice Questions (Management)

Table 1 Findings identified in the review and the recommendations on those


findings

No. Finding Recommendation


1 The process of notification to the Review the processes and operations
related departments in case of a with regard to the notification and
fault does not function effectively. follow-up in case of a fault.
2 The DB has many records whose Establish a confirmation process of
resolution date and time fields are the problem resolution.
blank; a blank resolution date and
time field indicates that the
incident process was completed but
the problem has not been resolved.
3 The current items of the DB are Review the items of the DB and add
insufficient, and the DB is not fully lacking items. Also, ensure that the
utilized. DB is fully utilized.


While there are many findings, the systems department decides to immediately make
improvements on the findings of Nos. 1 through 3 that are considered important.

286
Afternoon Exam Section 10 Multiple Choice Questions (Management)

Subquestion
From the answer groups below, select the correct answer to be inserted in each blank
in the following description.

(1) As for the notification and follow-up processes, the systems department decides
to make improvements as mentioned in Table 2.

Table 2 Improvements on the notification and follow-up processes

No. Recommendation Improvement (outline)


1 Review the processes and The person in charge of the operation decides on
operations with regard to A .
the notification and - Level 3 or higher:The board members and affiliate
follow-up in case of a companies are notified, and the current service
fault. status is posted for users on the internal Web site.
(At the time of occurrence and every hour after that)
- Level 2:The manager of the systems department decides
which party is to be notified. (At the time of
occurrence and as needed after that)
- Level 1:Notification is not given to any party outside the
systems department.

Two items are added to the DB. First, the item A is created. This is
the item to be determined first at the time of a fault, and the levels for this item
are defined in advance. If a fault occurs, notification corresponding to the level
is given. Also, the item B is created, and information about the
recovery action and recovery status, which were formerly recorded on a
whiteboard at the time of a critical fault, is recorded in the DB so that the current
status can be shared by the staff of the systems department.
(2) As for the problems whose resolution date and time fields are blank, the systems
department decides to make improvements as mentioned in Table 3.

287
Afternoon Exam Section 10 Multiple Choice Questions (Management)

Table 3 Improvements on the problems whose resolution date and time fields are
blank

No. Recommendation Improvement (outline)


2 Establish a confirmation (i) The problem management committee
process of the problem checks weekly whether the problems to be
resolution. resolved in that week have been resolved.
(ii) The closure of the problems remaining
unresolved for a long time is reviewed once
a month.

As a result of an investigation into problems whose resolution date and time


fields are blank, it is found that some of them are not resolved yet, but on the
other hand, the rest of them have actually been resolved but their resolution dates
and times are simply not registered. Therefore, the item C is created in
the DB, and the problem management committee follows up on the status of
problem resolution on a weekly basis by using this item as a criterion. The
problem management committee, consists of the technical staff, reports its
decisions to the manager of the systems department after the meeting.
As for those problems that remain unresolved for a long time, such as D ,
the problem management committee decides whether to close the problems on a
monthly basis.
Also, the following is found to be the reason for failing to register their resolution
dates and times. Once the resolution process is determined for a problem, the
task of problem resolution is separated from problem management and performed
as the process of E . This makes the staff forget to update the resolution
date and time in the DB inadvertently. Therefore, the procedure for the task of
problem resolution is changed so that the corresponding fault control number is
passed to E to link both management controls.
(3) As for the items and usability of the DB, the systems department decides to make
improvements as mentioned in Table 4.

288
Afternoon Exam Section 10 Multiple Choice Questions (Management)

Table 4 Improvements on the items and usability of the DB

No. Recommendation Improvement (outline)


3 Review the items of the (i) This time, only those items needed for the
DB and add lacking improvements of Nos. 1 and 2 are added.
items. Also, ensure that (ii) The display order of the DB is changed for
the DB is fully utilized. the system administrator.

Among the lacking items, only those items needed for the improvements of Nos. 1 and 2
are added this time.
Next, since the DB data is currently displayed in the descending order of fault control
numbers, it is difficult to identify critical problems. Therefore, the display order,
considering those added items this time, is reviewed, and a function is added that
displays the problems whose F field is blank in the descending order of
A so that unresolved problems are displayed in order of importance.

Answer group for A through C, and F:


a) Resolution date and time
b) Details of resolution process (descriptive type)
c) Planned resolution date and time
d) Details of recovery action (append type)
e) Impact of the fault
f) Fault occurrence date and time

Answer group for D:


a) problems whose cause cannot be identified and which have not recurred
b) problems that cannot be resolved because there are not sufficiently skilled staff
in the systems department
c) problems that do not greatly impact on business operations even if they are left
unresolved
d) problems for which the system cannot be changed because of an insufficient
budget

Answer group for E:


a) Capacity management b) Configuration management
c) Service level management d) Change management

289
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)

10.5 Multiple-choice Questions (Strategy)

Q10-18 
Read the following description concerning sales analysis, and then answer Subquestions
1 through 3.

On the casual fashion floor (hereinafter called the floor) of Department Store A, the
layout of shops for each brand is changed every 3 years. At the end of March last year, the
layout of the floor was changed. However, there were no new brands that opened a shop
and no existing brands closed a shop at that time.
All brands prefer to be located in shops near escalators where many people pass by
(hereinafter called preferred shops). The criteria for allocation of a preferred shop are that
sales revenue must grow for a certain period and sales revenue for 1-year period must
exceed the average sales of the floor. On the other hand, the criteria for allocation of shops
in the interior area where fewer people pass by (hereinafter called non-preferred shops) are
that sales revenue declines for a certain period and the average sales revenue for 1 year is
below the average sales revenue of the floor. In the case that none of these criteria are
satisfied, shops are not relocated. However, even when the criteria for relocation are
satisfied, a shop is sometimes not actually relocated.
In order to understand the effect of the relocation performed in March last year, the
Department Store A decides to analyze the sales revenue of each brand. Fig. 1 shows a
comparison graph of sales revenue for the 1 year before and after the relocation for each
brand. Table 1 shows the meaning of symbols used in Fig. 1.

Table 1 Meaning of symbols used in Fig. 1

Whether satisfied the criteria for relocation in previous year, and


Symbol
whether actually relocated or not
Brands that satisfied the criteria for relocation to preferred shops,

and they were actually relocated
Brands that satisfied the criteria for relocation to preferred shops,

however, they were not actually relocated
Brands that satisfied the criteria for relocation to non-preferred

shops, and they were actually relocated
Brands that satisfied the criteria for relocation to non-preferred

shops, however, they were not actually relocated
 Brands that didn’t satisfy the criteria for relocation

290
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)

Sales revenue for 1-year period


after relocation (10k Dollars)
α γ
160

150
Brand X
β
140
Brand Y
130 Brand I
Brand II
120 Brand III

Brand IV
0 120 130 140 150 160
Sales revenue for 1-year period
before relocation (10k Dollars)
Note: Auxiliary lines α and β in the figure indicate average sales revenue for the 1 year
before and after the relocation respectively.
Auxiliary line γ indicates the case where sales revenue is same before and after the
relocation.
Fig. 1 Comparison of sales revenue for the 1 year before and after the relocation for
the respective brands

291
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)

Subquestion 1
From the answer groups below, select the correct answer to be inserted in each blank
in the following description about Fig. 1.

A comparison of the sales revenue of the entire floor for the 1 year before and after
the relocation shows that sales revenue for the 1-year period after the relocation has
grew. Furthermore, a comparison of the number of brands that experienced an increase
in sales revenue after the shuffle relocation and the number of brands that experience a
decline in sales revenue shows that A .
Of the brands that satisfied the criteria for relocation to preferred shops, a
comparison of the brands that were actually relocated and the brands that were not
relocated with regard to the sales revenue of each brand for the 1-year period before
and after the relocation shows that B . Of the brands that were relocated to
preferred shops, Brand X C .
Out of all brands that met satisfied the conditions criteria of for reshuffling
relocation to non-preferred shops, with regard to sales revenue for the 1-year
period before and after the relocation, the number of brands experiencing
growth in sales revenue was D . It can be inferred that the decline in
sales revenue stopped for these brands. Of all brands that were relocated to
non-preferred shops, Brand Y E .

Answer group for A:


a) there are more brands that experienced a decline in sales revenue
b) there are more brands that experienced an increase in sales revenue
c) both are same

Answer group for B:


a) most of brands that were relocated experienced an increase in sales revenue
b) sales revenue didn’t change even if relocated
c) most of brands that were not relocated experienced an increase in sales revenue

292
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)

Answer group for C:


a) experienced the highest increase in sales revenue after relocation
b) has the lowest sales revenue for the 1-year period before and after the relocation
c) has the highest sales revenue for the 1-year period before the relocation
d) was the only brand whose sales revenue fell below the average sales revenue of the
floor after the relocation
e) was the only brand whose sales revenue fell below the sales revenue before the
relocation

Answer group for D:


a) 0 b) 1 c) 2 d) 3
e) 4 f) 5 g) 6 h) 7

Answer group for E:


a) recorded the highest sales revenue in the 1-year period after relocation
b) recorded the lowest sales revenue in the 1-year period after relocation
c) has a higher sales revenue than that before the relocation, and it exceeded the
average sales revenue of the floor after the relocation
d) experienced a decline in sales revenue after the relocation like other brands did
e) was the only brand with a higher sales revenue than that before the relocation

293
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)

Subquestion 2
From the answer groups below, select the correct answer to be inserted into each
blank in the following description about changes in sales revenue for the
1-year period before and after the relocation for Brand X.

In order to analyze the sales revenue of Brand X in detail, a graph indicating the
trend of monthly sales revenue and the number of customers who make a purchase
at the Brand X shop is created as shown in Fig. 2.

Monthly sales revenue before relocation


Monthly sales revenue after relocation
No. of customers who make a purchase before relocation
No. of customers who make a purchase after relocation

20
Sales revenue (10k Dollars)

No. of customers (Persons)


1000
900
10 800
700
600
500
400
0 0
4 5 6 7 8 9 10 11 12 1 2 3
Sales month

Fig. 2 Trend of monthly sales revenue and the number of customers who make a
purchase at Brand X

Based on the sales revenue and the number of customers who make a purchase
shown in Fig. 2, the monthly average purchase amount per customer (hereinafter
called average customer spending) for the 1-year period before and after the
relocation is compared and summarized as shown in Table 2.

294
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)

Table 2 Comparison of monthly average purchase amount per customer for the
1-year period before and after the relocation

Month 4 5 6 7 8 9 10 11 12 1 2 3 Annual
Comparison results ↓ ↓ F ↓

Note: The shaded part is not shown.


The increase in average customer spending after relocation is shown with a ↑, while
a decline is shown with a ↓.

The three reasons below are possible reasons why sales revenue for the 1 year
after the relocation is lower than that before the relocation.
(1) Average customer spending is higher than that before the relocation, however,
the number of customers who make a purchase is lower than that before the
relocation.
(2) The number of customers who make a purchase is higher than that before the
relocation, however, the average customer spending is lower than that before
the relocation.
(3) The number of customers who make a purchase and the average customer
spending are lower than their respective values before the relocation.

One of the possible reasons for change in sales revenue for the 1-year period before
and after the relocation for Brand X is G . However, on a monthly basis,
there are months where sales revenue after the relocation is higher than the sales
revenue before the relocation. For these months, the number of customers who make
a purchase has significantly increased over the number of customers who make a
purchase before the relocation.

Answer group for F:


a) b) c) d)
↑ ↑ ↑ ↓ ↓ ↑ ↓ ↓

Answer group for G:


a) (1) b) (2) c) (3)

295
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)

Subquestion 3
From the answer groups below, select the correct answer to be inserted into each
blank in the following description about brands that were relocated to
non-preferred shops.

In order to compare the sales revenue of Brand Y in Fig. 1, and Brands I through
IV that were relocated to non-preferred shops, a graph comparing the average
customer spending for each brand in the 1-year period before and after the
relocation was created as shown in Fig. 3.

Average customer spending for the 1-year period


before relocation
20 Average customer spending for the 1-year period
Average customer spend

after relocation
(10 Dollars)

15

11
Brand I Brand II Brand III Brand IV Brand Y

Fig. 3 Comparison of average customer spending for each brand in the 1-year period
before and after the relocation

Next, Table 3 shows the average number of articles purchased by one customer
who makes a purchase for each of the brands considered in Fig. 3, and the average
number of customers who make a purchase per month.

296
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)

Table 3 Average number of articles purchased by one customer who makes a


purchase and the average number of customers who make a purchase per month

Brand I Brand II Brand III Brand IV Brand Y


Average number of
articles purchased
1.3 2.1 1.3 1.1 1.2
per person (number
The 1-year of clothes)
period before Average number of
the relocation customers who
make a purchase 841 522 701 820 700
(Persons/month)

Average number of
articles purchased
1.3 1.8 1.4 1.2 1.8
per person (number
The 1-year
of clothes)
period after
Average number of
the relocation
customers who
800 481 662 788 640
make a purchase
(Persons/month)

In Table 3, although the average number of customers who make a purchase


per month is lower for each brand, for Brand I, Brand II, Brand III, and Brand Y,
H is higher. This is most likely because these brands were not relocated
to non-preferred shops, and therefore instead of trying to increase the number of
customers who make a purchase compared to before the relocation, these brands
changed their sales approach so that the purchase amount for each customer
increases.
From Fig. 3 and Table 3, it is clear that in the case of Brand I , growth in
the number of articles purchased by customers contributed to the sales revenue.

297
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)

Brand Y’s sales revenue for the 1-year period after the relocation was almost the
same as Brand J ; however, the average number of articles purchased per
customer who makes a purchase was higher. Furthermore, the sales revenue of
Brand J for the 1-year period after the relocation was K in
comparison to the sales revenue before the relocation. The unit price of articles sold
in the case of Brand Y L the unit price of articles sold for Brand J .
However, as the average number of articles purchased per customer who makes a
purchase significantly exceeds that before the relocation, the sales revenue of Brand
Y for the 1-year period after the relocation increased.

Answer group for H:


a) sales revenue
b) the number of sales
c) average customer spending
d) the number of customers who make a purchase

Answer group for I and J:


a) I b) II c) III
d) IV e) Y

Answer group for K and L


a) exceeds b) is the same as c) is below

298
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)

Q10-19 
Read the following description about sorting customer information, and then answer
Subquestions 1 through 3.

Company F has three corporate sales management systems, named α, β and γ, which
were developed for each department. As each of these systems manages customer
information and sales information independently, it is not possible to refer to all the sales
information for a given customer at the same time. Therefore, Mr. G of the Sales Planning
Department decides to collect the sales information by extracting customer information
from each sales management system, and then consolidate the information for each
customer. In the process of sorting the customer information, Mr. G decides to use a tool
that consolidates the information for a given customer that is stored in multiple sales
management systems into a single location (hereinafter called the reference tool). Table 1
shows functions of the reference tool, and a brief outline of the functions.

Table 1 Functions of the reference tools and a brief outline of the functions

Function Outline
Unifies the way company names and addresses are noted so that
Cleaning
customer information can be easily compared and evaluated.
Compares the fields of customer information, quantifies the results
as a score, generates a score list, and creates a correspondence table
that manages linking to the customer code. The fields to be
compared, the score to be assigned if the compared fields match, and
Threshold I and II described below are predefined (Threshold I >
Threshold II).
(1)Threshold value I: Total value of scores when the customer is
automatically determined to be the same.
Matching (2)Threshold value II: Total value of scores when the customer is
manually determined to be the same.
Customer information where the total value of the scores is equal
to or greater than Threshold I is automatically registered in the
correspondence table as the same customer. For customer
information where the total value of the scores is equal to or greater
than Threshold II but less than Threshold I, if it is found to be the
same customer after a manual decision, it is registered as the same
customer in the correspondence table.

299
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)

By using the cleaning and the matching function of the reference tool in sequence, Mr. G
sorts the customer information of each sales management system and calculates the sales
revenue for March.

Subquestion 1
From the answer groups below, select the correct answer to be inserted in each
blank in the following description about cleaning of information.

The cleaning of company names and addresses is performed as follows:

[Cleaning]
(1) Unification of the notation of company names
Delete the notation of corporate status such as “Company”, “Co. Ltd.”, and
“LLC”.
(2) Unification of the notation of addresses
Change the “street number”, “of”, and “block number” that show the address
after the street number to “-“, and change all doubly-byte numbers to
single-byte numbers. Delete spaces.
Table 3 shows the results of cleaning the customer information provided in
Table 2.

Table 2 Customer information


Company Address
Japan ABCD Co. Ltd. Tokyo Minato-ku Higashi Shimbashi 5-47-8
Company Japan ABCD Tokyo Minato-ku Higashi Shimbashi 5-47-8
Company abcd Chiba Inzai-shi Oguradai 5-chome 3-2
IPA Co. Ltd. Tokyo Shinagawa-ku Shimoosaki 3 chome 2-3
(Co. Ltd.) IPA Tokyo Shingawa-ku Shimoosaki 3-2-3
IPA LLC Tokyo Shinagawa-ku Shimoosaki 3-chome Block no. 2 5
LLC HAMAYA Saitama Ageo-shi Komon 2-chome Block no. 3 6
HAMAYA Saitama Ageo-shi Komon 2-3-6
HAMAYA Co. Ltd. Saitama Ageo-shi Kaminakajima 5-chome No. 3 6
Senbei (Co. Ltd.) Niigata Kashiwazaki-shi Nishiyasuda 3-chome 2-3
Company Senbei Niigata Kashiwazaki-shi Nishiyasuda 3-2-4
Senbei Co. Ltd. Niigata Kashiwazaki-shi Nishiyasuda 3-chome Block no. 2
3
SENBEI Co. Ltd. Tokyo Taito-ku Kamiasakusa 2-chome 3-4

300
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)

Table 3 Results of cleaning the customer information in Table 2


Company Address
A Tokyo, Minato-ku, Higashi Shimbashi 5-47-8
Japan ABCD Tokyo, Minato-ku, Higashi Shimbashi 5-47-8
abcd B
IPA Tokyo, Shinagawa-ku, Shimoosaki 3-2-3
IPA Tokyo, Shinagawa-ku, Shimoosaki 3-2-3
IPA Tokyo, Shinagawa-ku, Shimoosaki 3-2-5
HAMAYA Saitama, Ageo-shi, Komon 2-3-6
HAMAYA Saitama, Ageo-shi, Komon 2-3-6
HAMAYA Saitama, Ageo-shi, Kaminakajima 5-3-6
Senbei Niigata, Kashiwazaki-shi, Nishiyasuda 3-2-3
Senbei Niigata, Kashiwazaki-shi, Nishiyasuda 3-2-4
Senbei Niigata, Kashiwazaki-shi, Nishiyasuda 3-2-3
SENBEI Tokyo, Taito-ku, Asakusa 2-3-4

As a result of cleaning, if records with an identical company name and address are
considered as the same customer, there are C records of customer information
in Table 2.

Answer group for A:


a) (Co. Ltd.) Japan ABCD
b) Company Japan ABCD
c) Japan ABCD
d) Japan abcd
e) Japan abcd Co. Ltd.

Answer group for B:


a) Inzai-shi, Oguradai 5-3-2
b) Chiba, Inzai-shi, Oguradai 5-3-2
c) Chiba, Inzai-shi, Oguradai 5-Chome No. 3, 2

Answer group for C:


a) 4 b) 5 c) 6
d) 7 e) 8 f) 9
g) 10 h) 11 i) 12

301
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)

Subquestion 2
From the answer groups below, select the correct answer to be inserted in each
blank in the following description about the comparison of fields of
customer information in matching, and the generation of a score list.

This time, after the cleaning of the records, a combination of customers with
identical company names, addresses, and telephone numbers is automatically
considered to be the same customer. Records with matching company names and
either a matching address or telephone number are treated as the records where a
manual decision is required.
If 50 points is the score assigned when company names match, 25 points is the
score assigned when addresses match, and 25 points is the score assigned when
telephone numbers match, Threshold II can be set to D points.
Table 4 shows the cleaned customer information after the telephone number and
sales revenue of March are added, and Table 5 shows the score list obtained by
performing matching based on Table 4.
In addition to the combination of a data number for customer information and a
total value of the scores, the score list also contains a rating column where “O” is
printed if the total value of the scores is equal to or greater than Threshold I, “∆” is
printed if the total value of the scores is equal to or greater than Threshold II but less
than Threshold I, and “×” is printed if the total value of the scores is less than
Threshold II. Customer information records with matching company names are
compared in sequence, and when there are no matching company names, “-” is
printed in the comparison data number, score, and rating in the score list.

302
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)

Table 4 Cleaned customer information after adding telephone number and sales
revenue of March

Data Customer Company Telephone March sales


System Address
number code name number (10k Dollars)
1 α 1111 IPA Tokyo, 03-3080-2222 2
Shinagawa-ku,
Shimoosaki 3-2-3
2 β CD2311 IPA Tokyo, 03-3080-2222 3
Shinagawa-ku,
Shimoosaki 3-2-3
3 γ G-1123 IPA Tokyo, 03-3080-4444 5
Shinagawa-ku,
Shimoosaki 3-2-3
4 α 1256 HAMAY Saitama, Ageo-shi, 048-455-2222 4
A Komon 2-3-6
5 β ER3256 HAMAY Saitama, Ageo-shi, 048-455-3333 8
A Komon 2-3-6
6 γ H-3321 HAMAY Saitama, Ageo-shi, 048-245-4444 2
A Kaminakajima
5-3-6
7 α 3233 Senbei Niigata, 0257-40-2222 4
Kashiwazaki-shi,
Nishiyasuda 3-2-3
8 β GH1324 Senbei Niigata, 0257-40-2222 3
Kashiwazaki-shi,
Nishiyasuda 3-2-4
9 γ J-4231 Senbei Niigata, 0257-40-2222 5
Kashiwazaki-shi,
Nishiyasuda 3-2-3
10 γ I-2234 SENBEI Tokyo, Taito-ku, 03-6815-0232 7
Kamiasakusa
2-3-4

303
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)

Table 5 Score list of matching results based on Table 4


Comparison
Original data number Score Rating
data number
1 2 100 ○
1 3 50
2 3 50
4 5 E
4 6 50
F
7 8 75
7 9 100
8 9 75
10 – – –
Note:The shaded parts are not shown.

Answer group for D:


a) 25 b) 50 c) 75 d) 100

Answer group for E:


a) 0 × b) 25 × c) 50 × d) 50 ∆
e) 75 × f) 75 ∆ g) 75 ○ h) 10 ○

Answer group for F:


a) 4 7 b) 4 8 c) 5 - d) 5 6
e) 5 7 f) 6 7 g) 6 8

304
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)

Subquestion 3
From the answer group below, select the correct answer to be inserted in each
blank in the following description about sorting the referenced customer
information.

Based on the score list generated through matching, it is decided to assign a new
customer code (hereinafter called new customer code), and calculate the sales
revenue for March for every new customer code.
Records with “∆” in the rating column of the score list are considered to be the
same customer, and new customer codes starting from M00001 are assigned in the
sequence in Table 5. Table 6 shows the correspondence table generated as a result of
this process. Customer codes corresponding to the new customer code M00003 in
the respective systems and total sales revenue for March are G , and for
M00005 it is H .

Table 6 Correspondence table of new customer codes

Customer Customer Customer


New customer Calculated sales revenue of
code in code in code in
code March (10k Dollars)
System α System β System γ
M00001 1111 CD2311 5
M00002 G-1123 5
M00003
M00004
M00005
M00006
Note:The shaded parts are not shown.

Answer group:
a) 1256 of α, and 40k Dollars
b) 1256 of α, ER3256 of β, and 120k Dollars
c) 1256 of α, ER3256 of β, and H-3321 of γ, and 140k Dollars
d) 3233 of α, and 40k Dollars
e) 3233 of α, GH1324 of β, and 70k Dollars
f) 3233 of α, GH1324 of β, J-4231 of γ, and 120k Dollars
g) H-3321 of γ, and 20k Dollars
h) I-2234 of γ, and 70k Dollars

305
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)

Q10-20 
Read the following description concerning product portfolio management analysis, and
then answer Subquestions 1 through 3.

Product portfolio management analysis (hereinafter called PPM analysis) is a technique


for analyzing the competitiveness of products in the market, and it is used for evaluating
how much investment should be made in which product. In PPM analysis, the market
growth rate (it is an indicator of the extent of overall market growth by product) and the
percentage of market share (it is an indicator of relative strength in the market against
competition) make the position of the respective product in the market clear, and analysis is
conducted to determine what kind of investment allocation will maximize the sales revenue
and profits under various risks.

[Portfolio chart]
In PPM analysis, analysis is conducted by creating a portfolio chart. In a portfolio chart,
market growth rate is plotted on the vertical axis, and the percentage of market share is
plotted on the horizontal axis. The positioning of a product is categorized into the 4 areas
shown in the following figure.

High

C A

Market growth rate

D B

Low High
Market

Fig. Portfolio chart

Product 1: A are the products having with a high market growth rate and a high
percentage of market share. These products play fulfill the role of leading the overall
market overall, and they can be expected to become a source of profits in the medium to
long term.

306
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)

Product 2: B are the products with a low market growth rate but a high
percentage of market share. These products have large sales revenue and are in a
stable phase. Although they are not a target for aggressive investment, because they
form the core of a company’s income, it is appropriate that profits earned through
these products are invested in A or C .
Product 3: C are the products having with a high market growth rate but a low
percentage of market share. In many cases, these products are just launched very
recently new on the market. Due to future growth expectations, growth is accelerated by
making large investments. They are potential candidates for A ; however, when
the percentage of market share cannot be secured, they may end up becoming
D .
Product 4: D are the products with a low market growth rate as well as a low
percentage of market share. Due to poor competitiveness in the market and poor
attractiveness of the product itself, it is necessary to consider pulling out from of the
market.

[Case study of analysis conducted at Company M]


Company M has 3 product groups, namely product group X, product group Y, and
product group Z. Table 1 shows the last year’s market size, current year’s market size,
current year market share, current year’s manufacturing cost percentage, and current year’s
customer satisfaction.

Table 1 Status of Company M’s product groups

Current Current Current year’s Current year’s


Last year’s
year’s year’s manufacturing customer
market size
market size market share cost percentage satisfaction
Product 12,000M 10,800M
61% 38% 3.3 points
group X Dollars Dollars
Product 200M 900M
6% 27% 4.1 points
group Y Dollars Dollars
Product 7,500M 4,000M
8% 56% 3.7 points
group Z Dollars Dollars

The current status of the product groups of Company M is analyzed and applied to the
portfolio chart. The boundary value for determining whether the market growth rate is high
or low is taken as “0%”, and the boundary value for determining whether the percentage of
market share is high or low is taken as “50%”.

307
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)

Calculation of the market growth rate and the percentage of market share for each
product group of Company M gives the results shown in Table 2.

Table 2 Positioning of Company M’s product groups

Market growth rate Market share


Product group X E % 61%
Product group Y F % 6%
Product group Z −47% 8%

From Table 2, it is clear that product group X corresponds to category G in


the portfolio chart, product group Y corresponds to category H , while product
group Z corresponds to category I .

[Issues with Company M’s products]


Company M is investing most of its current profits in product group X. PPM analysis
shows that securing future sources of profits is a major challenge faced by Company M.
However, Company M has no plans to develop a new product group as of now. As such,
Company M’s management plans to review their investments in the current product groups
so that they can secure the future profit sources.

Subquestion 1
From the answer group below, select the correct answer to be inserted into each blank
A through D in the figure.

Answer group for A through D:


a) Competing products b) Harvest products (cash cows)
c) Star products d) Maintenance products
e) Dog products f) Problem child products

308
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)

Subquestion 2
Answer (1) and (2) below about the portfolio chart.
(1) From the answer group below, select the appropriate value to be inserted into
each blank E and F in Table 2.

Answer group for E and F:


a) −450 b) −350 c) −20 d) −10
e) +10 f) +20 g) +350 h) +450

(2) From the answer group below, select the appropriate category to be inserted into
each blank G through I in the description.

Answer group for G through I:


a) Product 1 b) Product 2 c) Product 3 d) Product 4

Subquestion 3
From the answer group below, select the appropriate reason for arriving at the underlined
conclusion concerning the outcome of Company M’s PPM analysis.

Answer group:
a) Because there is no product that corresponds to Product 1, a medium-to-long term
profit source is absent.
b) Because no product corresponds to Product 2, there is no product in which
aggressive investments should be made.
c) Because all products correspond to Product 3, large investments are required.
d) Because all products correspond to Product 4, it is necessary to considering pulling
out from the market.

309
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)

Q10-21 
Read the following description concerning a Balance Score Card, and then answer
Subquestions 1 and 2.

[Description of Company A]
Company A is a specialized trading company engaged in the field of electrical materials.
Company A sources materials from chemical manufactures, and supplies them to electronics
manufacturers. Recently, an increasing number of manufacturers are shifting their
manufacturing bases to China and South East Asia in order to reduce labor cost. Company
A also has offices in twelve locations throughout Asia. Meanwhile, in Japan, Company A is
engaged in trading activities centering on large electronics manufacturers that manufacture
high value-added electronic components such as liquid crystals and clocks.
Generally, in order to survive business competition, specialized trading companies must
deliver added value to their customers who are electronics manufacturers, and their
suppliers who are chemical manufacturers so that it is better to go through trading company.
As such, Company A concludes that the following management policies are important.
 It is necessary to provide real-time information about appropriate materials to
customers in Japan who are electronics manufacturers. For example, providing an
appropriate response to queries such as “which is the best chemical manufacturer that
can supply clock materials that can withstand a wide range of temperatures?”
 For overseas vendors, Company A is expected to have the excellent function for the
provision of information that only a trading company can provide such as the
introduction of new customers. Furthermore, Company A is expected to promptly
respond to unexpected requests such as “we immediately require 2 tons of Material
A” from customers who are electronics manufacturers.
 Company A is expected to provide added value through distribution processing. For
example, vinyl tapes are supplied by chemical manufacturers in the form of rolls.
However, electronics manufacturers require these to be delivered in the form of tapes
with a width of 5 millimeters. Thus, Company A, even though it is a trading
company, performs distribution processing by cutting the tapes.
 Large electronics manufacturers expect that Company A to be a part of SCM (Supply
Chain Management).

310
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)

In order to implement these management policies, it is necessary for Company A to


improve employees’ knowledge of electrical materials and their understanding of the type
of material required by different electronics manufacturers. Furthermore, Company A is
required to appropriately manage this information as well as knowledge about overseas
markets. In addition, Company A must manage very detailed information about suppliers,
and create an internal mechanism to enable a prompt response to unexpected requests from
customers. Also, by working in close collaboration with customers, Company A needs to
pursue and realize their potential for distribution processing as a trading company.
Therefore, it is necessary to improve technical and creative capabilities of employees
concerning distribution processing.
With regard to becoming a part of SCM as desired by large electronics manufacturers, in
addition to modifying their own systems so that they interface with customer’s SCM,
Company A is also required to develop features that can provide new value-added data to
customers.

[Description of Balance Score Card]


A Balance Score Card (BSC) is a performance evaluation technique for “creating a
strategy management system to achieve growth and competitiveness by turning a strategy
into real action”. To realize the strategy, it is necessary to set goals from 4 different
viewpoints in the Balance Score Card.

311
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)

Table 1 Balance Score Card

Viewpoint Goal

In order to meet the expectations of interested


Finance parties such as shareholders and employees, aim to
achieve goals from a financial viewpoint.

In order to realize the financial viewpoint, aim to


Customer
achieve goals from the customer’s viewpoint.

In order to achieve financial goals and improve


customer satisfaction, analyze what kind of
Business process processes are important, and what improvements are
required, and aim to achieve goals from both the
customer and financial viewpoint.

In order to ensure that company has better business


processes than competitors, attains customer
satisfaction, and achieves its financial goals, it aims
Learning and growth
to achieve goals concerning the development of
employee capability and the enhancement of
intellectual properties.

In order to achieve the goals listed in Table 1, a highly important management policy is
created. This management policy is called Critical Success Factors (CSF). A means-end
relationship must exist between these critical success factors. For example, a management
policy from the viewpoint of the customer is the improvement of customer satisfaction, and
a management policy from the viewpoint of business processes that achieves this must be
the means for improvement of customer satisfaction. For example, goals such as “adherence
to deadline” are set.
Furthermore, it is necessary to define indicators to evaluate whether management policies
for the realization of goals are implemented appropriately. It is desirable that these
indicators be described quantitatively. One of the indicators for improving the customer
satisfaction might be “increasing the number of visiting customers”.

312
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)

Subquestion 1
Table 2 shows the critical success factors for Company A drafted from 4 viewpoints
based on the Balance Score Card. From the answer groups below, select the appropriate
terms and phrases to be inserted in each blank .

Table 2 Critical success factors for Company A based on the Balance Score Card

Viewpoint Critical success factors


Increasing profits

Finance
A

Provisions of added value as a trading company


Customer

Provision of B C Introduction Distribution


material related of new processing as
information in customers a trading
real-time company
D Change
Business process own
Detailed system so Close
management of that it can collaboration
supplier interface
information with
with SCM customers

E Deepened knowledge Improved creative and


of types of materials technical capabilities
required by different of employees
electronics concerning
Learning and growth manufacturers distribution processing

Promotion of knowledge
management

Answer group for A:


a) Increased sales revenue
b) Enhanced technology
c) Increased the number of employees
d) Improved quality

313
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)

Answer group for B through E:


a) Incorporation of Company A’s system in SCM
b) Development of features for provision of new value-added data
c) Prompt response to sudden requests
d) Increased number of employees who have passed a certification exam
e) Improved employees’ knowledge of electrical materials
f) Increased number of manufacturing bases

Subquestion 2
Table 3 shows the indicators for achieving critical success factors. From the answer
group below, select the appropriate terms and phases to be inserted into each blank
in Table 3.

Table 3 Indicators for achieving of critical success factors

Critical success factors Indicators


Provision of real-time information about materials F
Prompt response to sudden requests G
Promotion of knowledge management H
Introduction of new customers I
Achievement of distribution processing as a trading
J
company

Answer group:
a) Frequency of capital movements between overseas offices
b) Number of cases of handling unexpected requests
c) Number of entertainment sessions with partners (suppliers and customers)
d) Number of instances of provisions of information concerning materials
e) Number of instances where a new customer is introduced
f) Number of knowledge items registered
g) Actual number of instances of incorporation of Company A’s system into customer’s
SCM
h) Number of instances of proposals for distribution processing

314
11
Afternoon Exam
Section

Mandatory Questions
(Data Structures and
Algorithms)

Learning Objectives
1. Be able to understand processing details by reading [Program description].
2. Be able to map [Program description] with algorithms of the program.
3. Be able to trace processing details in a simple example program.
4. From [Program description], be able to identify the processing detail to be
inserted in the blanks in a program.
5. Based on the program, be able to determine the results of executing the
data provided.
6. Be able to understand how to modify a program when a process is added
or modified.
(Frequently-appearing points)
Array processing, character string processing, sorting, searching,
graphics, etc.

315
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

11 Mandatory Questions (Data


structures and Algorithms)
Q11-1 
Read the following program description and the program itself, and then answer the
subquestion.

[Program description]
The sub-program Aggregate tabulates the questionnaire responses stored in a response
file, and prints a tabulation results table.

(1) A questionnaire is performed on males between the age groups of 20s and 60s. The
questionnaire is comprised of N (1 ≤ N ≤ 50) questions for surveying age and
gender, and satisfaction level of respondents. Respondents are required to fill in his
or her age in the age column, “M” if the respondent is a male and “F” if the
respondent is a female in the gender column, and one of the following numbers in
the response columns of the questions that inquires about satisfaction level.
5: Highly satisfied 4: Satisfied 3: Neutral 2: Somewhat unsatisfied 1: Unsatisfied

(2) In the Response file, responses provided by the respondents for age and gender (“M”
or “F”) are stored as numerical strings (character strings) for the selection numbers of
Question 1 to Question N. Assume that there are no errors in the response file, and
the total number of entries is 1,000 or less.
The format of a record in the response file is as follows:

Age Gender Numerical string of response


(Integer type) (Character type) (Character type)

(3) Three (3) items are printed in the tabulation results table, namely, number of people
for each selection choice for each question in the questionnaire (hereinafter called
response results), number of respondents by age group who selected “Highly
satisfied” or “Satisfied” for the relevant question (hereinafter called satisfaction level
by age group), and number of males and females by age group (hereinafter called
number of males and females by age group).
Print format of tabulation results table is as follows:

316
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

Tabulation results table


Response results:
Highly Satisfied Neutral Somewhat Satisfied
satisfied unsatisfied
Q1 175 224 70 15 9
Q2 153 179 108 38 15
 
QN 97 133 128 85 50

Satisfaction level by age group:


20s 30s 40s 50s 60s
Q1 123 97 77 59 43
Q2 92 75 63 56 46
 
QN 31 42 53 55 49

Number of males and females by age group:


Males Females
20s 49 52
30s 44 58
40s 52 47
50s 47 51
60s 43 50

(4) The following external functions are used in Aggregate.


(i) External function SubStr for extracting a part of the character string.
(ii) External function CtoI that converts a single character digit (between “0” and
“9”) into its integer value.

(5) The following table shows the specifications of the arguments of Aggregate.
Table Specifications of the arguments of Aggregate

Variable Data type Input/Output Meaning


N Integer type Input Number of questions
in the questionnaire

317
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

(6) The index of all arrays in the program starts with one (1), and the two-dimensional
array is as shown below:

DAT 1 2
1 A B Defined such as DAT[3, 2].
2 C D For example, DAT[1, 2]
indicates B .
3 E F

(7) Line feed process is performed by specifying “ \n” as an argument in the procedure
PRINT.

[Program]
○ Aggregate (integer_type: N)
○ integer_type: i, j, A, K, Cnt
○ integer_type: Age[1000], QCnt[50,5], MCnt[50,5], SCnt[5,2]
○ character_type: Gender[1000], Response[1000]
○ File: AFile
○ Procedure: File input(AFile, Age, Gender, Response, Cnt)
/* Procedure for reading the contents of the file AFile in the integer_type
array Age, character_type arrays Gender and Response
The number of records read is stored in Cnt (1 ≤ Cnt ≤ 1000) */
○ Procedure: PRINT(Argument 1, Argument 2, …)
/* Procedure for printing data of Argument 1, Argument 2, …
PRINT("\n") performs the line feed operation */

318
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

(Line number)
1 /* Reading file */
2 ·File input(AFile, Age, Gender, Response, Cnt)
3 /* Initialization of arrays */
4 ■ i:1, i ≤ N, 1
5 ■ j:1, j ≤ 5, 1
6 ·QCnt[i, j] ← 0 /* Array for response results */
7 ·MCnt[i, j] ← 0 /* Array for satisfaction level by age group */
8 ■
9 ■
10 ■ i:1, i ≤ 5, 1
11 ■ j:1, j ≤ 2, 1
12 SCnt[i, j] ← 0 /* Array for the number of males and females by age
group */
13 ■
14 ■
15 /* Tabulation process */
16 ■ i:1, i ≤ Cnt, 1
17 • A
18 ■ j:1, j ≤ N, 1
19 ·K ← CtoI(SubStr(Response[i], j, 1))
/* SubStr fetches one (1) character on j-th location from the of Response[i]
CtoI converts the digit character into an integer */
20 • B
21 ▲ K = 5 or K = 4
22 · C
23 ▼
24 ■
25 ▲ if(Gender[i] = "M")
26 ·SCnt[A, 1] ← SCnt[A, 1] + 1
27
28 ·SCnt[A, 2] ← SCnt[A, 2] + 1
29 ▼
30 ■

319
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

31 /* Printing tabulation results table */


32 PRINT(" Tabulation results table","\n")
/* Prints " Tabulation results table", line feed */
33 PRINT("Response results", "\n")
34 PRINT("Highly satisfied Satisfied Neutral Somewhat unsatisfied Unsatisfied", "\n");

35 ■ i:1, i ≤ N, 1
36 ·PRINT("Q ", i) /* After "Q " is printed, prints the value of variable i */
37 ■ D
38 ·PRINT(QCnt[i, j], "persons ")
39 ■
40 ·PRINT("\n")
41 ■
42 ·PRINT("\n", "Satisfaction level by age group", "\n")
43 ·PRINT(" 20s 30s 40s 50s 60s", "\n")
44 ■ i:1, i ≤ N, 1
45 ·PRINT("Q", i)
46 ■ j:1, j ≤ 5, 1
47 ·PRINT(MCnt[i, j], " persons ")
48 ■
49 ·PRINT("\n")
50 ■
51 ·PRINT("\n", "Number of males and females by age group ", "\n")
52 ·PRINT(" Males Females", "\n")
53 ■ i:1, i ≤ 5, 1
54 ·PRINT( E , "s ")
55 ■ j:1, j ≤ 2, 1
56 ·PRINT(SCnt[i, j], " persons")
57 ■
58 ·PRINT("\n")
59 ■

320
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

Subquestion
From the answer groups below, select the correct answers to be inserted in each blank
in the [Program].

Answer group for A:


a) A ← A + 1
b) A ← Age[i] – (Age[i] ÷ 10) × 10
c) A ← Ag e [ i ] ÷ 1 0 - 1
d) A ← Age[i] ÷ 10 × 10

Answer group for B and C:


a) MCnt[A, i] ← MCn t [ A, i ] +1
b) MCnt[A, j] ← MCn t [ A, j ] +1
c) MCnt[i, A] ← MCn t [ i , A] + 1
d) MCnt[j, A] ← MCn t [ j , A] + 1
e) QCnt[A, j] ← QCn t [ A, j ] +1
f) QCnt[j, A] ← QCn t [ j , A] + 1
g) QCnt[j, K] ← QCn t [ j , K] + 1
h) QCnt[K, j] ← QCn t [ K, j ] +1

Answer group for D:


a) j:1, j < 5, 1 b) j:1, j ≤ 5, 1
c) j:5, j > 0, −1 d) j:5, j ≥ 0, −1

Answer group for E:


a) i b) i × 10
c) (i + 1) × 10 d) (i × 2) × 10

321
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

Q11-2 
Read the following program description and the program itself, and then answer
Subquestions 1 through 3.

[Program description]
The subprogram Merge sorts the contents of array A in ascending order. The number of
elements in array A is N (N must be the power of two (2)) and the value of each element is
less than 9999. No two (2) or more elements have the same value. Moreover, this array A
and the number of elements N are passed to Merge as arguments. In Merge, array X and array
Y are used for processing. In merging, at the end of array X and array Y, a sentinel with a
value greater than any of the element values of array A is placed (in the program, the value
of the sentinel is 9999). The sorting process is as follows:

Example: Assume that array A has eight (8) elements with the values (4, 3, 8, 6, 0, 9, 1, 5).

(1) Consider that array A is comprised of sorted subarrays (indicated with underline)
where the number of elements is one (1).
Array A: (4, 3, 8, 6, 0, 9, 1, 5)
(i) Operation 1 Fetch subarray 4 and subarray 3 from array A, and insert them in
array X and array Y respectively.
Operation 2 The merge elements of array X and array Y are in ascending order, and
update array A as shown below. As a result, array A is partially sorted, the
number of elements in this sorted subarray becomes two (2).
Array A : (3, 4, 8, 6, 0, 9, 1, 5)
Continue on the following steps (ii) to (iv) with the similar operations with Operation
1 and 2.
(ii) Fetch subarray 8 and subarray 6 from array A , and insert them in array X and array
Y respectively.
Merge array X and array Y , and update array A .
Array A : (3, 4, 6, 8, 0, 9, 1, 5)
(iii) Fetch subarray 0 and subarray 9 from array A, and insert them in array X and
array Y respectively.
Merge array X and array Y , and update array A .
Array A :(3, 4, 6, 8, 0, 9, 1, 5)
(iv) Fetch subarray 1 and subarray 5 from array A, and insert them in array X and array Y.
Merge array X and array Y , and update array A .
Array A :(3, 4, 6, 8, 0, 9, 1, 5)

322
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

(2) Consider that array A is comprised of subarrays each of which has two (2) sorted
elements, and perform Operation 1 and 2.
(i) Fetch subarray 3, 4 and subarray 6, 8 from array A , and insert them in array X and
array Y respectively.
Merge array X and array Y , and update array A .
Array A : (3, 4, 6, 8, 0, 9, 1, 5)
(ii) Fetch subarray 0, 9 and subarray 1, 5 from array A , and insert them in array X and
array Y respectively.
Merge array X and array Y , and update array A .
Array A : (3, 4, 6, 8, 0, 1, 5, 9)

(3) Consider that array A is comprised of subarrays each of which has four (4) sorted
elements, and perform Operation 1 and 2.

Fetch subarray 3, 4, 6, 8 and subarray 0, 1, 5, 9 from array A , and insert them in array
X and array Y respectively.
Merge array X and array Y, and update array A. With this, sorting is completed.
Array A : (0, 1, 3, 4, 5, 6, 8, 9)

323
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

[Program]
○ Subprogram: Merge(A[ ], N)
○ integer_type: X[ ], Y[ ], Max, J, K, L, M, P, Q

· Max ← 9999
· J ← 1
■ J < N
·K ← 0
■ K ≤ N - 2 × J
·L ← 1
■ L ≤ J
·X[L] ← A[K+L]
·Y[L] ← E
·L ← L + 1

·X[J+1] ← Max
·Y[J+1] ← Max
·P ← 1
·Q ← 1
·M ← 1
■ M ≤ 2 × J
▲ X[P] < Y[Q]
·A[K+M] ← X[P]
·P ← P + 1
· F
· G

·M ← M + 1

·K ← K + 2 × J

·J ← 2 × J

324
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

Subquestion 1
The element values of array B are (8, 1, 7, 2, 6, 3, 5, 4). When the subprogram Merge is
executed for sorting array B in ascending order; after step (ii) in paragraph (2) of [Program
description] is completed and number of elements in the sorted subarray becomes four (4),
what are the contents of array B? From the answer groups below, select the correct answers
to be inserted in each blank below.

(1, 2, A , B , C , D , 5, 6)

Answer groups for A though D:


a) 3 b) 4 c) 7 d) 8

Subquestion 2
From the answer group below, select the correct answers to be inserted into the
in the program.

Answer group for E through G:


a) A[K + L] b) A[K + L + 1]
c) A[K + L + J] d) A[K + M]
e) A[K + M] ← X[Q] f) A[K + M] ← Y[P]
g) A[K + M] ← Y[Q] h) P ← P +1
i) Q ← Q +1

Subquestion 3
From the answer group below, select the correct answer to be inserted in each blank
in the description below.

The reason for using a sentinel in the subprogram Merge is because when elements
remain in either array X or Y only when merging is being performed, by comparing
with a large value that actually does not exist as data, the remaining portion of the
array X or Y can be copied to the array A.
For example, in (2)(ii) under [Program description], prior to the merging process,
9999 is assigned to H and I that are used sentinels. Proceeding
with merging in the sequenece of X[1](=0), Y[1](=1), and Y[2](=5); X[2](=9)
remains in the end. Here, comparing X[2] with the sentinel element J
gives X[2] < 9999, and X[2] is copied to the array A, which completes the merging
process for this subarray.

325
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

Answer group for H through J:


a) X[1] b) X[2] c) X[3]
d) Y[1] e) Y[2] f) Y[3]

326
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

Q11-3 
Read the following description of an algorithm, and then answer the Subquestions 1 and 2.

[Description of the Algorithm]


The algorithm ShortestLength finds the shortest distance from the starting point to
other points in a graph containing N points (N > 1).
(1) The description of ShortestLength is given below using the graph (N = 6)
shown in Fig. 1 as an example. In Fig. 1, a circle shows a point, the direction of
an arrow shows the direction of movement, and the number attached to the arrow
shows the distance between the points.

Starting point
10 40
1 2 3

20 30 10 10 30

4 5 6
20 30

Fig. 1 Example graph (N = 6)

(2) ShortestLength uses the following arrays. Element numbers 1, 2, ..., N


correspond with the points. The index of each array starts at 1.
Dt[i][j]: The array with N ×N elements storing the distance from Point i to Point j .
When there is no direct path from Point i to Point j, when the direction of
movement is opposite, or in the case of Dt[i][i] , ∞ (constant indicating
the maximum value) is stored. In Fig. 1, part of Dt[i][j] is as follows.
Dt[1][1] = ∞, Dt[1][2] = 10,
Dt[1][3] = ∞, Dt[2][1] = ∞
Sd[i]: The array that stores the temporary shortest distance from the starting point,
Point 1, to Point i. Initially, each element is set to ∞.
Pe[i] : The array for identifying the points that have been processed while the
shortest distance is calculated. Initially, each element is set to false .
When Pe[i] is true , Sd[i] stores the shortest distance from Point 1 to
Point i. When all the elements are true , the process will be finished.
(3) The following describes the procedure of calculating the shortest distance using
the example of Fig. 1.

327
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

(i) Because the starting point is Point 1, set Pe[1] to true. Next, find the points that
are connected directly from Point 1. Those are Points 2, 4 and 5. Then store those
distances Dt[1][2], Dt[1][4] and Dt[1][5] into Sd[2], Sd[4] and Sd[5],
respectively. As a result, Sd[2] = 10, Sd[4] = 20, and Sd[5] = 30. The result is
shown in Fig. 2. The value in [ ] above or below Point i shows the temporary
shortest distance Sd[i] from Point 1 to Point i. The marked point by shade
indicates that it is processed (Pe[i] = true).

[10] [∞]
10 40
1 2 3

20 30 10 10 30

4 5 6
20 30
[20] [30] [∞]

Fig. 2 The result of step (i)

(ii) Among unprocessed points, select the point whose temporary shortest distance
from Point 1 is the shortest. That is Point 2, and set Pe[2] to true (2 is the value
of index k where Pe[k] = false and Sd[k] is the smallest). At this point, Sd[2]
= 10 is determined as the shortest distance between Point 1 and Point 2.
Next, temporary shortest distances Sd[i] to Points 3 and 5, which are
connected directly from Point 2, are updated. However, when the value of Sd[i]
is not become smaller, it is not replaced.
(Before update) (After update)
Sd[3] = ∞ - > Sd[3] = Sd[2] + Dt[2][3] = 50
Sd[5] = 30 -> Sd[5] = Sd[2] + Dt[2][5] = 20
At this time, the assignment statement in a pseudo-language for updating
temporary shortest distance Sd[i] to point i (i = 3, 5) via point k (k = 2) is as
shown in [Part of the program] below. Here, the system function min returns the
smaller value within two arguments.

[Part of the program]


·Sd[i] ← min(Sd[i], A )

The result is shown in Fig. 3.

328
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

[10] [50]
10 40
1 2 3

20 30 10 10 30

4 5 6
20 30
[20] [20] [∞]

Fig. 3 The result of step (ii)

(iii) Among unprocessed points, Points 4 and 5 are the points whose temporary
shortest distance is the shortest. When multiple points have the same value, a
point with a smaller element number, Point 4, is selected and marked as
processed. At this point, Sd[4] is determined as the shortest distance between
Point 1 and Point 4.
Next, the temporary shortest distance to the point connected directly from
Point 4 is updated.
Sd[4] + Dt[4][5] = 40. This is larger than the current value of Sd[5].
Therefore, it is not updated. The result is shown in Fig. 4.

[10] [50]
10 40
1 2 3

20 30 10 10 30

4 5 6
20 30
[20] [20] [∞]

Fig. 4 The result of step (iii)

(iv) Among unprocessed points, Point 5 is the point whose temporary shortest
distance is the shortest. Select Point 5 and mark it as processed. At this point,
Sd[5] is determined as the shortest distance between Point 1 and Point 5.
Next, the temporary shortest distances of points that are connected directly
from Point 5 are updated.
Sd[3] = 50 ->Sd[3] = Sd[5] + Dt[5][3] = 30
Sd[6] = ∞ ->Sd[6] = Sd[5] + Dt[5][6] = 50
The result is shown in Fig. 5.

329
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

[10] [30]
10 40
1 2 3

20 30 10 10 30

4 5 6
20 30
[20] [20] [50]

Fig. 5 The result of step (iv)

(v) Among unprocessed points, Point 3 is the point whose temporary shortest
distance is the shortest. Select it and mark it as processed. At this point, Sd[3] is
determined as the shortest distance between Point 1 and Point 3.
Next, the temporary shortest distance to Point 6, which is connected directly
from Point 3, is updated.
Calculated as the same way in step (iii), the temporary shortest distance of
Point 6, Sd[6] becomes B .
The result is shown in Fig. 6.

[10] [30]
10 40
1 2 3

20 30 10 10 30

4 5 6
20 30
[20] [20] [ B ]

Fig. 6 The result of step (v)

(vi) Among unprocessed points, Point 6 is the point whose temporary shortest
distance is the shortest. Select it and mark it as processed. At this point, Sd[6] is
determined as the shortest distance between Point 1 and Point 6.
All the points have been processed, bringing the procedure completed. The
result is shown in Fig. 7.

[10] [30]
10 40
1 2 3

20 30 10 10 30

4 5 6
20 30
[20] [20] [ B ]

Fig. 7 The result of step (vi)

330
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

Subquestion 1
From the answer groups below, select the correct answers to be inserted in the blanks
in the description of the algorithm ShortestLength.

Answer group for A:


a) Sd[i] + Dt[i][k] b) Sd[i] + Dt[k][i]
c) Sd[k] + Dt[i][k] d) Sd[k] + Dt[k][i]

Answer group for B:


a) 30 b) 40 c) 50 d) 60

331
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

Q11-4 
Read the following program description and the program itself, and then answer
Subquestions 1 and 2.

[Description of Program 1]
The subprogram Compress is a program for compressing a character string.

(1) The character type array Dat is searched from the start. When the same character
appears four (4) or more times consecutively, those characters are substituted with the
character string described below that starts with ‘@’, and the substitute character string
is stored in the character type array Cmp instead of the substituted characters.

Character string after substitution


“@Xn” X shows the character that appears
continuously.
n shows the number of times for which the
same chearacter is appearing consecutively
(4 ≤ n ≤ 9).
Fig.1 Character string after substitution

(2) In the respective element of the character type array, one (1) character at a time is
stored in sequence. In the element after the last character, the system constant EOS is
stored. Array Dat does not contain ‘@’, and the number of times for which the same
character appears consecutively is nine (9) or less. The index of all arrays used in the
program starts with zero (0).

(3) An execution example is shown below.


Index 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Dat A A B B B B C D E E E E E F EOS

Cmp A A @ B 4 C D @ E 5 F EOS

(4) The specifications of arguments of the subprogram Compress are as shown below
Argument Data type Input/Output Meaning
Dat[] Character type Input Character type array
to be compressed
Cmp[] Character type Output Character type array
after compression

332
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

[Program 1]
○ Subprogram: Compress(character_type: Dat[], character_type :Cmp [ ] )
○ integer_type: Didx, Cidx, Cnt
○ character_type: CmpChar

(Line number)
1 Didx ← 0
2 Cidx ← 0
3 ■ Dat[Didx] ≠ EOS
4 · CmpChar ← Dat[Didx]
5 · Cnt ← 1
6 ■ A
7 · Cnt ← Cnt + 1
8 ■
9 • B
10 ▲ Cnt ≥ 4
11 · Cmp[Cidx] ← '@'
12 · Cmp[Cidx + 1] ← CmpChar
13 · Cmp[Cidx + 2] ← IntToChar(Cnt)
14 · C
15
16 ■ Cnt > 0
17 · Cmp[Cidx] ← CmpChar
18 · Cidx ← Cidx + 1
19 · Cnt ← Cnt − 1
20 ■
21 ▼
22 ■
23 · Cmp[Cidx] ← EOS

333
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

(5) For changing the number of times for which the same character appears consecutively,
function IntToChar is used. Specifications of the function IntToChar are as follows:

Function Specifications
Character_type: Converts the integer number
IntToChar(integer_type :Num) specified by the argument Num
into character, and returns it.
Example) 6 →'6'

○ character_type: IntToChar(integer_type:Num)
○ character_type: Cnum[0:10] = {'0', '1', '2', '3', '4',
'5', '6', '7', '8', '9', EOS}
/* Initialization of the character type array Cnum */
/* In the respective element of Cnum, value inside { } is stored. Index start from zero (0) */
- Return Cnum[Num]

Subquestion 1
From the answer groups below, select the correct answer to be inserted in each blank
in Program 1.

Answer group for A:


a) CmpChar = Dat[Didx + 1] b) CmpChar = Dat[Didx + Cnt]
c) CmpChar ≠ Dat[Didx + 1] d) CmpChar ≠ Dat[Didx + Cnt]

Answer group for B and C:


a) Cidx ← Cidx + 1 b) Cidx ← Cidx + 2
c) Cidx ← Cidx + 3 d) Cidx ← Cidx + Cnt
e) Didx ← Didx + 1 f) Didx ← Didx + 3
g) Didx ← Didx + Cnt

334
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

Subquestion 2
The subprogram Expand is a program for decompressing a compressed character string.
From the answer group below, select the correct answers to be inserted in the blanks
in the following [Program 2]. Specification of arguments of the subprogram
Expand are as follows:

Argument Data type Input/Output Meaning


Cmp[] Character Input Compressed character type
type array
Exp[] Character Output Character type array after
type decompression

[Program 2]
○ Subprogram: Expand(character_type:Cmp[], character_type:Exp[])
○ integer_type: Cidx, Eidx, i, Cnt

(Line number)
1 Cidx ← 0
2 Eidx ← 0
3 ■ Cmp[Cidx] ≠ EOS
4 ▲ Cmp[Cidx] = '@'
5 · Cnt ← CharToInt(Cmp[Cidx + 2])
6 ■ i : 1, i ≤ Cnt, 1
7 · D
8 · Eidx ← Eidx + 1
9 ■
10 · E
11
12 · Exp[Eidx] ← Cmp[Cidx]
13 · Eidx ← Eidx + 1
14 · Cidx ← Cidx + 1
15 ▼
16 ■
17 · Exp[Eidx] ← EOS

335
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

Moreover, for converting the number of times for which the same character appears
consecutively, from character to integer, the subprogram Expand uses the function
CharToInt. Specifications of the function CharToInt are as follows:

Function Specifications
integer_type: Converts the character specified with
CharToInt(character_type: Chr) the argument Chr into integer, and
returns the converted value.
Example) '6'→ 6

○ integer_type: CharToInt(character_type: Chr)


○ character_type: Cnum[0:10] = {'0', '1', '2', '3', '4',
'5', '6', '7', '8', '9', EOS}
/* Initialization of the character string Cnum */
/* Value inside { } is stored in the respective elements of Cnum. Index starts with zero (0).
*/
○ integer_type: i
·• i ← 4
■ F
• i ← i + 1

• Return i

Answer group for D:


a) Exp[Eidx] ← Cmp[Cidx] b) Exp[Eidx] ← Cmp[Cidx + 1]
c) Exp[Eidx] ← Cmp[Cidx + 2] d) Exp[Eidx] ← Cmp[Cidx + Cnt]

Answer group for E:


a) Cidx ← Cidx + 1 b) Cidx ← Cidx + 3
c) Cidx ← Cidx + Cnt d) Cidx ← Cidx + Eidx

Answer group for F:


a) Chr = Cnum[i] b) Chr = Cnum[i − 1]
c) Chr = EOS d) Chr ≠ Cnum[i]
e) Chr ≠ Cnum[i − 1]

336
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

Q11-5 
Read the following description of a program and the program itself, and then answer
Subquestions 1 and 2.

[Program Description]
Subprogram mergeSort performs sorting 2n pieces of integer data (n is an integer an
d n > 0) stored contiguously in a one-dimensional array, by repeatedly merging them
n times.
(1) Sort elements of array input[] in ascending order and then store them in array
output[].
(2) The subscript (index) of each array begins with 0.
(3) The argument specifications of subprogram mergeSort are shown in the following
table.
Table Argument Specifications of mergeSort
Variable Type Input/Output Meaning
input[] integer input Data to be sorted
output[] integer output Area for storing sorted result
size integer input Number of elements in array

The figure below shows an example in which 8 pieces of data stored in the one-di
mensional array are sorted by repeating merging 3 times.

Input data

47 1st merging 33 10
33

33 47 2nd merging 47 25

68 55 55 33

55 68 68 3rd merging 47

74 74 10 55

89 89 25 68

25 10 74 74

10 25 89 89

Fig. Example of Merge/Sort

337
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

[Program]
 mergeSort (integer: input[], integer: output[], integer: size)
 integer: span_size, temp[size / 2], span_idx, write_idx, a_idx, b_idx
 logical: a_yet, b_yet
· span_size ← 2 /* size of areas to be merged */
· output[] ← input[] /* copy of array */
span_size < size
·span_idx ← 0 /* initialization of index in input area */
·write_idx ← 0 /* initialization of index in output area */
span_idx < size α
·a_idx ← span_idx
·b_idx ← span_idx + span_size / 2
i: a_idx - span_idx, i < b_idx - a_idx, 1
·temp[i] ← output[i + span_idx]

·a_yet ← true
·b_yet ← true
A
b_yet = false or (a_yet = true
and b_yet = true and
temp[a_idx - span_idx] < output[b_idx])
·output[write_idx] ← temp[a_idx - span_idx]
·a_idx ← a_idx + 1
a_idx > span_idx + span_size / 2
·a_yet ← false

·output[write_idx] ← output[b_idx]
·b_idx ← b_idx + 1
b_idx > span_idx + span_size
·b_yet ← false

· B β

·span_idx ← span_idx + span_size

·span_size ← span_size × 2 γ

338
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

Subquestion 1
From the answer groups below, select the correct answer to be inserted in each blank
in the above program.

Answer group for A:


a) a_yet = false and b_yet = false
b) a_yet = false or b_yet = false
c) a_yet = true and b_yet = true
d) a_yet = true or b_yet = true

Answer group for B:


a) b_idx ← span_idx
b) b_idx ← span_idx + span_size
c) b_idx ← span_idx + span_size ÷ 2
d) b_idx ← span_idx + span_size × 2
e) write_idx ← 1
f) write_idx ← a_idx + 1
g) write_idx ← b_idx + 1
h) write_idx ← write_idx + 1

Subquestion 2
From the answer groups below, select the correct answer to be inserted in each blank
in the following description.

If the subprogram mergeSort is executed using the following data as input data, the
merging process is carried out C times. Actually, however, data is sorted in
ascending order at the time merging has been completed D times.
The following changes 1 through 3 can be added to terminate the subprogram mergeSort at
the time data has been sorted in ascending order. Here, the variable ordered in the program
after the change is assumed to have been declared as logical type.

339
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

Input data
2 1 4 3 8 7 6 5

Change 1
Add the following process just before α:

·ordered ← true
Change 2
Add the following process just before β :

write_idx > 0
E
·ordered ← false

Change 3
Add the following process just before γ:

ordered = true
·span_size ← size

Answer group for C and D:


a) 1 b) 2 c) 3 d) 4 e) 5

Answer group for E:


a) output[write_idx - 1] ≤ output[write_idx]
b) output[write_idx] ≤ output[write_idx + 1]
c) output[write_idx - 1] > output[write_idx]
d) output[write_idx] > output[write_idx + 1]
e) temp[write_idx] ≤ output[write_idx]
f) temp[write_idx - 1] ≤ temp[write_idx + 1]
g) temp[write_idx] > output[write_idx]
h) temp[write_idx - 1] > temp[write_idx + 1]

340
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

Q11-6 
Read the following program description and the program itself, and then answer
Subquestion.

[Program Description]
There is a display area of 64 (8 × 8) pixels. When coordinates of a pixel (VS, HS )
and a new-color (NC ) are given, the program repaints the pixel and its same-colored
neighboring pixels with the new-color. As a result, a same-colored area is repainted.
For a given pixel, if its upper, lower, left, or right adjacent pixels have the same
color, those pixels are determined to be within the same-colored area. This test is
executed repeatedly for each adjacent pixel that is determined to be within the
same-colored area. Thus, the same-colored area is searched thoroughly, and is
repainted with the new-color.
(1) Prepare a two-dimensional array Image with a size of 10 × 10 (the range of each
index is 0 to 9). A part of the array Image (the range of each index is 1 to 8)
contains the color of each pixel.
(2) Three colors, black ( ), gray ( ), and white ( ) are used. These colors are
represented by values 1, 2, and 3, respectively.
(3) The pixel that indicates the starting point in the area to be repainted is specified
with variables VS and HS . VS and HS are vertical and horizontal indices of the
element in array Image which corresponds to the pixel.
(4) The new-color with which the area is repainted is specified by a variable NC.
(5) The program obtains the current-color of the pixel from Image[VS, HS], and
repaints the area (the pixel and its same-colored neighboring pixels) with the
new-color NC .
(6) Correct values have already been set to the global variables Image , VS , HS, and
NC.
(7) Indices for arrays VPos and HPos start at 1.
(8) Fig. 1 shows an example of running the program with VS= 5, HS= 3 to indicate
that Image[5, 3] is the starting point of the area to be repainted, and NC= 1 to use
black ( ) as the new-color.

341
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

(Before) (After)
Image[1, 1]

Image[5, 3]

Fig. 1 Example of running the program (with NC =1 , VS =5 , HS =3 )

342
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

[Program]
(Line number)
1 ○ Unsigned 8-bit integer: Image[10, 10] /* Color of pixels */
2 ○ Integer: VS, HS /* Starting point is Image[VS,HS] */
3 ○ Unsigned 8-bit integer: CC, NC /* Repaint area with color CC using color NC */
4 ○ Integer: More /* Number of pixels waiting for process */
5 ○ Integer: VPos[64], HPos[64] /* Positions of pixels waiting for process */
6
7 ○ Program: Main
8 ○ Integer: V, H /* Indices for vertical (V) and horizontal (H) directions */
9 ○ Unsigned 8-bit integer: Wall
10 /* Value to be stored in the periphery of display area */
11 • CC ← Image[VS, HS] /* Get current-color of starting point */
12 CC = NC
13 • Return /* End of processing */
14
15 • Wall ← 0
16 V: 1, V ≤ 8, 1 /* Set value for periphery (V=1, 2, …, 8) */
17 • Image[V, 0] ← Wall
18 • Image[V, 9] ← Wall
19
20 H: 1, H ≤ 8, 1 /* Set value for periphery (H=1, 2, …, 8) */
21 • Image[0, H] ← Wall
22 • Image[9, H] ← Wall
23
24 • More ← 0
25 • CheckAndStack(VS, HS) /* Register starting point as the pixel waiting for process */
26 More > 0 /* Repeat the following steps while More>0 */
27 • V ← VPos[More]
28 • H ← HPos[More]
29 • More ← More − 1
30 • CheckAndStack(V − 1, H)
31 • CheckAndStack(V, H − 1)
32 • CheckAndStack(V + 1, H)
33 • CheckAndStack(V, H + 1)
34
35 • Return /* End of processing */
36
37 ○ Subprogram: CheckAndStack(Integer: Vt, Integer: Ht)
38 Image[Vt, Ht] = CC /* Within the area of same color? */
39 • Image[Vt, Ht] ← NC
40 • More ← More + 1
41 • VPos[More] ← Vt
42 • HPos[More] ← Ht
43
44 • Return /* Return to the caller */

343
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

Subquestion
From the answer groups below, select the correct answer to be inserted into each
blank in the following description.

The following is a conversation between a senior engineer (hereinafter called SE)


and a fundamental engineer (hereinafter called FE) about this program.
SE: To understand the behavior of a program, it’s important to trace the flow of the
processes. First, using numbers 1 through 5, show me the order of how the first
5 pixels are repainted for the data shown in Fig. 1.
FE: Okay. I’ll try tracing the program. The result is A .
SE: That’s right. Now, let’s examine the program. First, the size of the display area is
8 × 8, but the size of array Image is 10 × 10, and 0’s are set in the array elements
for the periphery by lines 15 through 23. What is the purpose of this process?
FE: B . But setting values for 32 array elements among 64 elements in the
display area seems like a lot of unnecessary work.
SE: Then, when the size of a display area is m × n, what is the expression for the
number of elements for which values are set by lines 15 through 23?
FE: Well, it would be C . I see, this number of elements becomes relatively
small as the number of pixels m × n in the display area becomes larger.
SE: Next, let’s think about the value to be set in the periphery array elements. By
line 15, value 0 is assigned to the variable Wall . In the given specification, the
color of a pixel is represented by a value in the range of 1 to 3, so this is not a
problem, but if all unsigned 8-bit values from 0 to 255 are used to specify a
color, how should line 15 be modified? Give an example.
FE: One example is to change line 15 to D .
SE: Next, let’s take a look at lines 12 through 14. What are these lines for?
FE: If the program is going to repaint the area with the same color as the
current-color, it returns to the caller without executing the subsequent steps. This
is because repainting with the same color makes no difference and is
meaningless.
SE: That is certainly one reason. Let’s see what happens if lines 12 through 14 are
removed from the program. Now, trace the program when it is trying to repaint a
white-colored area with the same white color. We’ll try 3 cases; for a
white-colored area consisting of 1, 2, and 3 pixels as shown in (1) through (3) in
Fig. 2. Here, variables VS and HS are set to point the pixel with the thick border.

344
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

(1) (2) (3)

Fig. 2 Areas consisting of 1, 2, and 3 pixels

FE: Let me see. The results would be as shown in the following table. From these
results, I see that lines 12 through 14 are important steps that cannot be omitted.

Table Results of tracing

Test case Behavior of the program

(1) in Fig. 2 (area with 1 pixel) E

(2) in Fig. 2 (area with 2 pixels) F

Value of variable More increases and


(3) in Fig. 2 (area with 3 pixels) exceeds the maximum index value of the
array.

Answer group for A

a) b)

4 2
2 1 3 1
3 5
4 5

c) d)
4
4 3 5 5 2
2 1 3 1

345
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

Answer group for B


a) Even though these elements are not referenced, their index values can be used to
determine whether they are within the display area
b) It simplifies the processing by setting these elements repaintable with color NC
c) It allows the range check for each index of array Image to be omitted
d) It allows the range check for each index of arrays VPos and HPos to be omitted

Answer group for C


a) 2 (m + 1)(n + 1) b) 2 (m + n)
c) 2 (m + n + 2) d) 2 (m + n − 2)

Answer group for D


a) • Wall ← CC b) • Wall ← NC
c) • Wall ← 256 − CC d) • Wall ← 255 − NC

Answer group for E and F


a) Repaints the area with the same color according to the specification and exits
normally.
b) Exits without repainting the area.
c) Repaints surrounding pixels excessively that are not included in the area to be
repainted, and then exits.
d) Value of variable More increases and exceeds the maximum index value of the
array.
e) Value of variable More remains less than a certain value, but the processes loop
infinitely.

346
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

Q11-7 
Read the following program description and the program itself, and then answer
Subquestion.

[Program Description]
Function RadixConv is a program that converts a base M digit string (2 ≤ M ≤ 16) to a
base N digit string (2 ≤ N ≤ 16).
(1) A base M digit string consists of base M digits alone without space characters. For
digits greater than 10 in bases (base 11 through 16), the alphabetic characters A
through F are used.
(2) RadixConv first converts a base M digit string to an integer and then converts it to a
base N digit string. Function MToInt converts a base M digit string to an integer,
and function IntToN converts the integer to a base N digit string.
(3) Function MToInt and function IntToN use the following functions:
(i) Function ToInt that converts a one-digit character P (“0”, “1”, …, or “F”) to an
integer
(ii) Function ToStr that converts an integer Q (0 ≤ Q ≤ 15) to a one-digit character
(“0”, “1”, …, or “F”)
(iii) Predefined function Length that returns the length of the string
(iv) Predefined function Substr that extracts part of the string
(4) Tables 1 through 5 list the specification of arguments and return values of
functions.

Table 1 RadixConv

Argument/
Data type Meaning
Return value
Frdx Integer type Radix of source digit string (2≤ Frdx ≤ 16)
Character
Fnum Source digit string
type
Trdx Integer type Radix of converted digit string (2 ≤ Trdx ≤ 16)
Character
Return value Converted base Trdx digit string
type

347
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

Table 2 MToInt

Argument/
Data type Meaning
Return value
Rdx Integer type Radix of source digit string (2 ≤ Rdx ≤ 16)

Num Character type Source digit string

Return value Integer type Converted integer

Table 3 IntToN

Argument/
Data type Meaning
Return value
Val Integer type Converted integer
Radix of converted digit string
Rdx Integer type
(2 ≤ Rdx ≤ 16)
Return value Character type Converted base Rdx digit string

Table 4 ToInt

Argument/
Data type Meaning
Return value
Source one-digit character (“0”, “1”, …, or
P Character type
“F”)
Return value Integer type Converted integer

Table 5 ToStr

Argument/
Data type Meaning
Return value
Q Integer type Source integer (0 ≤ Q ≤ 15)

Return value Character type Converted one-digit character

348
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

[Program]
 character_type: RadixConv (integer_type: Frdx, character_type: Fnum,
integer_type: Trdx)
• return IntToN(MToInt(Frdx, Fnum), Trdx)
/* Takes IntToN value as return value of function */

 integer_type: MToInt (integer_type: Rdx, character_type: Num)


 integer_type: Idx, Val
• Val ← 0
Idx: 1, Idx ≤ Length(Num), 1 /* Length returns string length of Num */
• Val ← A + ToInt(Substr(Num, Idx, 1))
/* Substr fetches the Idxth(≥ 1) character from the beginning of Num */
• return Val /* Takes Val as the return value of function */

 character_type: IntToN(integer_type: Val, integer_type: Rdx)


 integer_type: Quo /* Quotient */
 integer_type: Rem /* Remainder */
 character_type: Tmp
• B
• Tmp ← ""
Quo ≥ Rdx
• Rem ← Quo % Rdx
• Tmp ← ToStr(Rem) + Tmp /* + is an operator to concatenate strings */
• C

• D
• return Tmp /* Takes Tmp as return value of function */

 integer_type: ToInt(character type: P)


 integer_type: Idx
 character_type: Code[16] /* Subscript begins at 0 */
/* Code stores initial values "0", "1", "2", "3", "4", "5", "6", "7", */
/* "8", "9", "A", "B", "C", "D", "E", "F" in this order */
/* Character values are incremented in this order */
• Idx ← 0
E /* Compare the character */
• Idx ← Idx + 1

• return Idx /* Takes Idx as the return value of function */

 character_type: ToStr(integer_type: Q)
 character_type: Code[16] /* Subscript begins at 0 */
/* Code stores initial values "0", "1", "2", "3", "4", "5", "6", "7", */
/* "8", "9", "A", "B", "C", "D", "E", "F" in this order */
/* Character values are incremented in this order */
• return Code[Q] /* Takes Code[Q] as the return value of the function */

349
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)

Subquestion
From the answer groups below, select the correct answer to insert in each blank
in the above program.

Answer group for A:


a) Rdx b) Val
c) Val × Rdx d) Val ÷ Rdx

Answer group for B, C, and D:


a) Quo ← Quo ÷ Rdx b) Quo ← Quo ÷ Rem
c) Quo ← Rdx d) Quo ← Rem ÷ Rdx
e) Quo ← Val f) Rem ← Rdx
g) Rem ← Val h) Tmp ← ToStr(Quo) + Tmp
i) Tmp ← ToStr(Rem) + Tmp

Answer group for E:


a) P < Code[Idx] b) P > Code[Idx]
c) P ≤ Code[Idx] d) P ≥ Code[Idx]

350
12
Afternoon Exam
Section

Software Development
(Five Languages, One
Mandatory Question)

Learning Objectives
1. Read the "Description of Program" and understand the content of the
processing. Be able to perform mapping of code.
2. Be able to follow (i.e., trace) the processing of the program using simple
examples.
3. Based on the Description of Program, be able to identify the processing
that goes into blanks in the program.
4. Be able to calculate the execution outcome for given data, based on the
program algorithms.
5. Be able to locate mistakes in the program.
6. Understand how the program should be modified to accommodate
additions and changes to the processing.
7. Understand the functions of spreadsheet software and the use of functions.

351
Afternoon Exam Section 12 Software Development (C)

12.1 Software Development (C)

Q12-1 
Read the following description of a C program and the program itself, and then answer
the Subquestion.

[Program Description]
Function execute draws lines when the marker displayed on the screen is moved.
1) A bitmap screen has 800 pixels in the horizontal direction and 600 pixels in the
vertical direction. Fig. 1 shows the screen’s coordinate system. A marker ( in
Fig. 1) with positional and directional information is shown on the screen. The
marker moves in four directions: up, down, left, or right. The locus of the marker
is drawn when it is moved.

Origin (0, 0) (799, 0) x-


axis
up
(400, 300)
left right

down

(0, 599) (799, 599)

y-axis

Fig. 1 Screen coordinate system and initial marker status

352
Afternoon Exam Section 12 Software Development (C)

2) The marker is represented by MARKER type structure mark. When the


program starts, the marker position is set to (400, 300) and its direction of
movement is upward.

typedef struct {
int x; /* x coordinate of marker */
int y; /* y coordinate of marker */
int dir; /* Marker direction 0:right 1:up 2:left 3:down
*/
} MARKER;
MARKER mark = {400, /* Initial x coordinate of marker */
300, /* Initial y coordinate of marker */
1 /* Initial direction of marker (up) */
};

3) Instructions for operating the marker are defined. Each instruction consists of an
instruction code and a value, and is expressed by the structure INST.

typedef struct {
char code; /* Instruction code */
int val; /* value */
} INST;

The instructions are stored in the order of execution from the beginning of insts ,
which is an array of the structure INST .
4) The table below lists instruction codes and descriptions.

Instruction code Description


Repeat executing val times from the next
instruction to the last one before the code '}'
{
that forms a pair.
val is an integer greater than 1.
Change the direction of movement of the marker by
t 90° × val in the counterclockwise direction. val
is a nonnegative integer.

353
Afternoon Exam Section 12 Software Development (C)

Move the marker in the current direction by val


f pixels to draw a line from the source to the
destination. val is any integer.
Indicates the end of a series of instructions to
}
be repeated. val is not referenced.
Indicates the end of the instruction array. val
\0
is not referenced.

5) Fig. 3 shows the output of function execute executed with the instructions stored
in the structure array insts, as shown in Fig. 2. Note, however, that the
coordinate values in Fig. 3 are added for the sake of explanation and are not
actually outputted.

insts[0] insts[1] insts[2] insts[3] insts[4]


cod val cod val cod val cod val cod val
'{' 3 '{' 4 'f' 50 't' 1 '}' 0

Pair

insts[5] insts[6] insts[7]


cod val cod val cod val ...
'f' 50 '}' 0 '\0 0
'
Pair

Fig. 2 Example of instructions stored in the structure array insts

(350, 150) (400, 150)

(350, 200) (400, 200)

(350, 250) (400, 250)

(350, 300) (400, 300)

Fig. 3 Results of executing the example in Fig. 2

6) The following functions are available for drawing lines:

354
Afternoon Exam Section 12 Software Development (C)

void drawLine( int x1, int y1, int x2, int y2 );


Features: Draws part of the line segment connecting coordinate (x1, y1) and
coordinate (x2, y2) that is included in the screen area.
7) The following functions related to the marker are available:

void eraseMarker( MARKER mark );


Feature: Erases the indication of the marker when it is in the screen area.

void paintMarker( MARKER mark );


Feature: Draws the marker when it is in the screen area.
8) Even if the marker has moved out of the screen area and is no longer visible, its
position coordinates and direction of movement are retained.

[Program]
#define INSTSIZE 100 /* Upper limit of number of instructions */
#define STACKSIZE 50 /* Upper limit of nesting */

typedef struct {
int x; /* x coordinate of marker */
int y; /* y coordinate of marker */
int dir; /* Marker direction 0:right 1:up 2:left 3:down */
} MARKER;

typedef struct {
char code; /* Instruction code */
int val; /* value */
} INST;

typedef struct {
int opno; /* Element No. of array insts at which the start of loop is
defined */
int rest; /* Remaining loop count */
} STACK;

void drawLine( int, int, int, int );


void eraseMarker( MARKER );
void paintMarker( MARKER );

355
Afternoon Exam Section 12 Software Development (C)

INST insts[INSTSIZE]; /* Structure array for storing instructions */


MARKER mark = {400, /* Initial x coordinate of marker */
300, /* Initial y coordinate of marker */
1 /* Initial direction of marker (up) */
};

void execute(){

STACK stack[STACKSIZE];
int opno = 0; /* Element No. of array insts which contains the instruction
to be executed */
int spt = -1; /* Stack pointer */
int dx, dy;

paintMarker( mark );

while( insts[opno].code != '\0' ){


switch( insts[opno].code ){
case '{':
stack[ A ].opno = opno;
stack[spt].rest = insts[opno].val;
break;
case 't':
mark.dir = B ;
break;
case 'f':
eraseMarker( mark );
dx = ( mark.dir % 2 == 0 ) ? C ;
dy = ( mark.dir % 2 == 0 ) ? D ;
drawLine( mark.x, mark.y,
mark.x + dx, mark.y + dy );
mark.x += dx;
mark.y += dy;
paintMarker( mark );
break;
case '}':
if ( stack[spt].rest E ){
opno = stack[spt].opno;

356
Afternoon Exam Section 12 Software Development (C)

stack[spt].rest--;
} else {
F ;
}
break;
}
G ;
}
}

Subquestion
From the answer groups below, select the correct answers to be inserted in the blanks
in the above program.

Answer group for A:


a) ++spt b) --spt c) spt
d) spt++ e) spt--

Answer group for B:


a) ( mark.dir + insts[opno].val ) % 2
b) ( mark.dir + insts[opno].val ) % 3
c) ( mark.dir + insts[opno].val ) % 4
d) mark.dir + insts[opno].val
e) mark.dir + insts[opno].val % 2
f) mark.dir + insts[opno].val % 3
g) mark.dir + insts[opno].val % 4

357
Afternoon Exam Section 12 Software Development (C)

Answer group for C and D:


a) ( 1 - mark.dir ) * insts[opno].val : 0
b) ( 2 - mark.dir ) * insts[opno].val : 0
c) ( mark.dir - 1 ) * insts[opno].val : 0
d) ( mark.dir - 2 ) * insts[opno].val : 0
e) 0 : ( 1 - mark.dir ) * insts[opno].val
f) 0 : ( 2 - mark.dir ) * insts[opno].val
g) 0 : ( mark.dir - 1 ) * insts[opno].val
h) 0 : ( mark.dir - 2 ) * insts[opno].val
i) 0 : mark.dir * insts[opno].val
j) mark.dir * insts[opno].val : 0

Answer group for E:


a) < 0 b) < 1 c) == 0
d) > 0 e) > 1

Answer group for F and G:


a) mark.dir++ b) mark.dir-- c) opno++
d) opno-- e) spt++ f) spt--

358
Afternoon Exam Section 12 Software Development (C)

Q12-2 
Read the following description of a C program and the program itself, and then answer
Subquestions 1 through 3.

[Description of Program 1]
This program writes customer information and total card usage amounts for a credit card
company.

(1) At the end of the fiscal year, the credit card company writes a file containing a list
of customers’ card usage amounts, in the data format shown in Fig. 1. Assume
that the number of cardholders is at most 30,000, and that a cardholder’s total
usage amount does not exceed ¥100 million.

Cardholder
Cardholder name Prefecture Total usage amount
ID
(example) 4741 Rokuro_KIHON Tokyo 3,500,000

Fig. 1 Data format for usage amount list

359
Afternoon Exam Section 12 Software Development (C)

(2) The data required for output is described in the two (2) types of files shown in Fig.
2. Data items are separated by spaces while underscore is used between a
cardholder’s family name and given name. In addition, both the cardholders file
and the card usage file are sorted in ascending order of cardholder ID, and
cardholder IDs are not duplicated in the data in the cardholders file.

Cardholder ID Cardholder name Prefecture Cardholder ID Usage amount


1 Taro_JOHO Hokkaido 1 1,000
2 Hanako_JOHO Aomori 1 50,000
3 Toriko_KODO Miyagi 1 3,000
...
...
4740 Goro_KIHON Chiba
4741 Rokuro_KIHON Tokyo 4740 1,500
... 4741 10,000
25760 Yoshiko_KEIEI Kagoshima 4741 250,000
25761 Narumi_KEIEI Okinawa 4741 3,000,000
...
Cardholders file Card usage file
member.txt shopping.txt

Fig. 2 Example of import file

(3) The program first calls the function init , and, as shown in Fig. 3, constructs a
binary search tree structure in memory from the two (2) types of files shown in
Fig. 2. For data in the cardholder ID memNo (in the cardholder file) that matches
data in the cardholder ID shopNo (in the card usage file), the usage amount
shopAmount is totaled for each cardholder ID, and the total usage amount
memAmount is calculated. After this, the data is registered in the binary search tree
using the function regist .

360
Afternoon Exam Section 12 Software Development (C)

root 1
Taro_JOHO Hokkaido
54,000

2 4741
Hanako_JOHO Aomori Rokuro_KIHON Tokyo
0 3,260,000

4740
Goro_KIHON Chiba
1,500

Fig. 3 Example of binary search tree data structure

(4) Descriptions of the functions defined in the program are as follows.


void init()
Function: Reads in the two (2) types of file shown in Fig. 2, and constructs a binary
search tree.
void regist(int, char *, char *, long)
Function: Registers data that was passed as arguments, into the corresponding
sections of the binary search tree.
void writeTree()
Function: Writes data to an output file.
void writeMember(struct MEMBER *, FILE *)
Function: A recursive function that reads in the binary search tree in order, and
writes it to an output file.
(5) The program uses the following library function.
void *malloc(size_t size)
Function: Allocates an area in memory of size bytes, and returns a pointer to the
allocated area. NULL is returned when memory allocation fails.

361
Afternoon Exam Section 12 Software Development (C)

[Program 1]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX_MEMBER 30000 /* Number of cardholders */


#define MAX_NAME_LENGTH 20
#define MAX_AREA_LENGTH 10

struct MEMBER {
int no;
char name[MAX_NAME_LENGTH]; /* Cardholder name */
char area[MAX_AREA_LENGTH]; /* Prefecture */
long amount;
struct MEMBER *left;
struct MEMBER *right;
};

struct MEMBER *root = NULL;

void init();
void regist(int, char *, char *, long);
void writeTree();
void writeMember(struct MEMBER *, FILE *);

void init() {
int memNo, shopNo;
long memAmount, shopAmount;
char tmpName[MAX_NAME_LENGTH];
char tmpArea[MAX_AREA_LENGTH];
int memEnd, shopEnd;

FILE *fMember = fopen("member.txt", "r");


FILE *fShopping = fopen("shopping.txt", "r");
memEnd = fscanf(fMember, "%d", &memNo);
shopEnd = fscanf(fShopping, "%d", &shopNo);

while( memEnd != EOF ) {

362
Afternoon Exam Section 12 Software Development (C)

fscanf(fMember, "%s", tmpName);


fscanf(fMember, "%s", tmpArea);
memAmount = 0;
while(( shopEnd != EOF) && (shopNo == memNo)) {
fscanf(fShopping, "%d", &shopAmount);
memAmount += shopAmount;
shopEnd = fscanf(fShopping, "%d", &shopNo);
}
regist(memNo, tmpName, tmpArea, memAmount);
memEnd = fscanf(fMember, "%d", &memNo);
}
}

void regist(int no, char *name, char *area, long amount) {


struct MEMBER *p, *ptr, *pre;
if ((p = (struct MEMBER *)malloc(sizeof(struct MEMBER))) == NULL ) {
printf("Memory error\n");
exit(-1);
}
p->no = no;
strcpy(p->name, name);
strcpy(p->area, area);
p->amount = amount;
p->left = p->right = NULL;

/*Registers data in an appropriate location in binary search tree */


if ( root == NULL ) {
root = p;
} else {
ptr = root;
while ( ptr != NULL ) {
pre = ptr;
if ( amount < ptr->amount ) ptr = ptr->left;
else ptr = ptr->right;
}
if ( amount < pre->amount ) A ;

else B ;

363
Afternoon Exam Section 12 Software Development (C)

}
}

void writeTree() {
FILE *fOutput = fopen("output.txt", "w");
writeMember(root, fOutput);
fclose(fOutput);
}

void writeMember(struct MEMBER *p, FILE *fp) {


if( p == NULL )return;
writeMember(p->left, fp);
fprintf(fp, "%5d %-20s %-10s %8d \n", C );
writeMember(p->right, fp);
}

Subquestion 1
From the answer groups below, select the correct answer to be inserted in each blank
in the above program.

Answer group for A and B


a) p = pre->left b) p = pre->right
c) p = ptr->left d) p = ptr->right
e) pre->left = p f) pre->right = p
g) ptr->left = p h) ptr->right = p

Answer group for C


a) &p->no, &p->name, &p->area, &p->amount
b) &p->no, p->name, p->area, &p->amount
c) *p->no, *p->name, *p->area, *p->amount
d) *p->no, p->name, p->area, *p->amount
e) p->no, &p->name, &p->area, p->amount
f) p->no, *p->name, *p->area, p->amount
g) p->no, p->name, p->area, p->amount

364
Afternoon Exam Section 12 Software Development (C)

Subquestion 2
For Program 1, from the answer group, select the answer that shows the correct order of
output for the usage amount list, and insert into answer column D in the answer sheet.

a) Data with larger cardholder ID values is written first.


b) Data with smaller cardholder ID values is written first.
c) Data with larger total usage amount values is written first. If the total usage amounts
are equal, the data with the larger cardholder ID value is written first.
d) Data with larger total usage amount values is written first. If the total usage amounts
are equal, the data with the smaller cardholder ID value is written first.
e) Data with smaller total usage amount values is written first. If the total usage
amounts are equal, the data with the larger cardholder ID value is written first.
f) Data with smaller total usage amount values is written first. If the total usage
amounts are equal, the data with the smaller cardholder ID value is written first.

Subquestion 3
The function writeMember in Program 1 has been modified per Program 2. This time,
output is to be performed so that larger total usage amounts are written first. From the
answer group below, select the correct answer to be inserted in each blank in
Program 2. However, the same item from Subquestion 1 goes into blank C.

[Program 2]
void writeMember(struct MEMBER *p, FILE *fp) {
if( p == NULL ) return;
E ;
fprintf(fp, "%5d %-20s %-10s %8ld\n", C );
F ;
}

365
Afternoon Exam Section 12 Software Development (C)

Answer group:
a) writeMember(p->left, fp)

b) writeMember(p->left, fp);
writeMember(p->right, fp)

c) writeMember(p->right, fp)

d) writeMember(p->right, fp);
writeMember(p->left, fp)

e) None

366
Afternoon Exam Section 12 Software Development (C)

Q12-3 
Read the following description of a C program and the program itself, and then answer
Subquestions 1 through 3.

[Program Description]
This is a program for outputting students’ performance in a certain university.

(1) In this university, a list of students’ course grades is outputted at the end of each
semester, to a file which has the record format shown in Fig. 1. The number of
students is 15,000, the number of courses is 2,000, and the scores are integers in
the 0 – 100 range.

Student Student Course Course


Score Score Course name Score
key name name name

Basic
Information
Goro Chemistry English
[Example] 02498 Processing 25 50 ... 67
KIHON Lab Conversation
2
1

Fig. 1 Record format of list of course grades

367
Afternoon Exam Section 12 Software Development (C)

(2) Data required for outputting is entered in three types of files as shown in Fig. 2.

Course Student Course Student


Course name Student name Score
key file key key

0000 Information Processing 1 00000 Hanako SEKKEI 1932 00472 34

0001 Information Processing 2 00001 Taro JOHO 1932 09755 79

0002 Numerical Analysis 00002 Jiro KAIHATSU 0357 10253 41


...

...

...
0752 Chemistry Lab 02498 Goro KIHON 0752 02498 50
...

...

...
1997 Basic English 14997 Mamoru 0173 13712 13
Conversation 3 SHIKEN

1998 Basic English 14998 Saburo 0173 00638 78


Conversation 4 TANGEN

1999 Advanced English 14999 Daisuke GENGO 0173 03581 61

Course file Student file Score record file


course.txt student.txt recrd.txt
Fig. 2 Read-in files (sample)

(3) By first calling function init , this program creates the list structures as shown in
Fig. 3 in the memory from the three types of files shown in Fig. 2. A course
name corresponding to a course key courseKey is stored in a char type array
courseName [courseKey] . Moreover, student information corresponding to
student key studentKey is expressed by a STUDENT type structure student
[studentKey]. A student name is stored in member studentName . A pointer
to the top of a list denoting the score record of this student is stored in member
rFirstCourse. The score record regarding each course completed by a student
is expressed by a RECORD type structure. A score is stored in member score. A
pointer to a course name is stored in member courseName . A pointer to the
score record of another completed course is stored in member rNextCourse.

368
Afternoon Exam Section 12 Software Development (C)

courseName[0] courseName[1] courseName[2]


Information Information Numerical
Numerical
Processing 1 Processing 2 Analysis
analysis …

student[0] RECORD
Hanako SEKKEI 38

student[1] RECORD
Taro JOHO 75

student[2] RECORD RECORD


Jiro KAIHATSU 47 71 score


rNextCourse
studentName courseName
rFirstCourse

Fig. 3 Example of data structures

(4) Descriptions of other functions defined in the program are as follows.

void regist (int courseKey, int studentKey, short s);


Function: A RECORD type structure is newly created, and score s is assigned to
member score. Moreover, information is set to specify that this is
accessed by using course key courseKey which is accessed by using
student key studentKey ,

void writeCourses();
Function: A list of course grades of all students is outputted to a file.
(5) The following library function is used in this program.

void *malloc (size_t size);


Function: A domain of size bytes is allocated in the memory, and a pointer to
the allocated domain is returned. If the memory allocation fails,
NULL is returned.

369
Afternoon Exam Section 12 Software Development (C)

[Program]
#include <stdio.h>
#include <stdlib.h>
#define NUM_STUDENT 15000 /* Number of student */
#define NUM_COURSE 2000 /* Number of courses */
#define MAX_WORD_LENGTH 21

struct RECORD { /* Course grade */


char *courseName; /* Pointer to course name */
short score; /* Score */
struct RECORD *rNextCourse;
/* Pointer to the next course grade */
};

struct STUDENT { /* Student information */


char studentName[MAX_WORD_LENGTH];
/* Student name */
struct RECORD *rFirstCourse;
/* Pointer to the first course grade */
} student[NUM_STUDENT];

char courseName[NUM_COURSE][MAX_WORD_LENGTH];
/* Array of course names */

void init();
void regist(int, int, short);
void writeCourses();

void init(){
FILE *fStudent = fopen("student.txt", "r");
FILE *fCourse = fopen("course.txt", "r");
FILE *fRecord = fopen("record.txt", "r");
int studentKey, courseKey, score;
while(fscanf(fCourse, "%d", &courseKey) != EOF){
fscanf(fCourse, "%s", courseName[courseKey]);
}
while(fscanf(fStudent, "%d", &studentKey) != EOF){
fscanf(fStudent, "%s", student[studentKey].studentName);

370
Afternoon Exam Section 12 Software Development (C)

student[studentKey].rFirstCourse = NULL;
}
while(fscanf(fRecord, "%d %d %d", &courseKey, &studentKey,
&score) != EOF){
regist(courseKey, studentKey, (short)score);
}
fclose(fStudent);
fclose(fCourse);
fclose(fRecord);
}

void regist(int courseKey, int studentKey, short s){


struct RECORD *p; α
if ((p = (struct RECORD *)malloc(sizeof(struct RECORD)))
== NULL){
printf(“A memory error occurred\n”);
exit(-1);
}
p->rNextCourse = student[studentKey].rFirstCourse;
β
student[studentKey].rFirstCourse = a ;

p->courseName = b ;
p->score = s;
}

void writeCourses(){
FILE *fOutput = fopen("output.txt", "w");
struct RECORD *p;
int i;
for (i = 0; i < NUM_STUDENT; i++){
fprintf(fOutput, "%05d %-24s ", i,
student[i].studentName);
p = student[i].rFirstCourse;
while(p != NULL){
fprintf(fOutput, "%-24s %3d ", c );
p = p->rNextCourse;
}
fprintf(fOutput, "\n");
}

371
Afternoon Exam Section 12 Software Development (C)

fclose(fOutput);
}

Subquestion 1
From the answer groups below, select the correct answers to be inserted into the blanks
in the above program.

Answer group for a:


a) &p b) &p++ c) NULL d) p e) p++

Answer group for b:


a) &courseName b) *courseName[courseKey]
c) courseNamed)
courseName[courseKey]
e) p->rNextCourse->courseName

Answer group for c:


a) &p->courseName, &p->score b) &p->courseName, p->score
c) *p->courseName, *p->score d) *p->courseName, p->score
e) p->courseName, &p->score f) p->courseName, *p->score
g) p->courseName, p->score

Subquestion 2
From the answer group below, select the correct answer in terms of the order in which
course names are outputted in the list of course grades illustrated in Fig. 1.

372
Afternoon Exam Section 12 Software Development (C)

Answer group:
a) The smaller the value of a course key, the earlier the course name is outputted.
b) The smaller the value of a course key, the later the course name is outputted.
c) The earlier a course was registered by function regist , the earlier the course name
is outputted.
d) The earlier a course was registered by function regist , the later the course name is
outputted.
e) Course names are outputted in ascending order of the numbers of course attendees.
f) Course names are outputted in descending order of the numbers of course attendees.

Subquestion 3
From the answer group below, select the correct answers to be inserted into the blanks
in the following description.

α and β in function regist were changed as follows, in order that course names will be
outputted in descending order of scores in the list of course grades illustrated in Fig. 1.
In this regard, it is assumed that the correct answer is already inserted into a .

Action Description of changes to program


struct RECORD *p;
α is replaced
by. struct RECORD *q;

q = student[studentKey].rFirstCourse;
β is replaced
by. if ( d ) {
p->rNextCourse = q;
student[studentKey].rFirstCourse = a ;
} else {
while( e ){
q = q->rNextCourse;
}
p->rNextCourse = q->rNextCourse;
q->rNextCourse = a ;

373
Afternoon Exam Section 12 Software Development (C)

Answer group:
a) q != NULL && q->score < s
b) q != NULL && q->score > s
c) q == NULL || q->score < s
d) q == NULL || q->score > s
e) q->rNextCourse != NULL && q->rNextCourse->score < s
f) q->rNextCourse != NULL && q->rNextCourse->score > s
g) q->rNextCourse == NULL || q->rNextCourse->score < s
h) q->rNextCourse == NULL || q->rNextCourse->score > s

374
Afternoon Exam Section 12 Software Development (COBOL)

12.2 Software Development (COBOL)

Q12-4 
Read the following description of a COBOL program and the program itself, and then
answer Subquestions 1 and 2.

[Description of Program]
The program reads a grade file in which grade data for practice exams in three main
school courses is stored, and creates a grade-ranking file that appends a ranking for each
course.

(1) The record format for the grade file is as follows.

Examinee Japanese English


Math score
ID score score

(i) Examinee ID is a 5-digit number, and the number of examinees is less than
1000.
(ii) Scores for Japanese, Math, and English are recorded as 3-digit numbers, with
100 the highest score.

(2) The record format for the grade-ranking file is as follows.

(1) (2) (3)


Examinee
Japanese Japanese Math Math English English
ID
score ranking score ranking score ranking

(i) For each course, ranking is calculated in the order of highest score. In the case of
equal scores, equal ranking is applied.
Example: Score Ranking
100 1
98 2
98 2
97 4
: :
(ii) Records are written in ascending order of examinee ID.

375
Afternoon Exam Section 12 Software Development (COBOL)

[Program]
(Line number)
1 DATA DIVISION.
2 FILE SECTION.
3 FD IN-FILE.
4 01 IN-REC.
5 03 IN-NO PIC X(05).
6 03 IN-TEN PIC 9(03) OCCURS 3.
7 FD OUT-FILE.
8 01 OUT-REC.
9 03 OUT-NO PIC X(05).
10 03 OUT-ARIA OCCURS 3.
11 05 O-TEN PIC 9(03).
12 05 O-JUNI PIC 9(03).
13 FD TEMP-FILE.
14 01 TEMP-REC.
15 03 TEMP-KBN PIC 9(01).
16 03 TEMP-NO PIC X(05).
17 03 TEMP-TEN PIC 9(03).
18 03 TEMP-JUNI PIC 9(03).
19 SD SORT-FILE.
20 01 SORT-REC.
21 03 SD-KBN PIC 9(01).
22 03 SD-NO PIC 9(05).
23 03 SD-TEN PIC 9(03).
24 03 SD-JUNI PIC 9(03).
25 WORKING-STORAGE SECTION.
26 01 END-FLG PIC X(03) VALUE "ON".
27 88 END-FLG-EOF VALUE "OFF".
28 88 END-FLG-SOF VALUE "ON".
29 01 I PIC 9(01).
30 01 WK-KBN PIC 9(01).
31 01 WK-TEN PIC 9(03).
32 01 WK-JUNI PIC 9(03).
33 01 WK-CNT PIC 9(03).
34 PROCEDURE DIVISION.
35 PRG-SYORI.
36 SORT SORT-FILE A
37 INPUT PROCEDURE IN1-SYORI
38 GIVING TEMP-FILE
39 SORT SORT-FILE B
40 INPUT PROCEDURE IN2-SYORI
41 OUTPUT PROCEDURE OUT-SYORI
42 STOP RUN.
43 IN1-SYORI.

376
Afternoon Exam Section 12 Software Development (COBOL)

44 OPEN INPUT IN-FILE OUTPUT TEMP-FILE.


45 PERFORM UNTIL END-FLG-EOF
46 READ IN-FILE AT END SET END-FLG-EOF TO TRUE
47 NOT AT END
48 MOVE IN-NO TO SD-NO
49 PERFORM VARYING I FROM 1 BY 1 UNTIL I > 3
50 MOVE I TO SD-KBN
51 MOVE IN-TEN(I) TO SD-TEN
52 RELEASE SORT-REC
53 END-PERFORM
54 END-READ
55 END-PERFORM.
56 CLOSE IN-FILE TEMP-FILE.
57 IN2-SYORI.
58 OPEN INPUT TEMP-FILE.
59 SET END-FLG-SOF TO TRUE.
60 PERFORM TEMP-READ.
61 PERFORM UNTIL END-FLG-EOF
62 MOVE TEMP-KBN TO WK-KBN
63 MOVE TEMP-TEN TO WK-TEN
64 C
65 PERFORM UNTIL TEMP-KBN NOT = WK-KBN OR END-FLG-EOF
66 MOVE TEMP-KBN TO SD-KBN
67 MOVE TEMP-NO TO SD-NO
68 MOVE TEMP-TEN TO SD-TEN
69 IF TEMP-TEN < WK-TEN
70 D
71 MOVE TEMP-TEN TO WK-TEN
72 END-IF
73 MOVE WK-JUNI TO SD-JUNI
74 RELEASE SORT-REC
75 PERFORM TEMP-READ
76 ADD 1 TO WK-CNT
77 END-PERFORM
78 END-PERFORM.
79 CLOSE TEMP-FILE.
80 OUT-SYORI.
81 OPEN OUTPUT OUT-FILE.
82 SET END-FLG-SOF TO TRUE.
83 PERFORM SORT-READ.
84 PERFORM UNTIL END-FLG-EOF
85 MOVE SD-NO TO OUT-NO
86 PERFORM VARYING I FROM 1 BY 1 UNTIL I > 3 OR END-FLG-EOF
87 MOVE SD-TEN TO O-TEN( E )
88 MOVE SD-JUNI TO O-JUNI( E )

377
Afternoon Exam Section 12 Software Development (COBOL)

89 PERFORM SORT-READ
90 END-PERFORM
91 WRITE OUT-REC
92 END-PERFORM.
93 CLOSE OUT-FILE.
94 TEMP-READ.
95 READ TEMP-FILE AT END SET END-FLG-EOF TO TRUE.
96 SORT-READ.
97 RETURN SORT-FILE AT END SET END-FLG-EOF TO TRUE.

Subquestion 1
From the answer groups below, select the correct answer to be inserted in each blank
in the above program.

Answer group for A and B


a) ASCENDING KEY SD-KBN
b) ASCENDING KEY SD-NO
c) ASCENDING KEY SD-KBN SD-TEN
d) ASCENDING KEY SD-KBN DESCENDING KEY SD-TEN
e) DESCENDING KEY SD-KBN
f) DESCENDING KEY SD-NO
g) DESCENDING KEY SD-TEN ASCENDING KEY SD-KBN

Answer group for C and D


a) ADD 1 TO WK-JUNI
b) COMPUTE WK-JUNI = WK-JUNI + WK-CNT
c) INITIALIZE WK-CNT WK-JUNI
d) MOVE 1 TO WK-CNT
e) MOVE 1 TO WK-CNT WK-JUNI
f) MOVE 1 TO WK-JUNI
g) MOVE WK-CNT TO WK-JUNI

Answer group for E


a) I b) I + 1 c) I – 1 d) SD-KBN

378
Afternoon Exam Section 12 Software Development (COBOL)

Subquestion 2
The program is to be modified to enable output of the total scores for the three courses,
and the rankings of the total scores. From the answer group below, select the correct answer
to be inserted in the blank in the following description.

Table Contents of modifications to the program


Modification Contents of modifications to the program
Replace Line 10 03 OUT-ARIA OCCURS 4.
MOVE 4 TO SD-KBN
Insert between
COMPUTE SD-TEN = IN-TEN(1) + IN-TEN(2) + IN-TEN(3)
Lines F
RELEASE SORT-REC
Replace Line 86 PERFORM VARYING I FROM 1 BY 1 UNTIL I > 4 OR EOF

Answer group for F


(a) 45 and 46 (b) 47 and 48
(c) 52 and 53 (d) 53 and 54
(e) 55 and 56

379
Afternoon Exam Section 12 Software Development (COBOL)

Q12-5 
Read the following description of a COBOL program and the program itself, and then
answer Subquestions 1 and 2.

[Explanation on the Program]


This is a program used by a railroad with 10 stations named A through J. The program
reads a passenger file which records, for a day, the train stations where the passengers got
on, got off, and what time the passengers got on the trains; the program then counts how
many people used the trains between two adjacent train stations and prints out the results.
(1) The passenger file (IN-FILE) is a sequential file of the following record format. For
each use by each passenger, a record is created.

Starting Station Ending Station Starting Time


2 digits 2 digits 4 digits

(i) Passengers in both directions are recorded, unsorted.


(ii) The starting time is recorded in the HHMM format. Here, the HH indicates the
hour in the 24-hour convention, and the MM indicates the minute.
Each station opens at 6 A.M. and closes at midnight. Passengers cannot stay in
the stations or on trains when the stations are closed.
(iii) The starting and ending stations are recorded by numbers 01 through 10 assigned
to the ten stations. The ending station must be different from the starting station.
“01” is Station A, “02” is Station B, “03” is Station C, “04” is Station D, etc. and
“10” is Station J.
(Example) The following record shows a passenger who got on a train at 6:55 at
Station B and got off at Station D.

02 04 0655

(2) The print format is as follows:

TIME A-B B-C C-D D-E … I-J


06:00 UP ZZZ,ZZ9 ZZZ,ZZ9 ZZZ,ZZ9 ZZZ,ZZ9 … ZZZ,ZZ9
DOWN ZZZ,ZZ9 ZZZ,ZZ9 ZZZ,ZZ9 ZZZ,ZZ9 … ZZZ,ZZ9
07:00 UP ZZZ,ZZ9 ZZZ,ZZ9 ZZZ,ZZ9 ZZZ,ZZ9 … ZZZ,ZZ9
DOWN ZZZ,ZZ9 ZZZ,ZZ9 ZZZ,ZZ9 ZZZ,ZZ9 … ZZZ,ZZ9

23:00 UP ZZZ,ZZ9 ZZZ,ZZ9 ZZZ,ZZ9 ZZZ,ZZ9 … ZZZ,ZZ9


DOWN ZZZ,ZZ9 ZZZ,ZZ9 ZZZ,ZZ9 ZZZ,ZZ9 … ZZZ,ZZ9

380
Afternoon Exam Section 12 Software Development (COBOL)

(i) TIME indicates the hour period in which the trains were used. For example, the
line 07:00 represents ridership between 7 A.M. and 7:59 A.M.
(ii) “A-B” to “I-J” show the segments of two adjacent train stations. For example,
“A-B” indicates the segment between Station A and Station B.
(iii) “UP” means inbound (direction from A to J), and “DOWN” means outbound
(direction from J to A).
(iv) The number of passengers is counted according to the lapsed time and the
segment, based on the starting time. It is assumed that it takes 10 minutes
between each pair of adjacent stations and that waiting time and transfer time
are ignored. For example, consider the passenger who “got on a train at Station
B at 6:55 and got off at D” in Example (1) (iii) above. That passenger is
included and counted as one passenger in each of the two shaded cells below.
Each number shall be 999,999 or less.

TIME A-B B-C C-D D-E … I-J


06:00 UP ZZZ,ZZ9 ZZZ,ZZ9 ZZZ,ZZ9 ZZZ,ZZ9 … ZZZ,ZZ9
DOWN ZZZ,ZZ9 ZZZ,ZZ9 ZZZ,ZZ9 ZZZ,ZZ9 … ZZZ,ZZ9
07:00 UP ZZZ,ZZ9 ZZZ,ZZ9 ZZZ,ZZ9 ZZZ,ZZ9 … ZZZ,ZZ9
DOWN ZZZ,ZZ9 ZZZ,ZZ9 ZZZ,ZZ9 ZZZ,ZZ9 … ZZZ,ZZ9

23:00 UP ZZZ,ZZ9 ZZZ,ZZ9 ZZZ,ZZ9 ZZZ,ZZ9 … ZZZ,ZZ9


DOWN ZZZ,ZZ9 ZZZ,ZZ9 ZZZ,ZZ9 ZZZ,ZZ9 … ZZZ,ZZ9

[Program]
(Line Number)
1 DATA DIVISION.
2 FILE SECTION.
3 FD IN-FILE.
4 01 IN-REC PIC X(8).
5 FD PR-FILE.
6 01 PR-REC PIC X(100).
7 WORKING-STORAGE SECTION.
8 01 W-IN-REC.
9 02 IN-STATION PIC 9(2).
10 02 OUT-STATION PIC 9(2).
11 02 IN-TIME.
12 03 IN-HH PIC 9(2).
13 03 IN-MM PIC 9(2).
14 01 COUNT-TABLE.
15 02 UP-TABLE OCCURS 18.
16 03 UP-PASSENGER OCCURS 9 PIC 9(6) VALUE ZERO.
17 02 DOWN-TABLE OCCURS 18.
18 03 DOWN-PASSENGER OCCURS 9 PIC 9(6) VALUE ZERO.

381
Afternoon Exam Section 12 Software Development (COBOL)

19 77 READ-SW PIC X(1) VALUE SPACE.


20 88 AT-END VALUE "E".
21 77 WAY PIC S9(1).
22 88 UP-WAY VALUE 1.
23 88 DOWN-WAY VALUE -1.
24 77 TIME-IDX PIC S9(2).
25 77 TIME-CNT PIC S9(2).
26 77 SECT-IDX PIC S9(2).
27 01 W-PR-HEADER.
28 02 PIC X(15) VALUE "TIME".
29 02 PIC X(50) VALUE
30 "A-B B-C C-D D-E E-F".
31 02 PIC X(35) VALUE
32 "F-G G-H H-I I-J".
33 01 W-PR-REC.
34 02 PR-TIME.
35 03 PR-HH PIC 9(2).
36 03 PR-MM PIC X(4).
37 02 PR-WAY PIC X(4).
38 02 OCCURS 9.
39 03 PIC X(3) VALUE SPACE.
40 03 PR-PASSENGER PIC ZZZ,ZZ9.
41 PROCEDURE DIVISION.
42 MAIN-PROCEDURE.
43 OPEN INPUT IN-FILE OUTPUT PR-FILE.
44 PERFORM TEST BEFORE UNTIL AT-END
45 READ IN-FILE AT END SET AT-END TO TRUE
46 NOT AT END MOVE IN-REC TO W-IN-REC
47 PERFORM COUNT-PASSENGER
48 END-READ
49 END-PERFORM.
50 PERFORM PRINT-DATA.
51 CLOSE IN-FILE PR-FILE.
52 STOP RUN.
53 COUNT-PASSENGER.
54 IF A THEN
55 SET UP-WAY TO TRUE
56 ELSE
57 SET DOWN-WAY TO TRUE
58 END-IF.
59 COMPUTE TIME-IDX = IN-HH - 5.
60 MOVE IN-MM TO TIME-CNT.
61 PERFORM VARYING SECT-IDX FROM IN-STATION BY WAY
62 UNTIL SECT-IDX = OUT-STATION
63 IF UP-WAY THEN
64 ADD 1 TO UP-PASSENGER(TIME-IDX, SECT-IDX)

382
Afternoon Exam Section 12 Software Development (COBOL)

65 ELSE
66 ADD 1 TO DOWN-PASSENGER( B )
67 END-IF
68 COMPUTE TIME-CNT = TIME-CNT + 10
69 IF C THEN
70 COMPUTE TIME-IDX = TIME-IDX + 1
71 COMPUTE TIME-CNT = TIME-CNT - 60
72 END-IF
73 END-PERFORM.
74 PRINT-DATA.
75 WRITE PR-REC FROM W-PR-HEADER.
76 PERFORM VARYING TIME-IDX FROM 1 BY 1
77 UNTIL TIME-IDX > 18
78 COMPUTE PR-HH = TIME-IDX + 5
79 MOVE ":00" TO PR-MM
80 MOVE "UP" TO PR-WAY
81 PERFORM VARYING SECT-IDX FROM 1 BY 1
82 UNTIL SECT-IDX > 9
83 MOVE UP-PASSENGER(TIME-IDX, SECT-IDX)
84 TO PR-PASSENGER( D )
85 END-PERFORM
86 WRITE PR-REC FROM W-PR-REC
87 MOVE SPACE TO PR-TIME
88 MOVE "DOWN" TO PR-WAY
89 PERFORM VARYING SECT-IDX FROM 1 BY 1
90 UNTIL SECT-IDX > 9
91 MOVE DOWN-PASSENGER(TIME-IDX, SECT-IDX)
92 TO PR-PASSENGER( D )
93 END-PERFORM
94 WRITE PR-REC FROM W-PR-REC
95 END-PERFORM.

Subquestion 1
From the answer groups below, select the correct answer to be inserted in each blank
in the above program.

Answer group for A and C:


a) IN-STATION < 5 b) IN-STATION < OUT-STATION
c) IN-STATION > 5 d) IN-STATION > OUT-STATION
e) TIME-CNT = 60 f) TIME-CNT >= 60
g) TIME-IDX = 0 h) TIME-IDX NOT = 0

383
Afternoon Exam Section 12 Software Development (COBOL)

Answer group for B and D:


a) SECT-IDX b) SECT-IDX, TIME-IDX
c) TIME-IDX - 1, SECT-IDX d) TIME-IDX + 1, SECT-IDX
e) TIME-IDX f) TIME-IDX, SECT-IDX - 1
g) TIME-IDX, SECT-IDX + 1 h) TIME-IDX, SECT-IDX

Subquestion 2
To count the number of passengers for each segment more accurately, a table that
indicates how many minutes it takes to travel between each pair of adjacent stations is
prepared, and modify the program so that the lapse time can be obtained from the table.
From the answer group below, select the correct answer to be inserted in each blank
in the following table.

Action Contents of the Program Change


Adding between 01 TIME-TABLE.

Lines 40 and 41 02 TIME-DATA PIC X(18) VALUE "080611071009081013".


02 SECT-MM REDEFINES TIME-DATA PIC 9(2) OCCURS 9.

Adding between COMPUTE TIME-CNT = E


Lines 64 and 65
Adding between COMPUTE TIME-CNT = F
Lines 66 and 67
Delete Line 68

Answer group:
a) 60 - SECT-MM(SECT-IDX)
b) 60 - SECT-MM(TIME-IDX)
c) TIME-CNT + SECT-MM(SECT-IDX)
d) TIME-CNT + SECT-MM(SECT-IDX + 1)
e) TIME-CNT + SECT-MM(SECT-IDX - 1)
f) TIME-CNT + SECT-MM(TIME-IDX)
g) TIME-CNT + SECT-MM(TIME-IDX + 1)
h) TIME-CNT + SECT-MM(TIME-IDX - 1)

384
Afternoon Exam Section 12 Software Development (COBOL)

Q12-6 
Read the following description of a COBOL program and the program itself, and then
answer Subquestions 1 and 2.

[Program Description]
This is a program for creating a list of caregivers (such as parents) for students at an
elementary school. The program outputs a caregiver list for the current year, using the
caregiver list for last year and the caregiver list for new students (new first-year students) as
input.
(1) Caregiver lists for the current and last year are sequential files with records in
the following format.

Existing Student Existing Student


Caregiver Name Tel. No.
20 characters 13 digits Grade Student Name Grade Student Name
1 digit 20 characters 1 digit 20 characters

There are five student entries

(i) Records are sorted in ascending order by the first 33 columns of data,
representing the caregiver name and telephone number.
(ii) The academic year (grade) and name of existing students are stored in the
Existing Student section.
(iii) If there are two or more existing students, they are sorted by grade in
ascending order.
(iv) If there are four or fewer existing students per caregiver, they are stored
left-justified, with the remaining fields left blank.
Example: Information for a caregiver with existing students in 3rd and 5th
grade is stored as follows.

Ken Smith 03-1234-5678 3 John Smith 5 Mike Smith Blank

(2) Caregiver list for new students is sequential files with records in the following
format.

Caregiver Name Tel. No. Student Name Student Name


20 characters 13 digits 20 characters 20 characters

There are five student entries

385
Afternoon Exam Section 12 Software Development (COBOL)

(i) Records are sorted in ascending order by the first 33 columns of data,
representing the caregiver name and telephone number.
(ii) The names of the new students are stored in the Student Name fields.
(iii) If there are four or fewer new students per caregiver, they are stored
left-justified, with the remaining fields left blank.
(3) Assume that one caregiver has no more than five students.
(4) Each student’s grade is unconditionally increased by one. When 6th grade is
completed, the student graduates.
(5) Need not take account of transfer students who enter or leave the school.
(6) A caregiver’s record is removed when all of their students graduate and they
have no new students.
(7) New records are created for unregistered caregivers of new students.

[Program]
(Line number)
1 DATA DIVISION.
2 FILE SECTION.
3 FD OLD-FILE.
4 01 OLD-REC PIC X(138).
5 FD NEW-FILE.
6 01 NEW-REC PIC X(138).
7 FD ENT-FILE.
8 01 ENT-REC PIC X(133).
9 WORKING-STORAGE SECTION.
10 01 W-OLD-REC.
11 02 OLD-ID VALUE SPACE.
12 88 OLD-EOF VALUE HIGH-VALUE.
13 03 OLD-PARENT PIC X(20).
14 03 OLD-TEL PIC X(13).
15 02 OLD-PUPIL OCCURS 5 TIMES.
16 03 OLD-NUM PIC 9(1).
17 03 OLD-NAME PIC X(20).
18 01 W-NEW-REC.
19 02 NEW-ID.
20 03 NEW-PARENT PIC X(20).
21 03 NEW-TEL PIC X(13).
22 02 NEW-PUPIL OCCURS 5 TIMES.
23 03 NEW-NUM PIC 9(1).
24 03 NEW-NAME PIC X(20).
25 01 W-ENT-REC.
26 02 ENT-ID VALUE SPACE.
27 88 ENT-EOF VALUE HIGH-VALUE.

386
Afternoon Exam Section 12 Software Development (COBOL)

28 03 ENT-PARENT PIC X(20).


29 03 ENT-TEL PIC X(13).
30 02 ENT-NAME OCCURS 5 TIMES PIC X(20).
31 01 OLD-CNT PIC 9(1).
32 01 NEW-CNT PIC 9(1).
33 01 ENT-CNT PIC 9(1).
34 01 READ-FLAG PIC X(1) VALUE "B".
35 88 READ-BOTH VALUE "B".
36 88 READ-OLD-FILE VALUE "O".
37 88 READ-ENT-FILE VALUE "E".
38 PROCEDURE DIVISION.
39 MAIN-PROC.
40 OPEN INPUT OLD-FILE ENT-FILE OUTPUT NEW-FILE.
41 PERFORM UNTIL OLD-EOF AND ENT-EOF
42 IF READ-OLD-FILE OR READ-BOTH THEN
43 READ OLD-FILE INTO W-OLD-REC
44 AT END SET OLD-EOF TO TRUE
45 END-READ
46 END-IF
47 IF READ-ENT-FILE OR READ-BOTH THEN
48 READ ENT-FILE INTO W-ENT-REC
49 AT END SET ENT-EOF TO TRUE
50 END-READ
51 END-IF
52 IF A THEN
53 PERFORM CREATE-PROC
54 END-IF
55 END-PERFORM.
56 CLOSE OLD-FILE ENT-FILE NEW-FILE.
57 STOP RUN.
58 CREATE-PROC.
59 MOVE SPACE TO W-NEW-REC.
60 EVALUATE TRUE
61 WHEN OLD-ID < ENT-ID
62 PERFORM NUM-UP-PROC
63 B
64 SET READ-OLD-FILE TO TRUE
65 WHEN OLD-ID = ENT-ID
66 PERFORM NUM-UP-PROC
67 MOVE OLD-ID TO NEW-ID
68 PERFORM ENT-ADD-PROC
69 MOVE 1 TO OLD-CNT
70 PERFORM VARYING NEW-CNT FROM ENT-CNT BY 1
71 UNTIL NEW-CNT > 5
72 C
73 ADD 1 TO OLD-CNT

387
Afternoon Exam Section 12 Software Development (COBOL)

74 END-PERFORM
75 SET READ-BOTH TO TRUE
76 WHEN OLD-ID > ENT-ID
77 MOVE ENT-ID TO NEW-ID
78 PERFORM ENT-ADD-PROC
79 SET READ-ENT-FILE TO TRUE
80 END-EVALUATE.
81 IF NEW-PUPIL(1) NOT = SPACE THEN
82 WRITE NEW-REC FROM W-NEW-REC
83 END-IF.
84 NUM-UP-PROC.
85 PERFORM VARYING OLD-CNT FROM 1 BY 1
86 UNTIL OLD-CNT > 5 OR OLD-PUPIL(OLD-CNT) = SPACE
87 IF OLD-NUM(OLD-CNT) < 6 THEN
88 D
89 ELSE
90 MOVE SPACE TO OLD-PUPIL(OLD-CNT)
91 END-IF
92 END-PERFORM.
93 ENT-ADD-PROC.
94 PERFORM VARYING ENT-CNT FROM 1 BY 1
95 UNTIL ENT-CNT > 5 OR ENT-NAME(ENT-CNT) = SPACE
96 MOVE 1 TO NEW-NUM(ENT-CNT)
97 MOVE ENT-NAME(ENT-CNT) TO NEW-NAME(ENT-CNT)
98 END-PERFORM.

Subquestion 1
From the answer groups below, select the correct answer to insert in each blank
in the above program.

Answer group for A:


a) NOT (OLD-EOF AND ENT-EOF)
b) NOT (OLD-EOF OR ENT-EOF)
c) OLD-EOF AND ENT-EOF
d) OLD-EOF OR ENT-EOF

388
Afternoon Exam Section 12 Software Development (COBOL)

Answer group for B, C, and D:


a) ADD 1 TO OLD-NUM(OLD-CNT)
b) MOVE OLD-ID TO NEW-ID
c) MOVE OLD-PUPIL(ENT-CNT) TO NEW-PUPIL(NEW-CNT)
d) MOVE OLD-PUPIL(OLD-CNT) TO NEW-PUPIL(NEW-CNT)
e) MOVE W-OLD-REC TO W-NEW-REC
f) PERFORM ENT-ADD-PROC

Subquestion 2
Modify the program to display the name and telephone number of caregivers who have
been removed from the list—that is, caregivers who were registered on the list last year but
not this year. Select the correct answer from the answer group.

Answer group:
a)
Action New Program Contents
Add between lines 53 ELSE
and 54 DISPLAY "REMOVED DATA = " OLD-ID

b)
Action New Program Contents
Add between lines ELSE
82 and 83 DISPLAY "REMOVED DATA = " OLD-ID

c)
Action New Program Contents
Add between lines
DISPLAY "REMOVED DATA = " OLD-ID
90 and 91

d)
Action New Program Contents
Add between lines
DISPLAY "REMOVED DATA = " OLD-ID.
92 and 93

389
Afternoon Exam Section 12 Software Development (Java)

12.3 Software Development (Java)

Q12-7 
Read the following description of a Java program and the program itself, and then,
answer the Subquestion.

[Explanation on the Program]


This is a program that plays a one-person card game. The rules of the game are as
follows:
(1) The deck of cards contains the four suits: spades, hearts, diamonds, and clubs. Each
suit has an A (ace), 2 through 10, a J (jack), a Q (queen), and a K (king),
respectively with the ranks 1 through 13. The game uses a total of 52 cards, and the
suits are irrelevant.
(2) The 52 cards are flipped, one card at a time, and placed face up side by side. After
four cards are placed, move down to another row below the first, again lining up the
cards from the left. The area where the cards are placed is called the ground, and
each line of cards is called a row.
(3) As shown in the figure, every time a card is placed in Step (2), check to see if the
card has the same rank as an adjacent card—above, below, side, or diagonal. If the
new card makes a pair of cards with the same rank (referred to as a “pair”), the pair
is removed ( 7 in the figure), filling in the empty spaces. A card at the end of a row
is not considered adjacent to the card that starts the next row. If more than one pair
is formed (two each of 8 and 3 ), remove the pair containing the card that has
been on the ground the longest ( 8 ). If there is more than one such pair, remove the
pair containing the card that has been on the ground the longest among those cards
making pairs with the cards that have been there the longest ( 3 ).
(4) Repeat Step (3) until all adjacent cards have different ranks.

390
Afternoon Exam Section 12 Software Development (Java)

3 8 3 A 3 8 3 A 3 3 A 2

2 4 7 8 2 4 8 3 4 3

3 7

A 2 4 3

(5) Repeat Steps (2) through (4) until all the cards in the hand are gone.
(6) The game is won if all the cards are removed from the ground when all the cards in
the hand are gone.

The class Card represents the deck of cards. During its initialization, this class generates
the Card instances corresponding to the 13 ranks from the ace to the king in all four suits
and stores them in a Card array cards. These instances are immutable so that the same
instance always corresponds to a particular card. For example, there is only one Card
instance representing the ace of hearts. Class method newDeck shuffles the cards randomly
and returns the array of Cards as a deck.
Class Game executes this game. The List instance list represents the ground where the
cards are placed, and a card is taken, one at a time, from deck to be added to list . Each
time this occurs, method checkAndRemove is called on to remove adjacent cards that make
up “pairs.”
Class java.util.Random generates random numbers. Method nextInt(int n) returns
the random numbers from the range 0 to n - 1 in the int type.
Interface java.util.List represents a list structure, and each element is designated by
an index. The first element of the list is designated by the index number 0. Method
add(Object obj) adds the given object obj at the end of the list. Method get(int index)
returns the object of the element designated by index. Method remove(int index)
removes the object of the element designated by index; if there are objects on and after
“index + 1,” they are shifted to fill the empty position. Method size( ) returns the number
of objects in the list in the int type.
Class java.util.ArrayList implements interface List using an array.

391
Afternoon Exam Section 12 Software Development (Java)

[Program 1]
import java.util.Random;

public class Card {


public static final int SPADES = 0;
public static final int HEARTS = 1;
public static final int DIAMONDS = 2;
public static final int CLUBS = 3;

private static final Random rand = new Random();


private static final Card[] cards = new Card[13 * 4];
private final int suit;
private final int rank;

A
for (int i = SPADES; i <= CLUBS; i++) {
for (int j = 1; j <= 13; j++) {
cards[ B ] = new Card(i, j);
}
}
}

private Card(int suit, int rank) {


this.suit = suit;
this.rank = rank;
}

public int getSuit() { return suit; }


public int getRank() { return rank; }

public static Card[] newDeck() {


Card[] deck = new Card[cards.length];
System.arraycopy(cards, 0, deck, 0, cards.length);
for (int i = cards.length - 1; i > 0; i--) {
int index = rand.nextInt(i + 1);
Card tmp = deck[i];
deck[i] = deck[index];
deck[index] = tmp;

392
Afternoon Exam Section 12 Software Development (Java)

}
return deck;
}
}

[Program 2]
import java.util.ArrayList;
import java.util.List;

public class Game {


// relative index from the card currently in focus
private static final int[][] indexDiff = {
{ 1, 4, 5 },
{ 1, 3, 4, 5 },
{ 1, 3, 4, 5 },
{ 3, 4 }
};

private static void checkAndRemove(List list) {


// Compare adjacent cards from the beginning of list
// currentIndex is the index value of the card currently in focus
for (int currentIndex = 0; currentIndex < list.size();
currentIndex++) {
// currentRank is the rank of the card currently in focus
int currentRank =
((Card) list.get(currentIndex)).getRank();
// Find the indices of cards adjacent to the card currently
// in focus
int[] diffList = indexDiff[currentIndex % 4];
for (int i = 0; i < diffList.length; i++) {
// adjacentIndex is the index value to adjacent card
int adjacentIndex = C ;
if ( D
&& ((Card) list.get(adjacentIndex)).
getRank()
== currentRank) {
list.remove(adjacentIndex);

393
Afternoon Exam Section 12 Software Development (Java)

list.remove( E );
checkAndRemove(list);
return;
}
}
}
}

public static void main(String[] args) {


Card[] deck = Card.newDeck();
List list = new ArrayList();
for (int i = 0; i < deck.length; i++) {
list.add(deck[i]);
checkAndRemove(list);
}
if (list.size() == 0) {
System.out.println("You Have Won!");
} else {
System.out.println("Remaining" + list.size() + "cards");
}
}
}

Subquestion
From the answer groups, select the correct answers to be placed in the blanks
in the program.

Answer group for A:


a) private Card() { b) private static void init() {
c) private void init() { d) static {
e) synchronized { f) {

Answer group for B:


a) i * 13 + j b) i * 13 + j - 1
c) i * 4 + j - 1 d) j * 13 + i
e) j * 13 + i - 1 f) j * 4 + i - 1

394
Afternoon Exam Section 12 Software Development (Java)

Answer group for C:


a) currentIndex * diffList[i]
b) currentIndex + diffList[i]
c) currentIndex - diffList[i]
d) i * diffList[currentIndex]
e) i + diffList[currentIndex]
f) i - diffList[currentIndex]

Answer group for D:


a) adjacentIndex != list.size()
b) adjacentIndex < list.size()
c) adjacentIndex <= list.size()
d) adjacentIndex == list.size()
e) adjacentIndex > list.size()
f) adjacentIndex >= list.size()

Answer group for E:


a) 0 b) adjacentIndex
c) adjacentIndex - 1 d) currentIndex
e) currentIndex - 1 f) list.size() - 1

395
Afternoon Exam Section 12 Software Development (Java)

Q12-8 
Read the following description of a Java program and the program itself, and then answer
Subquestions 1 and 2.

At Company A, a system development company, a project team is composed of


employees of Company A (hereinafter “main members”) and employees of partner
Company B (hereinafter “sub members”). However, employee IDs follow code schemes
unique to each company, which creates numerous inconveniences in the unified
management of project members.
To ease the management of project members for a new project to be launched, the
company has decided to issue unified project member IDs to the constituent members.
For Company A employees: Employee IDs consist of a 2-digit number and a 5-digit
number, connected by a hyphen (e.g., 21-19436). Project member IDs will consist
of “A00” placed before the employee ID without the hyphen, creating a 10-digit
number.
For Company B employees: Employee IDs consist of the year the employee joined the
company, followed by four (4) numbers, for an 8-digit ID. Project member IDs
will consist of “B0” placed before the employee ID, creating a 10-digit number.

[Program Description]
(1) In class ProjectMember of Program 1, an employee ID and a name are defined as
data common to all project members. A method to return the employee ID and the
name is also defined.
(2) Interface ProjectMemberID of Program 2 is an interface for handling a 10-digit
project member ID. A method for returning a project member ID and a method for
comparing the magnitude of project member IDs are defined.
(3) Class MainMember in Program 3 represents a Company A employee. It inherits class
ProjectMember and also implements interface ProjectMemberId. It implements
method getProjectMemberId of interface ProjectMemberId that returns a project
member ID converted from a Company A employee ID.
(4) Class SubMember in Program 4 represents a Company B employee. It inherits class
ProjectMember and also implements interface ProjectMemberId. It implements
method getProjectMemberId of interface ProjectMemberId that returns a project
member ID converted from a Company B employee ID.

396
Afternoon Exam Section 12 Software Development (Java)

(5) Class PmApp in Program 5 is a class for testing. It issues project member IDs to a
total of five (5) project members (3 Company A employees and 2 Company B
employees), sorts them in ascending order of project member ID, and lists project
member IDs and names in order.

An example of program PmApp class execution is shown below.

>java PmApp
ProjectMember ID : A002119436
Member name: Yukimura Sanada
ProjectMember ID : A002220556
Member name: Ieyasu Tokugawa
ProjectMember ID : A006158910
Member name: Kenshin Uesugi
ProjectMember ID : B020051192
Member name: Nobunaga Oda
ProjectMember ID : B020071603
Member name: Shingen Takeda
>

[Program 1]
public class ProjectMember { // definition of project members
String memberId; // employee ID
String memberName; // name
ProjectMember(String id, String name){
memberId = id;
memberName = name;
}
// method that returns employee ID
public String getMemberId() {
return memberId;
}
// method that returns name
public String getMemberName() {
return memberName;
}
}

397
Afternoon Exam Section 12 Software Development (Java)

[Program 2]
// implementation of project member ID
interface ProjectMemberId {
String getProjectMemberId(); // returns project member ID
int biggerId(ProjectMemberId pi); // compares to size of project member ID
}

[Program 3]
// class that represents a Company A member
public class MainMember extends ProjectMember implements ProjectMemberId {
MainMember(String id, String name){
super(id, name);
}
// method that returns project member ID converted from Company A member ID
A String getProjectMemberId() {
StringBuffer sb = new StringBuffer("A00");
B ;
int i = C ;
sb.deleteCharAt(i);
return sb.toString();
}
// method that performs size comparison of project member IDs
A int biggerId(ProjectMemberId pi) {
return getProjectMemberId().compareTo(pi.getProjectMemberId());
}
}

398
Afternoon Exam Section 12 Software Development (Java)

[Program 4]
// class that handles Company B members
public class SubMember extends ProjectMember implements ProjectMemberId{
SubMember(String id, String name) {
super(id, name);
}
// method that converts Company B member ID to project member ID, and returns
it
A String getProjectMemberId() {
return "B0" + getMemberId();
}
// method that performs magnitude comparison of project member IDs
A int biggerId(ProjectMemberId pi) {
return getProjectMemberId().compareTo(pi.getProjectMemberId());
}
}

[Program 5]
// class for testing
public class PmApp {
public static void main(String[] args) {
// creates members
ProjectMemberId[] pi = new ProjectMemberId[5];
pi[0] = new MainMember("22-20556", "Ieyasu Tokugawa");
pi[1] = new SubMember("20071603", "Shingen Takeda");
pi[2] = new MainMember("61-58910", "Kenshin Uesugi");
pi[3] = new SubMember("20051192", "Nobunaga Oda");
pi[4] = new MainMember("21-19436", "Yukimura Sanada");
// sorts project member IDs in ascending order
// α
ProjectMemberId temp;
for (int i = pi.length - 1; i > 0; i--) {
for (int j = 0; j < i; j++) {
if ( D ) {
temp = pi[j];
pi[j] = pi[j + 1];
pi[j + 1] = temp;
}

399
Afternoon Exam Section 12 Software Development (Java)

}
}
// β
// performs output
for (int i = 0; i < pi.length; i++) {
System.out.println
("ProjectMember ID : " + pi[i].getProjectMemberId());
System.out.println("Member name : " +
((ProjectMember)pi[i]).getMemberName());
}
}
}

Subquestion 1
From the answer groups below, select the correct answer to be inserted in each blank
in the above program.

Answer group for A


a) private
b) protected
c) public
d) nothing inserted in the blank (i.e., leave blank)

Answer group for B


a) sb.append(getMemberId())
b) sb.append(getProjectMemberId())
c) sb.insert(0, getMemberId())
d) sb.insert(0, getProjectMemberId())

Answer group for C


a) sb.append("-") d) sb.capacity()
c) sb.indexOf("-") e) sb.length()

Answer group for D


a) pi[j] < pi[j+1]
b) pi[j] >= pi[j+1]
c) pi[j].biggerId(pi[j+1]) < 0
d) pi[j].biggerId(pi[j+1]) >= 0

400
Afternoon Exam Section 12 Software Development (Java)

Subquestion 2
The project is considerably large, with many members; as such, sorting needs to be
performed efficiently. The testing-purpose class PmApp performs a bubble sort to sort
project member IDs. The goal is to change this to quick sort to make sorting faster. The
section of the program between α and β in the problem text was modified as follows to call
method qSort, which performs quick sort.
qSort(pi, 0, pi.length-1);
Furthermore, method qSort, which performs quick sort, is implemented in PmApp. When
method qSort is defined per the below, then from the answer group below, select the correct
answer to be inserted in the in the following program.

public static void qSort(ProjectMemberId[] pi, int first, int last) {


ProjectMemberId x = pi[(first + last) / 2];
int i = first;
int j = last;
for (;;) {
while (pi[i].biggerId(x) < 0) i++;
while (x.biggerId(pi[j]) < 0) j--;
if (i >= j) break;
ProjectMemberId swap = pi[i];
pi[i] = pi[j];
pi[j] = swap;
i++;
j--;
}
E
}

401
Afternoon Exam Section 12 Software Development (Java)

Answer group
a) if (first < i-1) qSort(pi, first, i-1);
if (j+1 < last) qSort(pi, j+1, last);
b) if (first < i-1) qSort(pi, first, i-1);
if (j+1 > last) qSort(pi, j+1, last);
c) if (first > i-1) qSort(pi, first, i-1);
if (j+1 < last) qSort(pi, j+1, last);
d) if (first > i-1) qSort(pi, first, i-1);
if (j+1 > last) qSort(pi, j+1, last);

402
Afternoon Exam Section 12 Software Development (Java)

Q12-9 
Read the following description of Java program and the program itself, and then answer
the Subquestions 1 and 2. (Refer to the end of this booklet for the description of APIs used
in the Java programs.)

[Program Description]
This program checks a given string with a pattern for checking string (hereinafter
pattern). The pattern and the given string are strings that consist of zero or more characters.
Patterns are composed of the characters which bear the special meanings for matching
(hereinafter metacharacters) and other characters except metacharacters (hereinafter literal
characters). Table 1 shows metacharacters and their meanings.

Table 1 Metacharacters and their meanings

Metacharacter Meaning
^ Matches the beginning of the string
. Matches any one character
$ Matches the end of the string

Literal characters match the characters themselves. For example, a literal character “a”
matches one character “a”.
If the entire pattern matches the whole or part of the given string, it is determined that the
pattern matches the given string. When the number of characters in a pattern is zero, the
pattern matches any string. Table 2 shows the examples of patterns, strings that the patterns
match, and strings that the patterns do not match.

403
Afternoon Exam Section 12 Software Development (Java)

Table 2 Examples of patterns, strings that patterns match


and strings that patterns do not match
Sample strings that pattern Sample strings that pattern does not
Pattern
matches match
“” “”, “home” None
“home” “home”, “tachometer” “how”, “hope”, “me”
“^ho.e” “home”, “hope”, “hotel” “hot”, “hook”, “shore”
“ho..$” “home”, “hope”, “shore” “hop”, “hotel”, “hobby”

The program analyzes one character of the given pattern at a time and converts it into a
format that facilitates checking. The processes of analysis and conversion are called
compiling, and the converted unit for checking process is called a pattern element. A
metacharacter is converted into a pattern element that indicates the meaning of the
metacharacter, while a literal character is converted into a pattern element that indicates the
literal character. The whole pattern is represented by a list of pattern elements. For example,
the pattern “^ho.e” is divided into ‘^’, ‘h ’, ‘o’, ‘. ’, and ‘e’ and each character is converted
into the following pattern element:
(i) Pattern element indicating the beginning of the string
(ii) Pattern element indicating ‘h’
(iii) Pattern element indicating ‘o’
(iv) Pattern element indicating any one character
(v) Pattern element indicating ‘e’
Next, the pattern and the given string are checked by evaluating the list of the pattern
elements. The given string is checked sequentially from the first character with the pattern
elements in the list (in the above example, (i) to (v)). If all the pattern elements are matched
successively, it is determined that the pattern matches the given string.
Interface PatternElement represents a pattern element. Method matches checks
whether this pattern element matches the string str given in the argument from position
index. When they match, the method returns true; otherwise it returns false. The value of
index is greater than or equal to zero. Method length returns the length of the string that
matches this pattern element.
The following shows each class that implements interface PatternElement:
(1) Class OneChar is a pattern element that indicates one literal character.
(2) Class AnyChar is a pattern element that indicates any one character.
(3) Classes BeginningOfString and EndOfString are pattern elements that indicate
the beginning and the end of the string, respectively.

404
Afternoon Exam Section 12 Software Development (Java)

Class Pattern converts the given pattern in a constructor into a list of pattern elements.
Method matches compares the given string with the list of pattern elements. When they
match, it returns true; otherwise it returns false. Method main tests class Pattern.
Method main produces the output result shown in Fig. 1.

“ho.e$” matches “home”.


“ho.e$” matches “shore”.
“ho.e$” doesn't match “hotel”.

Fig. 1 Output result

In this program, it is assumed that one character can be represented as char .


Supplementary characters in Unicode are not considered.

[Program 1]
public interface PatternElement {
public boolean matches(String str, int index);
public int length();
}

[Program 2]
class OneChar implements PatternElement {
private final char ch;
OneChar(char ch) { this.ch = ch; }
// When the character at position index in the given string str
// and one character represented by this pattern element match,
// return true; otherwise return false.
public boolean matches(String str, int index) {
return str.length() > index && A ;
}
public int length() { return 1; }
}

405
Afternoon Exam Section 12 Software Development (Java)

[Program 3]
class AnyChar implements PatternElement {
// When there are one or more characters from position index in the given
// string str, return true; otherwise return false.
public boolean matches(String str, int index) {
return B ;
}
public int length() { return 1; }
}

[Program 4]
class BeginningOfString implements PatternElement {
public boolean matches(String str, int index) {
return index == 0;
}
public int length() { return 0; }
}

[Program 5]
class EndOfString implements PatternElement {
public boolean matches(String str, int index) {
return index == str.length();
}
public int length() { return 0; }
}

[Program 6]
import java.util.ArrayList;
import java.util.List;

public class Pattern {


private List<PatternElement> expr;
public Pattern(String pattern) {
expr = compile(pattern);
}

public boolean matches(String str) {


for (int i = 0; i <= str.length(); i++) {

406
Afternoon Exam Section 12 Software Development (Java)

if (matches(str, i))
return true;
}
return false;
}

private boolean matches(String str, int index) {


for (PatternElement node : expr) {
if (!node.matches(str, index))
return false;
index += node.length();
}
return true;
}

private List<PatternElement> compile(String pattern) {


List<PatternElement> list = new ArrayList<PatternElement>();
for (int i = 0; i < pattern.length(); i++) {
char c = pattern.charAt(i);
PatternElement node = null;
if (c == '.') {
node = new C ;
} else if (c == '^') { α
node = new BeginningOfString();
} else if (c == '$') {
node = new EndOfString();
} else {
node = new D ;
}
list.add(node);
}
return list;
}

public static void main(String[] args) {


String[] data = { “home”, “shore”, “hotel” };
Pattern pattern = new Pattern(“ho.e$”);
for (String str : data) {

407
Afternoon Exam Section 12 Software Development (Java)

String result;
if ( E ) {
result = “matches”;
} else {
result = “doesn't match”;
}
System.out.printf(“\”ho.e$\“ %s \”%s\“.%n”,
result, str);
}
}
}

Subquestion 1
From the answer groups below, select the correct answers to be inserted in the blanks
in the above program.

Answer group for A:


a) str.charAt(index) != ch b) str.charAt(index) < ch
c) str.charAt(index) == ch d) str.charAt(index) > ch

Answer group for B:


a) str.length() < index b) str.length() <= index
c) str.length() > index d) str.length() >= index

Answer group for C and D:


a) AnyChar('.') b) AnyChar() c) AnyChar(c)
d) AnyChar(i) e) OneChar('.') f) OneChar()
g) OneChar(c) h) OneChar(i)

Answer group for E:


a) !pattern.equals(str) b) !pattern.matches(str)
c) pattern.equals(str) d) pattern.matches(str)

408
Afternoon Exam Section 12 Software Development (Java)

Subquestion 2
Line α in program 6 is modified as in Fig. 2. From the answer group below, select
the appropriate description about the behavior of the modified program.

} else if (c == '^' && i == 0) {

Fig. 2 Modified line α in program 6

Answer group:
a) Character ‘^’ is always treated as a literal character.
b) Character ‘^’ is treated as a metacharacter only at the beginning of argument
pattern. Otherwise, it is treated as a literal character.
c) Character ‘^’ is treated as a metacharacter only at the beginning of argument
pattern. Otherwise, it is ignored.
d) Character ‘^’ is treated as a metacharacter only at the beginning of argument
pattern. Otherwise, an exception is thrown.

409
Afternoon Exam Section 12 Software Development (Assembler)

12.4 Software Development (Assembler)

Q12-10 
Read the following description of an assembler program and the program itself, and then
answer Subquestions 1 through 3.

[Program Description]
Subprogram 1 BCDADD receives, from the main program, the two (2) integers a, b (a ≥0 ,
b ≥0 ) expressed in BCD encoding, and calculates the sum of a and b in BCD encoding.
(1) BCD encoding expresses each digit of a decimal value in 4-bit binary format. For
example, the decimal number 6935 is expressed in BCD encoding as follows.

thousands hundreds tens place units place


place place
6 9 3 5
↓ ↓ ↓ ↓
0110 1001 0011 0101

(2) Both a and b are 4-digit (16-bit) numbers, are stored in GR1 and GR2, respectively,
and are passed by the main program.
(3) An example of execution of Subprogram 1 BCDADD is shown below.

5 9 7 3
GR1 0101 1001 0111 0011
Result 6 5 0 5
GR1 0110 0101 0000 0101
0 5 3 2
GR2 0000 0101 0011 0010

Fig. Example of execution of Subprogram 1 BCDADD

(4) Upon return to the main program, the result is placed in GR1 and a is placed in GR3.
The original contents of the general registers GR4 through GR7 are restored.

410
Afternoon Exam Section 12 Software Development (Assembler)

[Subprogram 1]
(Line number)
1 BCDADD START
2 PUSH 0,GR4
3 PUSH 0,GR5
4 PUSH 0,GR6
5 PUSH 0,GR7
6 ST GR1,A
7 ST GR2,B
8 LD GR3,=0 ; initializes shift count
9 LD GR5,=0 ; initializes the result area
10 LOOP1 AND GR1,=#000F ; identifies 4 bits from integer a
11 AND GR2,=#000F ; identifies 4 bits from integer b
12 LD GR0,=0 ; initializes carry
13 ADDA GR1,GR2 ; 4-bit addition
14 CPA GR1,=10 ; result ≥ 10?
15 A
16 SUBA GR1,=10 ; subtracts 10 from result
17 LD GR0,=1 ; sets carry
18 NOTOVR SLL GR1,0,GR3 ; puts 4-bit addition result into original position
19 OR GR1,GR5 ; merges into interim result
20 ADDA GR3,=4
21 CPA GR3,=16 ; all digits are completed?
22 JZE FIN1
23 NEXT1 LD GR5,GR1 ; stores interim result
24 LD GR1,A ; resets GR1 to integer a
25 SRL GR1,0,GR3 ; moves next 4 bits of integer a to right end
26 LD GR2,B ; resets GR2 to integer b
27 SRL GR2,0,GR3 ; moves next 4 bits of integer b to right end
28 ADDA GR1,GR0 ; adds carry
29 JUMP LOOP1
30 FIN1 LD GR2,B
31 LD GR3,A
32 POP GR7
33 POP GR6
34 POP GR5
35 POP GR4
36 RET

411
Afternoon Exam Section 12 Software Development (Assembler)

37 A DS 1
38 B DS 1
39 END

Subquestion 1
From the answer group below, select the correct answer to be inserted in the blank
in Subprogram 1.

Answer group for a


a) JMI NEXT1 b) JMI NOTOVR
c) JNZ NEXT1 d) JNZ FIN1
e) JPL FIN1 f) JPL NOTOVR

Subquestion 2
From the answer group below, select the correct answer to be inserted into each blank
in the following sentence.

When the contents of GR1 and GR2 passed by the main program are as follows, then after
execution of BCDADD, GR0 is set to B and GR1 is set to C , and these
are returned to the main program.

GR1 = 0101 0010 1001 1000


GR2 = 0100 1000 0101 0011

Answer group for B and C


a) 0000 0000 0000 0000 b) 0000 0000 0000 0001
c) 0000 0001 0101 0001 d) 0100 1000 0101 0011
e) 0101 0010 1001 1000 f) 1001 1001 1001 1001
g) 1010 0001 0101 0001 h) 1111 1111 1111 1111

412
Afternoon Exam Section 12 Software Development (Assembler)

Subquestion 3
Subprogram 2 BCDIN has been created. This subprogram inputs two (2) strings m and n in
the format of a 4-digit numeric strings as a decimal value and converts them in BCD
encoding, then calls Subprogram 1 BCDADD to add the two (2) decimal values, converts the
result to a 5-digit numeric string (string). From the answer groups below, select the correct
answer to be inserted in each blank in Subprogram 2 below.

(1) The input characters are the characters ‘0’ through ‘9’, and contain no input
errors.
(2) The relationship between input and output is as shown in the table below.

Table: Correspondence of output values to input values


m n Output string
‘6052’ ‘4001’ ‘10053’
‘5008’ ‘0007’ ‘05015’

(3) Upon return to the main program, the original contents of the general registers
GR4 through GR7 are restored.

[Subprogram 2]
(Line number)
51 BCDIN START
52 RPUSH
53 IN INBUF1,INLEN ; inputs m
54 IN INBUF2,INLEN ; inputs n
55 LD GR1,=0 ; initiates BCD encoding register
56 LD GR2,=0 ; as above
57 LD GR6,=0 ; initializes shift count
58 LD GR7,=3 ; initializes loop counter
59 LOOP2 LD GR4,INBUF1,GR7 ; retrieves 1 character from m
60 AND GR4,=#000F ; converts to numeric value
61 SLL GR4,0,GR6
62 OR GR1,GR4 ; merges BCD encoding
63 LD GR5,INBUF2,GR7 ; retrieves 1 character from n
64 AND GR5,=#000F ; converts to numeric value
65 SLL GR5,0,GR6
66 OR GR2,GR5 ; merges BCD encoding
67 D

413
Afternoon Exam Section 12 Software Development (Assembler)

68 SUBL GR7,=1
69 JMI NEXT ; is conversion complete?
70 JUMP LOOP2
71 NEXT CALL BCDADD
72 LD GR6,=0 ; initializes the shift count
73 LD GR7,=4 ; initializes the output area counter
74 LOOP3 LD GR5,GR1 ; Copies BCD encoding into GR1
75 SRL GR5,0,GR6
76 AND GR5,=#000F
77 OR GR5,=#0030 ; converts value to a character
78 ST GR5,OUTBUF,GR7 ; stores the character in output area
79 SUBL GR7,=1
80 ADDL GR6,=4 ; increments the shift count
81 CPL GR6,=16
82 JMI LOOP3
83 E
84 OR GR7,=#0030
85 ST GR7,OUTBUF
86 ST GR1,ANS
87 ST GR2,N
88 ST GR3,M
89 OUT OUTBUF,OUTLEN
90 RPOP
91 RET
92 INBUF1 DS 4
93 INBUF2 DS 4
94 INLEN DC 4
95 M DS 1
96 N DS 1
97 ANS DS 1
98 OUTBUF DS 5
99 OUTLEN DC 5
100 END

414
Afternoon Exam Section 12 Software Development (Assembler)

Answer group for D


a) ADDA GR6,=4 b) ADDL GR4,=1
c) LAD GR4,1,GR4 d) LAD GR6,1,GR4
e) LAD GR6,4,GR4 f) LD GR4,GR5

Answer group for E


a) LAD GR6,GR0 b) LAD GR7,=0
c) LD GR6,=0 d) LD GR7,GR0
e) SLL GR7,0,GR0 f) SRL GR6,4

415
Afternoon Exam Section 12 Software Development (Assembler)

Q12-11 
Read the following description of an assembler program and the program itself, and then
answer Subquestions 1 and 2.

[Program Description]
The subprogram SETPAR sets the parity bit for each word stored in a continuous N-word
block, and also sets 1-word horizontal parities immediately after the block.

(1) Bit number 15 (the most significant bit enclosed by the dotted line in the figure)
of each word is used as the parity bit. An even parity bit is used, that is, the bit
is set to 1 when the number of bits that are 1 in bit numbers 0 to 14 of each
word is odd, or 0 when even.
Even parity is also used for each horizontal parity bit, that is, the bit is set to 1
when the number of bits that are 1 in the corresponding bit position of each
word is odd, or 0 when even. That is to say, the horizontal parity bit is set so the
number of bits that are 1 in the shaded portion in the figure is an even number.

Bit number 15 14 13 ... 0


(GR2) → Word 0 0 1 0 ... 1
Word 1 1 0 1 ... 0
Word 2 0 1 0 ... 0
Word 3 1 1 1 ... 1
Parity bit Block
...

...

...

...

...

...

Word N -1 1 0 1 ... 1
Word N 0 1 1 ... 0 Horizontal parity

Fig. Parity bits and horizontal parity

(2) The main program sets the number of words N of the block in GR1, the start
address of the block in GR2, stores 0 in the parity bit of each word in the block,
and calls the subprogram SETPAR.
(3) The original contents of the general purpose registers GR1 to GR7 are restored
when returning from a subprogram.

416
Afternoon Exam Section 12 Software Development (Assembler)

[Program]
(Line number)
1 SETPAR START
2 RPUSH
3 LD GR6,GR2
4 ADDL GR6,GR1
5 LAD GR4,0 ; Initialize horizontal parity
6 LP1 LD GR1,0,GR2 ; Fetch 1 word from the block
7 LAD GR7,0
8 LP2 SLL GR1,1
9 JZE CONT
10 A
11 XOR GR7,=#8000 ; Adjust parity bit
12 JUMP LP2
13 CONT OR GR7,0,GR2
14 ST GR7,0,GR2 ; Set parity bit
15 B ; Adjust horizontal parity
16 LAD GR2,1,GR2
17 CPL GR2,GR6 ; End of block?
18 JNZ LP1
19 ST GR4,0,GR6 ; Set horizontal parity
20 RPOP
21 RET
22 END

Subquestion 1
From the answer groups below, select the correct answers to insert in the blanks
in the above program.

Answer group for A:


a) JMI CONT b) JMI LP2 c) JOV CONT
d) JOV LP2 e) JPL CONT f) JPL LP2

417
Afternoon Exam Section 12 Software Development (Assembler)

Answer group for B:


a) OR GR4,0,GR6 b) OR GR4,GR7
c) OR GR7,0,GR6 d) OR GR7,GR4
e) XOR GR4,0,GR6 f) XOR GR4,GR7
g) XOR GR7,0,GR6 h) XOR GR7,GR4

Subquestion 2
The program is to be changed so that 0 is set as the parity bit value when the number of
bits that are 1 in bit numbers 0 to 14 of each word is odd, or 1 when even. This can be done
by changing the value to be set in GR7 in line number 7 of the program. From the answer
group below, select the correct value to be set in GR7.

Answer group:
a) #0001 b) #7FFF c) #8000
d) #8001 e) #FFFE f) #FFFF

418
Afternoon Exam Section 12 Software Development (Assembler)

Q12-12 
Read the explanation on the following assembler program as well as the program itself.
Then, answer Subquestions 1 and 2.

[Explanation on the Program]


(1) The subprogram BREP is a program that does the following: if a 16-bit string A
contains sub-bit strings that are identical to an n-bit string B, the program replaces
the string with an n-bit string C.

Example:

Bit String A 1 0 1 1 0 0 1 1 1 0 0 1 0 0 0 1 1011011001010001

Identical
Bit String B 0 1 1 1 0 0

Replaced
Big String C 1 1 0 0 1 0

n=6

(i) GR1 to GR4 are set to the following contents and are passed from the main
program.
GR1: address of the word where the bit string A is stored
GR2: bit string B (set left-aligned, and the remaining bits are filled with 0s)
GR3: bit string C (set left-aligned, and the remaining bits are filled with 0s)
GR4: n (1 ≤ n ≤ 16)
(ii) If the bit string A contains numerous sub-bit strings identical to the bit string B,
all of those sub-bit strings are replaced by the bit string C.
(iii) The bit string A is checked from the left end. If a sub-bit string identical to the
bit string B is replaced by the bit string C, the check continues from the bit
immediately to the right of the sub-bit string just replaced.
(iv) When returning from the subprogram, the contents of the general registers GR1
to GR7 are restored to their original contents.
(2) The subprogram ROTSL is a program that cyclically shifts a 16-bit string by m bits to
the left.

419
Afternoon Exam Section 12 Software Development (Assembler)

Example:
The overflow substring is placed at the right end.

1011001110010001 0111001000110110

m= 5
Shift to the left.

(i) GR0 and GR1 are set to the following contents and are passed from the main
program.
GR0: m (0 ≤ m ≤ 16)
GR1: Address of the word where the bit string is stored
(ii) When returning from the subprogram, the original contents of the general
registers GR1 to GR7 are restored.

[Program]
BREP START
RPUSH
LD GR5,=16 ; the number of bits not yet checked
LD GR6,=#8000 ;
Creating a mask
SRA GR6,-1,GR4 ;
LOOP LD GR7,0,GR1 ; GR7 ← bit string A
A ; sets all bits, except n leftmost bits, to 0.
CPL GR7,GR2 ; compares the n leftmost bits and bit string B
JZE MATCH ; matched
LD GR0,=1 ; number of cyclic left-shift bits
JUMP CONT
MATCH LD GR7,0,GR1 ; GR7 ← bit string A
SLL GR7,0,GR4 ;
Sets the n leftmost bits to 0
SRL GR7,0,GR4

B ; sets the n leftmost bits to bit string C


ST GR7,0,GR1 ; Rewrite the original area
LD GR0,GR4 ; Number of cyclic left-shift bits
CONT CALL ROTSL ; Cyclically shifting bit string A to the left
SUBA GR5,GR0 ; update number of bits not yet checked
CPA GR5,GR4 ; Compare number of unchecked bits with n

C ; If less than n, finish


JUMP LOOP
FIN LD GR0,GR5 ; Number of unchecked bits

420
Afternoon Exam Section 12 Software Development (Assembler)

CALL ROTSL ; Restore to the original bit position


RPOP
RET
;
ROTSL RPUSH
LD GR3,GR0 ; GR3 ← m
LD GR4,=16
SUBA GR4,GR3 ; GR4 ← (16 - m)
LD GR5,0,GR1
LD GR6,GR5
SLL GR5,0,GR3

D ; Bit string overflow


OR GR5,GR6 ; Set the overflow bit string at the right end
ST GR5,0,GR1 ; Rewrite the original area
RPOP
RET
END

Subquestion 1
From the answer groups, select the correct answers to be inserted in the blanks
in the program.

Answer group for A and B:


a) AND GR7,GR3 b) AND GR7,GR6
c) OR GR7,GR3 d) OR GR7,GR6

Answer group for C:


a) JMI FIN b) JNZ FIN
c) JPL FIN d) JZE FIN

Answer group for D:


a) SLL GR6,0,GR3 b) SLL GR6,0,GR4
c) SRL GR6,0,GR3 d) SRL GR6,0,GR4

421
Afternoon Exam Section 12 Software Development (Assembler)

Subquestion 2
From the answer group, select the correct answer to be inserted into the blank
in the following description.

Suppose that the bit strings A, B, C, and the value n passed by the main program are as
follows, then the subprogram BREP calls the subprogram ROTSL times.

Bit string A: 0001110100111001


Bit string B: 0111
Bit string C: 1001
n: 4

Answer group:
a) 2 b) 6 c) 8
d) 12 e) 16

422
Afternoon Exam Section 12 Software Development (Assembler)

12.5 Software Development (Spreadsheet)

Q12-13 
Read the following description of an investment determination regarding implementation
of a new system, and answer Subquestions 1 and 2.

Regarding the implementation of IP phone equipment and related systems (hereinafter


“IPC system”), Company K decided to consider the initial investment cost, maintenance
costs, and the expected economic benefits, in order to make a determination on whether to
invest in the system.

(1) Initial investment cost


Table 1 indicates the initial investment cost required for implementation of the IPC
system.

Table 1 Initial investment cost required for implementation of IPC system


Unit ¥1,000
Cost item Content Initial investment cost
IP phone equipment
IP phones, IP phone exchanges, etc. 8,000
acquisition cost
LAN equipment Voice priority control switches,
7,000
acquisition cost powered switching hubs, etc.
Software purchase Voice mail software, automated
5,000
cost answering software

(2) Maintenance cost


(i) Equipment maintenance cost
Maintenance cost will not occur for the 1st year after the IPC system begins
operation. In years 2 through 4, 10% of equipment acquisition cost will occur as an
annual maintenance cost, and in year 5 and onward, 20% of equipment acquisition
cost will occur as an annual maintenance cost.
(ii) Software maintenance cost
An annual maintenance cost of 12% of the software purchase cost will occur after
the IPC system begins operation.

423
Afternoon Exam Section 12 Software Development (Assembler)

(3) Expected economic benefit


(i) Communication cost reductions
Prior to implementation of the IPC system, the annual communication cost was
¥4,000,000. As the unit cost of communications is falling, a reduction of 10% over
the previous year is expected every year, even without implementation of the IPC
system. With implementation of the IPC system, a further reduction of 40% in the
annual communication cost is expected from year 1 onward.
(ii) Phone exchange management cost reductions
The annual management cost for existing phone exchanges is ¥1,500,000. If the IP
exchanges are implemented, the annual maintenance cost will be 50% that of the
existing phone exchanges.
(iii)Cost reductions due to labor saving
Voice mail software will eliminate the need for creating voice messages, and
automated answering software will eliminate the work of answering the main phone
line. Through this labor saving, annual costs will be reduced by ¥4,000,000 after the
IPC system is put into operation.
(4) Investment determination criteria
The company will deem the investment feasible if the following two determination
values meet the investment decision criteria.
(i) Payback period determination value
The payback period determination value is the value derived by taking the
cumulative total of the expected annual economic benefit minus the annual
maintenance cost (hereinafter “incremental cash flow”), and subtracting the initial
investment cost. If the time until the payback period determination value becomes
positive is six (6) years or less after the IPC system goes into operation, the
investment determination criteria can be said to be satisfied.
(ii) Profitability determination value
The profitability determination value is the value derived by subtracting the total
amortization cost of the investment (hereinafter “amortization cost”) from the
incremental cash flow. If the profitability determination value is positive by the end
of year 6 after the IPC system goes into operation, the investment determination
criteria can be said to be satisfied.
Table 2 shows the durable years, amortization rate, amortization method, and
amortization cost equations for each amortized item.

424
Afternoon Exam Section 12 Software Development (Assembler)

Table 2 Durable years, amortization rate, amortization method, and amortization


cost equations for each amortized item
Amortized Durable Amortization Amortization Amortization cost
item years rate method equations
IP phone Unamortized balance =
6 0.319
equipment acquisition cost −
Declining accumulated
balance amortization
LAN
10 0.206 method Amortization cost =
equipment
unamortized balance ×
amortization rate
Amortization cost =
Straight-line
Software 5 0.200 acquisition cost ×
method
amortization rate

(5) Worksheet for making investment determination


In order to make a determination to invest in implementing the IPC system,
spreadsheet software was used to make a worksheet as shown in the figure.

425
Afternoon Exam Section 12 Software Development (Assembler)

A B C D E F G H I

Annual costs and

1 Initial investment cost Calculation of amortization cost economic benefit prior to

implementation

Durable
Amount Amortization Amortization Amount
2 Cost item years Item
(¥1000) method rate (¥1000)
(years)

Declining Communication
IP phone equipment
3 8,000 balance 6 0.319 costs prior to 4,000
Preconditions acquisition cost
method implementation

Management
Declining
LAN equipment cost for existing
4 7,000 balance 10 0.206 1,500
acquisition cost phone
method
exchanges

Cost reductions
Software purchase Straight-line
5 5,000 5 0.200 due to labor 4,000
cost method
saving

6 Profitability by fiscal year (¥1000)

7 Fiscal years elapsed 1 2 3 4 5 6

Equipment
8 0
maintenance cost

Maintenance cost Software


9
maintenance cost

10 Total 600 2,100 2,100 2,100 3,600 3,600

Communication Initially expected


11 3,600
cost communication cost

Communication cost
12
reductions

Phone exchange

13 Expected maintenance cost

economic benefit reductions

Cost reductions due


14 4,000
to labor saving

15 Total 6,190 6,046 5,916 5,800 5,695 5,600

16 Payback period Incremental cash flow 5,590 3,946 3,816 3,700 2,095 2,000

426
Afternoon Exam Section 12 Software Development (Assembler)

determination Cumulative
17 5,590
value incremental cash flow

Payback period
18 -14,410
determination value

Unamortized balance

19 of IP phone 5,448

equipment

Amortization cost of
20 2,552
IP phone equipment

Unamortized balance
21 5,558
Profitability of LAN equipment

determination Amortization cost of


22 1,442
value LAN equipment

Amortization cost of
23 0
software

Total amortization
24 4,994 3,883 3,093 2,528 2,122 829
cost

Profitability
25
determination value

Note: Shaded portions are not shown.


Calculated decimal values are rounded to the nearest integer when displayed in cells.
Fig. Worksheet for making determination to invest in implementing IPC system

427
Afternoon Exam Section 12 Software Development (Assembler)

Subquestion 1
From the answer groups below, select the correct answer to be inserted in each blank
in the following description concerning the worksheet in the figure.

(1) Initial investment cost, calculation of amortization cost, and annual costs and
economic benefit prior to implementation were entered in Rows 3 through 5 as
preconditions for making the investment determination.
(2) The expression “ A ” to calculate equipment maintenance cost from year 2
onward was entered in cell D8, and was duplicated in cells E8 through H8. The
expression “ B *0.12” to calculate software maintenance cost for year 1 was
entered in cell C9, and was duplicated in cells D9 through H9.
(3) The initially expected communication cost for year 1 was entered in cell C11. The
expression “ C *0.9” to calculate the initially expected communication cost
for year 2 was entered in cell D11, and was duplicated in cells E11 through H11.
Expressions to calculate the amount of communication cost reductions for each
elapsed fiscal year were entered in cells C12 through H12, expressions to calculate
the amount of phone exchange equipment management cost reductions for each
elapsed fiscal year were entered in cells C13 through H13, and expressions to
calculate the amount of cost reductions through labor saving for each elapsed fiscal
year were entered in cells C14 through H14.
(4) Expressions to calculate incremental cash flow for each elapsed fiscal year were
entered in cells C16 through H16. An expression to calculate cumulative incremental
cash flow for year 1 was entered in cell C17. The expression “ D ” to
calculate cumulative incremental cash flow for year 2 was entered in cell D17, and
was duplicated in cells E17 through H17. Expressions to derive the payback period
determination value for each elapsed fiscal year were input in cells C18 through
H18.

428
Afternoon Exam Section 12 Software Development (Assembler)

(5) An expression to calculate the unamortized balance for IP phone equipment for year
1 was entered in cell C19, and an expression to derive the amortization cost for IP
phone equipment for year 1 was entered in cell C20. The expression “C19 - D20” to
calculate the unamortized balance for IP phone equipment for year 2 was entered in
cell D19, and was duplicated in cells E19 through H19. The expression “C19 * $F3”
to calculate the amortization cost for IP phone equipment for year 2 was entered in
cell D20, and was duplicated in cells E20 through H20. Expressions to calculate the
unamortized balance for LAN equipment for each elapsed fiscal year were entered
in cells C21 through H21, and expressions to calculate the amortization cost for
LAN equipment for each elapsed fiscal year was entered in cells C22 through H22.
The expression “ E ” to calculate the amortization cost for software for year
1 was entered in cell C23, and was duplicated in cells D23 through G23.
Expressions to calculate the profitability determination value for each elapsed fiscal
year were entered in cells C25 through H25.
Answer group for A
a) (C3+C4) *0.1
b) (C3+C4) *0.2
c) ($C3+$C4) *0.1
d) ($C3+$C4) *0.2
e) IF(D7≥5, ($C3+$C4) *0.2, ($C3+$C4) *0.1)
f) IF(D7<5, ($C3+$C4) *0.2, ($C3+$C4) *0.1)

Answer group for B and C


a) C5 b) C11 c) I3
d) $C5 e) $C11 f) $I3

Answer group for D


a) C16+D16 b) C17
c) C17+D16 d) E17−E16

Answer group for E


a) C5*F4 b) C5*F5
c) $C5*$F4 d) $C5*$F5

429
Afternoon Exam Section 12 Software Development (Assembler)

Subquestion 2
From the answer group below, select the appropriate statements concerning investment
determination criteria that are made clear by the worksheet in the figure.

Answer group
a) Neither the payback period determination value nor the profitability determination
value satisfies the investment determination criteria.
b) Both the payback period determination value and the profitability determination
value satisfy the investment determination criteria.
c) The payback period determination value does not satisfy the investment
determination criteria, but the profitability determination value does satisfy the
investment determination criteria.
d) The payback period determination value satisfies the investment determination
criteria, but the profitability determination value does not satisfy the investment
determination criteria.
e) It cannot be determined whether the payback period determination value or the
profitability determination value satisfies the investment determination criteria.

430
Afternoon Exam Section 12 Software Development (Assembler)

Q12-14 
Read the following description concerning selling and sales at a catalog retailer, and
answer Subquestions 1-4.

Company N is a major catalog retailer. It is characterized by its quality products, full


product lineup, and courteous follow-up service. The company’s organization consists of a
sales department, customer management department, shipping department, and general
affairs department. The company has implemented and operates a sales management system
(hereinafter system) developed in-house.

[Sales department tasks]


(1) Twice a year, the sales department produces a product catalog listing all of the
products it regularly handles (regular products), and mails the catalogs to customers.
(2) Every 3 months, the department receives special shipments of products related to a
certain theme chosen every time, such as dieting, health, or car accessories. The
department creates an overview (pamphlet) of product groups (special products),
differing from its regular products, according to these specified themes, and mails
them to the customers.
(3) The products listed in Company N’s catalogs and pamphlets are also introduced on
its Web site.
[Customer management department tasks]
(1) The customer management department accepts catalog requests from new customers
and mails the catalogs.
(2) The department accepts orders via phone, FAX, mail, or Internet, and enters the
content of the order into the system. Simultaneously, the order information is sent to
the shipping department’s information terminals.
(3) When an order is received from a new customer, attribute data (customer
information) such as customer code, customer name, address, phone number, date of
birth, gender, hobbies, and family structure, are registered in the system.
(4) When further orders are received, the customer attribute data registered in the
system is updated. This update is based on responses to the company’s customer
questionnaire that accompanied the order form, or based on the content given by the
customers to the company’s operators during ordering.
(5) When an inquiry from a customer about product details is received, the company’s
operators respond by calling up and referencing the detailed information on products
that was registered in the system at the time the product catalogs and pamphlets
were created.
(6) The department responds appropriately to requests concerning products, complaints

431
Afternoon Exam Section 12 Software Development (Assembler)

about the company, and so on. At the same time, it registers requests concerning its
products, and the content of its responses to customers, in the system.

In recent years, growth in Company N’s sales amount has been slow compared to
industry competitors, and profits have also hit a ceiling. Thus, Mr. F, an entry-level
system administrator, who belongs to the sales department, will survey and analyze
current problem areas under the direction of his supervisor, and will consider future
countermeasures. First, Mr. F has decided to conduct an analysis of sales performance
according to the following procedures.

432
Afternoon Exam Section 12 Software Development (Assembler)

[Procedure 1]
To accurately ascertain the status of the company’s sales, sales performance for the past 3
years will be totaled.
(1) The company’s fiscal year runs from April through the following March.
(2) Composition ratio is each month’s total sales expressed as a percentage of annual
sales.
(3) As there is seasonal variation within monthly sales, quantified seasonal variations
are expressed as seasonal indexes. A seasonal index is the 3-year total sales for the
month in question, as a percentage of 3-year monthly average sales.
(4) The Determination column displays the following: “○○” for months in which the
seasonal index exceeds 150%; “○” for months in which the seasonal index exceeds
120% and is less than 150%; “●” for months in which the seasonal index exceeds
90% and is less than 120%; and “▲” for months in which the seasonal index is 90%
or less.

[Procedure 2]
Cumulative performance, moving average, and moving total are calculated, based on
totaled sales performance.
(1) Cumulative performance totals each month’s sales performance for each accounting
year.
(2) Moving average is the average sales performance for the past 1 year (12 months).
For example, the moving average as of June 2007 is the average value of sales
performance from July 2006 to June 2007.
(3) Moving total is the total sales performance for the past 1 year (12 months). For
example, the moving total as of June 2007 is the total value of sales performance
from July 2006 to June 2007.

433
Afternoon Exam Section 12 Software Development (Assembler)

[Procedure 3]
A Z graph is created based on sales performance, cumulative performance, and moving
total, and the status of sales is visually checked.

Subquestion 1
Table 1 is a worksheet created by Mr. F for the purpose of checking sales performance
for the past 3 years. Expressions are entered into the cells H2 and I2, and are duplicated in
cells H3 through H13 and cells I3 through I13, respectively. From the answer groups below,
select the appropriate expressions to be inserted in each blank in Table 1.

Table 1 Sales performance table


A B C D E F G H I
1 FY FY FY Monthly Monthly Composition Seasonal Determination
2005 2006 2007 total average ratio index
2 April 5,608 5,553 5,441 16,602 5,534 7.6% A B
3 May 5,599 5,544 5,433 16,576 5,525 7.6%
4 June 5,111 5,061 4,959 15,131 5,044 6.9%
5 July 6,138 6,078 5,956 18,172 6,057 8.3%
6 August 7,659 7,584 7,432 22,675 7,558 10.4%
7 September 4,926 4,878 4,780 14,584 4,861 6.7%
8 October 5,484 5,430 5,321 16,235 5,412 7.4%
9 November 6,469 6,405 6,276 19,150 6,383 8.7%
10 December 4,190 4,149 4,066 12,405 4,135 5.7%
11 January 3,669 3,633 3,560 10,862 3,621 5.0%
12 February 9,805 9,708 9,513 29,026 9,675 13.3%
13 March 9,274 9,183 8,999 27,456 9,152 12.5%
14 FY total 73,932 73,206 71,736 218,874 72,958 100.0%
Note: Because cells F2 through F13 show values rounded up to the nearest integer and cells
G2 through G13 show values rounded up to the nearest first decimal place, their
respective totals do not match the FY totals in F14 and G14.

Answer group for A


a) E2/($E$14/12)*100
b) E2/($F$14/12)*100
c) $E2/($F$14/12)*100
d) $E$2/($E$14/12)*100

434
Afternoon Exam Section 12 Software Development (Assembler)

Answer group for B:


a) IF(H2<150, ‘○○’, IF(H2<120, ‘○’, IF(H2<90, ‘●’, ‘▲’)))
b) IF(H2>149, ‘○○’, IF(H2>119, ‘○’, IF(H2>89, ‘●’, ‘▲’)))
c) IF(H2>150, ‘○○’, IF(H2>120, ‘○’, IF(H2>90, ‘●’, ‘▲’)))
d) IF(H2>=150, ‘○○’, IF(H2>=120, ‘○’, IF(H2>=90, ‘●’, ‘▲’)))

Subquestion 2
The statements below summarize the expressions and procedures for arranging
cumulative performance, moving average, and moving total in the Table 2 worksheet, based
on totaled sales performance. From the answer groups below, select the appropriate answers
to be inserted in each blank in the description below.

Table 2 Worksheet
K L M N O P
FY Cumulative Moving Moving
1 Month Sales performance
performance average total
2 April 5,608
3 May 5,599
4 June 5,111
FY2005
11 January 3,669
12 February 9,805
13 March 9,274

14 April 5,553 E F

15 May 5,544
16 June 5,061
FY2006
23 January 3,633
24 February 9,708
25 March 9,183
26 April 5,441
27 May 5,433
28 June 4,959
FY2007
35 January 3,560
36 February 9,513
37 March 8,999

Note: Rows 5 through 10, Rows 17 through 22, and Rows 29 through 34 are not shown.

435
Afternoon Exam Section 12 Software Development (Assembler)

(1) Sales performance in Column M is duplicated from the appropriate locations in


“Table 1 Sales performance table.”
(2) To calculate cumulative performance, C is entered in cell N2 and D is
entered in cell N3, and the expression in N3 is duplicated in cells N4 through
N13.Moreover, cells N2 through N13 is duplicated in cells N14 through N25 and in
cells N26 through N37.
(3) To calculate moving average and moving total, E is entered in O14 and F
is entered in P14, and these are duplicated in cells O15 through O37 and in cells P15
through P37, respectively.

Answer group for C and D:


a) M2 b) M$2 c) N2+M3
d) $M$2 e) $N$2+M3 f) $N$2+$M$3

Answer group for E and F:


a) TOTAL(M3:M14) b) TOTAL($M3:M$14)
c) TOTAL($M$3:$M$14) d) AVERAGE(M3:M14)
e) AVERAGE($M3:M$14) f) AVERAGE($M$3:$M$14)

Subquestion 3
Mr. F, who created a Z graph using Table 2, next conducted hearings regarding current
workflow with the sales department and customer management department, the departments
that have direct contact with customers.

[Results of hearings with the sales department]


(1) The product catalog for regular products is mailed to all customers registered in
the system. If catalogs are returned due to an incomplete address or refusal by
the customer, the customer information is updated so that the catalog is not
mailed again later.
(2) New customers typically increase steadily every year, but there is also a
growing trend of customers who have a history of purchasing but who do not
purchase again, resulting in poor growth in sales and profits.
(3) The number of customers making repeated orders for regular products is barely
increasing in recent years, and the repeat order rate per customer is in a
downward trend.

436
Afternoon Exam Section 12 Software Development (Assembler)

(4) The special products pamphlet consists of related products collected according
to theme. For purposes of effective sales promotion, it is currently mailed only
to customers who have purchased products of a certain value or higher in the
past one year. However, among customers who were mailed the pamphlet, the
ratio of customers who actually order products (the response rate) is nearly the
same as that of regular products.

[Results of hearings with the customer management department]


(1) When product inquiries are received, the department sometimes is asked about
details of products related to another product, or replacement purchase of the
same type of product. However, within the system currently operated, the
functionality for introducing products is designed to emphasize descriptions of
individual products, and provides a difficult environment for effectively
offering advice during inquiries such as the above.
(2) The department also accepts orders for consumables and regularly replaced
parts, and references purchasing history when customer inquiries are responded
to. However, the order volume for such products is extremely low compared to
the sales volume of the main products that use the consumables and parts. The
department wishes to see orders increase.
(3) Requests for responding to requests or complaints concerning products are
made to the necessary department or persons in charge, with the outcome of the
response recorded in the system. Requests or complaints concerning the same
product may come from multiple customers, but even in cases concerning the
same content, the current system requires a search with a full-text search
function, which does not allow a prompt reply.
(4) Compared to the past, inquiries from customers with an interest in products are
increasingly received by e-mail. Replies from the customer management
department use e-mail, and the response history, including the customer’s mail
address, is recorded in the system.

After the hearings and upon reporting the results to his superiors, Mr. F was
ordered to draft proposed solutions to the current problems. At the same time, to
escape from the situation of stagnant sales and profits, he was also instructed to
draft a new sales promotion proposal using active direct mail (DM) and e-mail,
with the aim of expanding customers who make repeated orders and improving
profits.

437
Afternoon Exam Section 12 Software Development (Assembler)

To improve the repeat order rate per customer and the response rate to the
pamphlet in accordance with the instructions of his superior, what sales
promotion activities using DM and e-mail should Mr. F carry out? From the
answer group below, select the appropriate answer.

Answer group:
a) Performing detailed analysis of not only the purchase amount for the past one (1)
year, but also of purchase history taking into account family composition, hobbies,
etc.; narrowing down customer groups which are appropriate targets for providing
information on related products and replacement purchase periods, as well as on
consumables and regular replacement parts for purchased products, etc.; and sending
DM and e-mail in timely fashion
b) From the standpoint that service should be uniform, regularly and uniformly sending
product catalogs and pamphlets in digital format as e-mail attachments to all
customers for which customer data is managed
c) Stopping the use of DM in conventional paper media; constructing a shopping site
for product purchases on the company’s Web site, and increasing customers’ use of
the site. Using e-mail to conduct a focused sales push toward customers particularly
with no purchase history in the past one (1) year

Subquestion 4
How should the system be improved to respond promptly to inquiries or complaints from
customers? Based on the results of the hearings, select the appropriate answer from the
answer group below.

Answer group:
a) Accepting all inquiries and complaints only through Internet-based means, using
e-mail or placing inquiry information on the Web site
b) From a human resource staffing company or other source, employing human
resources as needed who are equipped with knowledge of specific products and are
able to accurately respond to inquiries, thereby improving the customer handling
capability of departments in charge
c) Organizing information for each product for the purpose of responding to customer
inquiries and complaints, and enabling prompt responses through item searches for
similar past cases, as necessary
d) On screens that introduce specific products, enabling easy search and displaying of
information on related products

438
Afternoon Exam Section 12 Software Development (Assembler)

Q12-15 
Read the following description concerning a class placement test, and then answer
Subquestions 1 through 4.

Company E conducts a course for the acquisition of qualifications. Course applicants


take a 100-question test consisting of Q1 through Q100, and based on results, are placed
into one of five (5) classes for the course. An index called “score” is calculated as per the
equation below, and class placement is performed using score as a criterion, as shown in the
Table.

the course applicant’s number of correct answers − the average number of


correct answers of all past course applicants
Score =
the standard deviation of the number of correct answers of all past course
applicants

Table Criteria for class placement according to score


Score Class
Less than −1.5 1
−1.5 or more, but less than 0.5 2
−0.5 or more but less than 0.5 3
0.5 or more but less than 1.5 4
1.5 or more 5

Conducting and grading the test requires time with the current method of class
placement, and thus Mr. U of Company E has decided to use spreadsheet software and
consider the methods shown below for performing class placement using fewer questions.
(1) For the 100 questions currently used for class placement, analyze the grading results
used in past class placement, for each of classes 1-5.
(2) From among the 100 questions, select 10 questions that allow efficient class
placement, and conduct new class placement tests using only those 10 questions.
(3) Based on the status of the accuracy of the 10-question test used in the new class
placement, perform class placement by stochastically considering which classes
have persons with the highest probability of resulting in that status.

439
Afternoon Exam Section 12 Software Development (Assembler)

Subquestion 1
From the answer groups below, select the appropriate phrases to be inserted in each blank
, concerning the current class placement .

If the average number of correct answers for all past course applicants is 60 with a
standard deviation of 10, an applicant with 65 correct answers is placed into class
A , and an applicant with B or more correct answers is placed in class
5.

Answer group for A:


a) 1 b) 2 c) 3
d) 4 e) 5

Answer group for B:


a) 65 b) 70 c) 75
d) 80 e) 85

Subquestion 2
From the answer groups below, select the appropriate phrases to be inserted in each blank
, concerning the 100-question test used in current class placement.

The grading results for the 100-question test used in the current class placement are
stored in the “Accuracy” worksheet shown in Fig. 1. As the number of course applicants so
far is 1,000, data exists through Row 1001 in the Fig. 1 worksheet. For each of the 100
questions, “1” is displayed for a correct answer and “0” is displayed for an incorrect answer.

A B C D E F G ... CW
Course
1 Q1 Q2 Q3 Q4 Q5 Q6 ... Q100
applicant
2 DA0001 1 0 1 0 1 0 ... 1
3 DA0002 1 1 1 0 1 1 ... 0
4 DA0003 1 1 0 1 1 0 ... 1
5 DA0004 1 0 0 0 0 1 ... 0
...

...

...

...

...

...

...

...

...
...

1001 DA1000 1 1 1 1 1 1 ... 1

Fig. 1 “Accuracy” worksheet

440
Afternoon Exam Section 12 Software Development (Assembler)

Mr. U totaled the worksheet in Fig. 1 and created the “Grading” worksheet shown in Fig.
2 to display the number of correct answers for each course applicant as well as the average
number of correct answers and the standard deviation for all course applicants.

A B ... E F G H
Number of
Course Standard
1 correct Average 60.0 10.0
applicant deviation
answers
2 DA0001 63
3 DA0002 56
4 DA0003 74
5 DA0004 52
...

...
...

1001 DA1000 95

Fig. 2 “Grading” worksheet

When data among multiple worksheets is referenced, expressions are specified in the
format “sheet_name!cell”. When cells in this format are duplicated, cells in the
duplication destination are automatically updated relatively. For example, when the
expression “Accuracy!A2” is entered into cell A2 of the “Grading” worksheet and is then
duplicated in cell A3, the value in cell A3 of the “Accuracy” worksheet is displayed in cell
A3 of the “Grading” worksheet.
Next, to calculate the number of correct answers for each course applicant in the Fig. 2
worksheet, Mr. U enters equation C in cell B2, and duplicated this in cells B3
through B1001. Moreover, to calculate the average number of correct answers for all course
applicants, he enters the expression D in cell F1, and to calculate the standard
deviation, enters the expression E in cell H1.

Answer group:
a) TOTAL(B2:B1001)
b) TOTAL(Accuracy!B2:Accuracy!B1001)
c) TOTAL(Accuracy!B2:Accuracy!CW2)
d) STANDARDDEVIATION(B2:B1001)
e) STANDARDDEVIATION(Accuracy!B2:Accuracy!B1001)
f) STANDARDDEVIATION(Accuracy!B2:Accuracy!CW2)
g) AVERAGE(B2:B1001)
h) AVERAGE(Accuracy!B2:Accuracy!B1001)
i) STANDARDDEVIATION(Accuracy!B2:Accuracy!CW2)

441
Afternoon Exam Section 12 Software Development (Assembler)

Subquestion 3
From the answer groups below, select the appropriate phrases to be inserted in each blank
in the description below concerning scores and classes for all course applicants.

To display the scores and classes for all course applicants, Mr. U duplicated the Fig. 2
worksheet and created the “Class placement” worksheet shown in Fig. 3.

A B C D E F G H
Number of
Course Standard
1 correct Score Class Average 60.0 10.0
applicant deviation
answers
2 DA0001 63
3 DA0002 56
4 DA0003 74
5 DA0004 52
...

...

...

1001 DA1000 95
Note: The calculated values for the shaded parts are not shown.
Fig. 3 “Class placement” worksheet

Next, Mr. U input the expression F to compute scores in cell C2, and
duplicated this in cells C3 through C1001. In addition, he input the expression “IF(C2
G , H , IF(C2 ≥ 1.5, 5, INTEGER( I ) + 3))” to display class in cell
D2, and duplicated this in cells D3 through D1001.

Answer group for F:


a) (B2−F1)/H1 b) (B2−H1)/F1
c) (B2−F$1)/H$1 d) (B2−H$1)/F$1
e) (B2−$F1)/$H1 f) (B2−$H1)/$F1

Answer group for G:


a) < −1.5 b) ≤−1.5 c) =−1.5 d) ≥−1.5
e) >−1.5 f) <1.5 g) ≤1.5 h) =1.5
i) ≥1.5 j) >1.5

442
Afternoon Exam Section 12 Software Development (Assembler)

Answer group for H:


a) 0 b) 1 c) 2
d) 3 e) 4 f) 5

Answer group for I:


a) C2−2.5 b) C2−1.5 c) C2−0.5 d) C2
e) C2+0.5 f) C2+1.5 g) C2+2.5

Subquestion 4
From the answer group below, select the appropriate phrases to be inserted in each blank
in the description below concerning the new class placement method.

For past course applicants, Mr. U calculated each question’s correct answer ratio for each of
the classes 1 through 5, and created the “Correct answer ratio” worksheet shown in Fig. 4.

A B C D E F ... CW
1 Q1 Q2 Q3 Q4 Q5 ... Q100
2 Class 1 0.50 0.69 0.80 0.35 0.10 ... 0.38
3 Class 2 0.55 0.77 0.84 0.43 0.15 ... 0.55
4 Class 3 0.63 0.79 0.85 0.56 0.35 ... 0.67
5 Class 4 0.68 0.85 0.93 0.64 0.68 ... 0.73
6 Class 5 0.78 0.88 0.99 0.73 0.93 ... 0.88

Fig. 4 “Correct answer ratio” worksheet

The Fig. 4 worksheet shows that the correct answer ratio for Q1 was 0.50 for Class 1,
0.55 for Class 2, and so on.
Next, Mr. U used the Fig. 4 worksheet to create the “Class determination” worksheet
shown in Fig. 5, and performed class placement by inputting the status of course applicants’
accuracy in Row 2.

443
Afternoon Exam Section 12 Software Development (Assembler)

A B C D E F ... K L
1 Q5 Q25 Q27 Q37 Q43 ... Q98 Probability
2 Accuracy 1 0 0 1 0 ... 1
3 Class 1 0.10 0.20 0.17 0.18 0.19 ... 0.28
4 Class 2 0.15 0.36 0.23 0.22 0.41 ... 0.33
5 Class 3 0.35 0.43 0.45 0.43 0.56 ... 0.57
6 Class 4 0.68 0.69 0.68 0.63 0.78 ... 0.78
7 Class 5 0.93 0.98 0.80 0.88 0.95 0.91
Probability
8 0.83 0.18 0.81 0.28
of Class 1
Probability
9 0.15 0.64 0.77 0.22 0.59 0.33
of Class 2
Probability
10 0.35 0.57 0.55 0.43 0.44 0.57
of Class 3
Probability
11 0.68 0.31 0.32 0.63 0.22 0.78
of Class 4
Probability
12 0.93 0.02 0.20 0.88 0.05 0.91
of Class 5
Note: The calculated values for the shaded parts are not shown.
Fig. 5 “Class determination” worksheet

In the Fig. 5 worksheet, the 10 questions Q5, Q25, Q27, ... Q98 are selected as the test to
be used for new class placement. The correct answer ratio for each question, by class,
references the Fig. 4 worksheet and is displayed in cells B3 through K7.
For a Class 1 person, the probability that Q5 is correct and Q25 is incorrect is J .
Mr. U decided to apply the method for calculating the probabilities for these 2 questions to
the selected 10 questions, and to perform class placement using the method shown below.
(1) Enter the accuracy of course applicants with regard to the selected 10 questions in
Column 2.
(2) In cell B8, enter the expression K to calculate the probability of Class 1
persons obtaining the result in Cell B2, and duplicate this in cells B8 through K12.
(3) In cell L8, enter the expression L to calculate all values for cells B8 through
K8, and duplicate this in cells L9 through L12.
(4) Enter the expression “MAX(L8:L12)” in cell L2.
(5) Within cells L8 through L12, search for cells with the same value as cell L12, and
determine the class that corresponds to that cell.

444
Afternoon Exam Section 12 Software Development (Assembler)

To efficiently perform class placement using this method, the selected 10 questions need
only be questions that M .

Answer group for J:


a) 0.02 b) 0.08 c) 0.10
d) 0.15 e) 0.20 f)0.30

Answer group for K:


a) B$2*B3 b) B$2*(1−B3)
c) (1−B$2)*B3 d) (1−B$2) * (1−B3)
e) B$2*B3+(1−B$2)*(1−B3) f) (1−B$2)*B3+B$2* (1−B3)
g) (1−B$2)*B3*B$2*(1−B3)

Answer group for L:


a) Total b) Product c) Average

Answer group for M:


a) have large differences in the correct answer rate
b) have small differences in the correct answer rate
c) are difficult
d) are easy
e) are randomly-chosen

445

You might also like