Multiple Choice Questions (Computer Systems, Information Security, Software Design, Management, Strategy)
Multiple Choice Questions (Computer Systems, Information Security, Software Design, Management, Strategy)
Afternoon Exam
Section
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)
(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
218
Afternoon Exam Section 10 Selected Questions (Computer System)
LR
10 Sets the contents of register v in register r.
(Load Register)
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.
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
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.
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)
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)
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)
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)
(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)
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)
(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.
B D J
C E F G
H I
(2) The execution sequence of the modules in this program is as shown in Fig. 2.
α
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.
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.
P0
P0 A
area
P1 P2 P3
P1 B, C
P2 D, E, F, G, H, I
P3 J
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.
Q0
Q0 A
Q1 Q2 Q5
Q1 B, C
Q3 Q4 Q2 D
Q3 E, F
Q4 G, H, I
Q5 J
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
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.
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.
Running
state
(i) (iii)
(ii)
Ready Waiting
state state
(iv)
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.
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.
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.
T1 10 50 10 40 10 30 10
T2 30 40 20 30 30
T3 60 30 10
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.
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
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.
Parcel Table
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.
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.
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.
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.
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.
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.
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.
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.
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 .
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.
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.
w= B × 8 × ( 150 + C ) bits/second
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.
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)
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
DMZ
Firewall B
Corporate
LAN
Database Management
server PC
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)
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.
249
Afternoon Exam Section 10 Selected Questions (Information Security)
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:
(i)
Phase 1
(ii)
(iii) Phase 2
(iv)
(v)
Phase 3
(vi)
(vii)
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.
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.
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)
[File Description]
(1) Both the master file and the transaction file use the same record format that
consists of the following items.
(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)
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
M input process
T input process
Compare
KM = Maximum value
and
KT = Maximum value
Note: M' is a storage for work
< >
KM :KT
T input process
A B
Compare
End
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
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:
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 .
256
Afternoon Exam Section 10 Multiple-choice Questions (Software design)
Main process
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
Compare
End
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
258
Afternoon Exam Section 10 Multiple-choice Questions (Software design)
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.
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
(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.
(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)
Login Exit
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
Process
Music selection
process Main download
process
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.
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.
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.
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)
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.
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.
(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.
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
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)
Q10-14
Read the following description of risk management in a project, and then answer
Subquestions 1 through 4.
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)
Risk identification
274
Afternoon Exam Section 10 Multiple Choice Questions (Management)
[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.
(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.
(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.
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
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)
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.
Business
server
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.
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)
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.
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)
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)
…
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.
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
288
Afternoon Exam Section 10 Multiple Choice Questions (Management)
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.
289
Afternoon Exam Section 10 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.
290
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)
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 .
292
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)
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.
20
Sales revenue (10k Dollars)
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 ↓
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.
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.
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)
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)
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.
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.
[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.
300
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)
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.
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
303
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)
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 .
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.
[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
D B
Low High
Market
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.
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.
Subquestion 1
From the answer group below, select the correct answer to be inserted into each blank
A through D in the figure.
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.
(2) From the answer group below, select the appropriate category to be inserted into
each blank G through I in the description.
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)
311
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)
Viewpoint Goal
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
Finance
A
Promotion of knowledge
management
313
Afternoon Exam Section 10 Multiple-choice Questions (Strategy)
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.
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)
[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:
(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)
(5) The following table shows the specifications of the arguments of Aggregate.
Table Specifications of the arguments of Aggregate
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)
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].
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)
Subquestion 2
From the answer group below, select the correct answers to be inserted into the
in the program.
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)
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.
Starting point
10 40
1 2 3
20 30 10 10 30
4 5 6
20 30
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] [∞]
(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.
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] [∞]
(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] [∞]
(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]
(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 ]
(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 ]
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.
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.
(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).
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.
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:
[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
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
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_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.
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
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]
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.
344
Afternoon Exam Section 11 Mandatory Questions (Data structures and Algorithms)
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.
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)
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)
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)
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 */
• D
• return Tmp /* Takes Tmp as 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.
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)
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.
down
y-axis
352
Afternoon Exam Section 12 Software Development (C)
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.
353
Afternoon Exam Section 12 Software Development (C)
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.
Pair
354
Afternoon Exam Section 12 Software Development (C)
[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;
355
Afternoon Exam Section 12 Software Development (C)
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 );
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.
357
Afternoon Exam Section 12 Software Development (C)
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
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.
(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
361
Afternoon Exam Section 12 Software Development (C)
[Program 1]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
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;
};
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;
362
Afternoon Exam Section 12 Software Development (C)
else B ;
363
Afternoon Exam Section 12 Software Development (C)
}
}
void writeTree() {
FILE *fOutput = fopen("output.txt", "w");
writeMember(root, fOutput);
fclose(fOutput);
}
Subquestion 1
From the answer groups below, select the correct answer to be inserted in each blank
in the above program.
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.
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.
Basic
Information
Goro Chemistry English
[Example] 02498 Processing 25 50 ... 67
KIHON Lab Conversation
2
1
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.
...
...
0752 Chemistry Lab 02498 Goro KIHON 0752 02498 50
...
...
...
1997 Basic English 14997 Mamoru 0173 13712 13
Conversation 3 SHIKEN
(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)
student[0] RECORD
Hanako SEKKEI 38
student[1] RECORD
Taro JOHO 75
…
rNextCourse
studentName courseName
rFirstCourse
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.
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
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);
}
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.
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 .
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)
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.
(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.
(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)
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.
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.
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.
02 04 0655
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.
[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)
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.
383
Afternoon Exam Section 12 Software Development (COBOL)
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.
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.
(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.
(2) Caregiver list for new students is sequential files with records in the following
format.
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)
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.
388
Afternoon Exam Section 12 Software Development (COBOL)
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)
Q12-7
Read the following description of a Java program and the program itself, and then,
answer the Subquestion.
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;
A
for (int i = SPADES; i <= CLUBS; i++) {
for (int j = 1; j <= 13; j++) {
cards[ B ] = new Card(i, j);
}
}
}
392
Afternoon Exam Section 12 Software Development (Java)
}
return deck;
}
}
[Program 2]
import java.util.ArrayList;
import java.util.List;
393
Afternoon Exam Section 12 Software Development (Java)
list.remove( E );
checkAndRemove(list);
return;
}
}
}
}
Subquestion
From the answer groups, select the correct answers to be placed in the blanks
in the program.
394
Afternoon Exam Section 12 Software Development (Java)
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.
[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.
>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.
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.
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.
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)
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.
[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;
406
Afternoon Exam Section 12 Software Development (Java)
if (matches(str, i))
return true;
}
return false;
}
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.
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.
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)
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.
(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
(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.
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.
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.
(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)
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.
...
...
...
...
...
Word N -1 1 0 1 ... 1
Word N 0 1 1 ... 0 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.
417
Afternoon Exam Section 12 Software Development (Assembler)
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.
Example:
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
420
Afternoon Exam Section 12 Software Development (Assembler)
Subquestion 1
From the answer groups, select the correct answers to be inserted in the blanks
in the program.
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.
Answer group:
a) 2 b) 6 c) 8
d) 12 e) 16
422
Afternoon Exam Section 12 Software Development (Assembler)
Q12-13
Read the following description of an investment determination regarding implementation
of a new system, and answer Subquestions 1 and 2.
423
Afternoon Exam Section 12 Software Development (Assembler)
424
Afternoon Exam Section 12 Software Development (Assembler)
425
Afternoon Exam Section 12 Software Development (Assembler)
A B C D E F G H I
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
Equipment
8 0
maintenance cost
Communication cost
12
reductions
Phone exchange
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
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
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)
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.
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.
434
Afternoon Exam Section 12 Software Development (Assembler)
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)
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.
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.
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.
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.
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
...
...
...
...
...
...
...
...
...
...
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
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.
442
Afternoon Exam Section 12 Software Development (Assembler)
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
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 .
445