Downloaded from hlayiso.com
basic education
Department:
Basic Education
REPUBLIC OF SOUTH AFRICA
JUNE EXAMINATION 2015
INFORMATION TECHNOLOGY P1
GRADE 11
EXAMINER: M PADAYACHEE MODERATOR: S NAIDOO
DURATION: 3HRS DATE: 11 ~ 06 - 2015
MARKS: 150
{ 7 } INSTRUCTIONS TO LEARNERS:
. Ensure that this paper contains 6 pages and 3 questions.
Answer all questions.
. Save your work at every 10 minute interval.
Ensure that your work is being saved in the folder you are going to submit for
marking. ;
. Take heed of the time stipulation for each question. Follow it to avoid incomplete
answers.
Check your exam folder and ensure that you have the following files :
e A Netbeans project called June2015G11 that contains:
o Apackage called JunePack
o A frame class called Q1Frame
o Aclass called CreditClass
o A frame class called CreditFrame
o A text file called Credit.txt
Insert your name in the first line of every class.
Page 1 of 6
Skip to contentAll 2015 papers 





View all





Information Technology Grade 11 P1 2015 Memo
Grade 11 Information Technology Paper 1 memorandum from the KwaZulu Natal June 2015, 14 pages. Read online or download the free PDF.
Information Technology · Grade 11 · KwaZulu Natal June · 2015. Memorandum, 14 pages. Read online or download the PDF.
- Subject
- Information Technology
- Grade
- Grade 11
- Document type
- Memorandum
- Year
- 2015
- Exam period
- KwaZulu Natal June
- Paper
- 1
- Curriculum
- CAPS
- Pages
- 14
- File size
- 1.7 MB
Free to read online, no sign-up needed
Loading document…
Loading document…
1 of 14
This exam
Document textSearch extracted text and jump to a page.
Downloaded from hlayiso.com
QUESTION ONE [50 min]
You are requested to develop apps to assist in the management of the media centre.
The first app that your help is required in is the app designed by the learners to aid the process of calculating
charges for the photocopier.
The school has a pricing system based on the grades and the number of copies made, for each learner and
teacher that may use the system. Educators will only pay for colour copies as stated below.
The learners will pay as follows:
GRADE 8 AND9 e 50c per copy for <=15 copies
An additional 30c is charged for every copy more than 15
For every copy more than 50copies, an additional R1 is charged.
GRADE 10 AND 11 ©80c for every copy <=25 copies.
*Additional 50c per.copy for more than 25 copies
#R1.20 is charged for every copy over 50 copies
GRADE 12 The first 15 copies is free
eFrom 16 to 35 copies, a charge of R1.10 is charged per copy
®An additional cost of 50c per copy is charged for copies above 35
Nb. Each colour copy costs R4 per colour copy. Colour copies are only made for teachers.
Open the project June2015G11 and execute the Q1Frame. The program has no functionality.
Insert your name as a comment in the first line of each class.
Study the GUI below and complete the code for the respective buttons and components.
1.1. Program the components in the Data Entry panel as follows:
1.1.1. Format the jPanel3 to a border entitled Quotation.
1.1.2. Set the spinner in the from 0 to 100, type integer, using the properties window.
1.1.3. Set the combo box to select the grade(8 ~- 13) as integers.
1.1.4. Initialise the radio buttons into the same group.
1.1.5. Place a title at the top of jPanel1 that reads: “Photocopy Application”
Page 2 of 6
(3)
(3)
(3)
(3)
(3)
Downloaded from hlayiso.com
1.2. Declare the global variables for the following data entries in the Q1Frame class. (3)
Name of Identifier Type Description
numCopies Integer value | The number of copies made by the client —- accessed from spinner
gr Integer A value in the range 8 to 13 — combo box selection. Nb. 13 represents a
teacher
name Text The name of the client — jTextfield
numBlack Integer The number of black copies made — jTextfield
numCol Integer The number of colour copies.
1.3. Write code, for the CAPTURE DATA button in the Data Entry panel, that assigns the values upon entry to
the global variables.
Note:
¥ The number for colour must be entered only if Colour radio button is selected.
vif Black/White is selected, the number is taken from the text field on the top.
Vv |falearner selects a colour photocopy, display a suitable message to ask them to reselect.
as
Kony
ois CAPTURE BATA
‘CAPTURE DATA
1.4. Program the PROCESS button to calculate the price that the client must pay. Take note of the following:
> Teachers will only pay for colour copies. Black and white copies are free for teachers. Therefore the
number of copies for teachers will be for colour only.
Use the sample run below:
NAME ‘MR Naidoo
TEACHER
eo Ae || | NUM of Black Copies
2 NUM of Calour Copies
PRICE °R20,00
MR Blaldoo
Page 3 of 6
Downloaded from hlayiso.com
es pee .
3 i
NAME ‘Peter
GRADE cal
NUM of Black Copies: 3
NUM of Colour Goples 0
= PRICE R240
: ot ie
os
Peter
(8)
1.5. Program the Print Quote button in the Quotation panel to display the output as shown in the sample run.
(6)
[40]
QUESTION TWO
The school wants to offer a credit option to teachers. You are to assist the software developers by writing the
appropriate methods to make the application more effective.
You have been supplied with the GUI and the object class in which you are required to write the necessary
methods. You have also been supplied with a text file that contains details of each teacher who has taken a
loan. Study the text file called “Credit.txt” shown below:
PillayD; 650; 930; 0; 700; 450
MoodTeyS; 2100; 300; 450;1200; 500 (
Terryw; 0: 780; 0; 200; 650 OD
DeonundA; 0; 0; 220;1100;0
Rambal ly; 2600; 860; 0; 700; 250
Open the Credit class and the CreditFrame class and execute them both. Both the object class and the GUI
class do not have any functionality. Write the respective code to provide functionality to the buttons as
requested in the questions below:
2.1. Open the object class and insert code as requested below:
2.1.1. Declare the following instance variables:
= Aone dimensional string array that will hold the teacherID.
= Atwo dimensional array called amntOwed to store the amount owed for each day of the week(school
week) by each teacher.
= Aone dimensional array that stores a weekly payment made by the teacher(payment). (3)
Page 4 of 6
Downloaded from hlayiso.com
2.1.2. Write the accessor methods to return the three arrays declared above. (6)
2.1.3. Write a void method called fillArrays that will open the text file and fill each of the instance variables
with the respective Values from the texfile. (15)
2.1.4, Write a return method called totalOwed to return an array with the total amount owed for the week by
each teacher. (6)
2.1.5, Write a void method called sortCredits to sort the totalOwed and teacherID arrays in descending order
of amount owed for the week. (7)
2.1.6. Write a return method called teacherSearch that will search for an ID entered by the user and return a
string containing all the details.
e.g. “PillayS , 12.50 , 11.00 , 9.00, 0.00 , 4.00” (7)
2.2, Open the frame class and insert code to interact with the object class in the following way:
2.2.1. In the variable section, declare the object globally that will be used as an instance of the Credit class. (2)
2.2.2. In the button called Fill Arrays, call the method that extracts the arrays from the text file and display
them in a tabular form in the text area. (9)
2.2.3. Program the button called See Total For Week by calling the method totalOwed to return the total array
and then display the code of each teacher and the amount owed for the week. (7)
2.2.4, Code the button sortCredits to display the sorted data neatly in the text area. (7)
2.2.5. Program the button Search for Teacher displaying all the details of the teacher if it is found. Allow the
user to input the Teacher code and use this code to search. If the teacher is not found, display a suitable
message. (7)
(75)
QUESTION THREE
A database DBTeacher needs to be created where there is only one table called TeachersTBL. This table
contains the following fields for each teacher:
a The teacherlD — The teacher’s initials followed by any three digits(teachID).
a The teachers amount owing. — the amount the teacher is owing(owingAMT)
a The teacher's payment made ~ if the teacher does make a payment(payment).
You are expected to:
3,1. Create a database called DBTeacher in Netbeans services tab. (2)
3.2. Create a table in the DBTeacher database called TeacherTBL. Use the fields given above. (7)
3.3. Populate the database table with meaningful data. You may use specific data from the text file or create
your own. (3)
Page 5 of 6
Downloaded from hlayiso.com .
3.4, In the project called June2015G11, create a new jframe called JunQ3 in the JunePack package and add a
panel to it. (3)
3.5, Add a table component and bind the table to the database table. Ensure that the persistence class in the
META-INF folder has the correct path specification for the database. Copy the database to the project
folder. Compile and run it. (12)
3.6, Add to the panel the respective text fields and the labels for the data in the jTable. (4)
3.6. Bind each textfield to the respective values in the table. (4)
[35]
TOTAL = 150
CONDARY SCHOOL
N7 OF MATHS & SCIENCES
4.0.0. MR L PILLAY
/
GREENBURY 81
DEPA
Page 6 of 6
()
Downloaded from hlayiso.com
Grl1 Paperl MEMO QQuest!
4%
2 *To change this template, choose Tools | Templates
3 * and open the template in the editor.
44
5 package JunePack;
6
7 import javax.swing.JOptionPane;
8
or
10 *
11 * @author comp13
12%
13 import java.text.*;
14 public class Q1Frame extends javax.swing.JFrame {
SCHOOL
SCIENCES
15
160
17 -* Creates new form Q1Frame
18
19 private int numCopies;
20 private int numBlack;
21 private Int numCol;
22 _ private int gr;
23 private String name;
24 private double price = 0.00;
25 DecimalFormat d = new DecimalFormat("0.00");
26 public Q1Frame() {
27 initComponents();
28 this.setLocationRelativeTo(null);
29 this.setTitle("Photocopy Application");
30
31}
32
33
34. * This method is called from within the constructor to initialize the form.
35 *WARNING: Do NOT modify this code. The content of this method is always
36 * regenerated by the Form Editor.
37)
38 @SuppressWarnings("unchecked")
39 // <editor-fold defaultstate="collapsed" deso="Generated Code">
40 _ private void initComponents() {
44
42 buttonGroup1 = new javax.swing.ButtonGroup();
43 jLabel5 = new javax.swing. JLabel();
44 jPanel1 = new javax.swing.JPanel();
45 JPanel2 = new javax.swing.JPanel();
46 jlabel1 = new javax.swing.JLabel();
47 jJSpinnert = new javax.swing.JSpinner();
48 jLabel2 = new javax.swing.JLabel();
49 JComboBox1 = new javax.swing.JComboBox();
50 JPanel4 = new javax.swing.JPanel();
51 jRadioButton1 = new javax.swing.JRadioButton();
52 jRadioButton2 = new javax.swing.JRadioButton();
53 jLabel3 = new javax.swing.JLabel();
54 jLabel4 = new javax.swing.JLabel();
55 jTextField1 = new javax.swing.JTextField();
56 jButton1 = new javax.swing. JBuiton();
57‘ jButton2 = new javax.swing.JButton();
58 jPanel3 = new javax.swing.JPanel();
59 jScrollPane1 = new javax.swing.JScrollPane();
60 jTextArea1 = new javax.swing.JTextArea();
61 JButton3 = new javax.swing.JButton();
1.1 of 8 2015.06.08 12:36:27
Downloaded from hlayiso.com = ssi
Grl1 Paperl MEMO QQuestl
62
63 jLabel5.setText("jLabel5");
64
65 setDefaultCloseOperation(javax.swing. WindowConstants. EXIT_ON_CLOSE);
66
67 jPanel2.setBorder(javax.swing. BorderFactory.createTitledBorder(null, "Data Entry",
javax.swing.border. TitledBorder. CENTER, javax.swing. border. TitledBorder.DEFAULT_POSITION));
68
69 jLabel1.setText("Number of Copies");
70
71 jSpinner1.setModel(new javax.swing.SpinnerNumberModel(0, 0, 100, 1));
72
73 jLabel2.setText("GRADE");
74
78 jComboBox1,setModel(new javax.swing.DefaultComboBoxModel(new String|] {"8"
76
77 jPanel4.setBorder(javax.swing.BorderFactory.createTitled Border("Copy Type"));
78
79 buttonGroup1.add(jRadioButton1);
80 jRadioButton1.setText("Colour");
81
82 buttonGroup1.add(§RadioButton2); ( )
83 jRadioButton2.setText("Black/White");
84
85 javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4),
86 jPanel4.setLayout(jPanel4Layout);
87 jPanel4Layout.setHorizontalGroup(
88 jPanel4Layout.createParallelGroup(javax.swing.GroupLayout Alignment LEADING)
89 .addGroup(jPanel4Layout.createSequentialGroup()
90 . addCentainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE). .
91 .addG:oup(Panel4Layout.createParallelGroup(Javax.swing.GroupLayout Alignment.LEADING)
92 .addGroup(javax.swing.GroupLayout Alignment. TRAILING, jPanel4Layout.createSequentialGroup()
93. .addComponent(jRadioButton1)
94 .addGap(36, 36, 36))
95 .addGroup(javax.swing.GroupLayout.Allgnment. TRAILING, jPanel4Layout. createSequentialGroup()
96 .addComponent(jRadioButton2)
97 .addContainerGap())))
98 y
99 jPanel4Layout.setVerticalGroup(
100 jPanel4Layout.createParallelGroup(javax.swing.GroupLayout Alignment.LEADING)
101 .addGroup(jPanel4Layout.createSequentialGroup()
102 .addContainerGap(javax.swing.GroupLayout. DEFAULT_SIZE, Short. MAX_VALUE) ¢
403 _addComponent(RadioButton1) )
104 .addPreferred Gap (javax.swing.LayoutStyle.ComponentPlacement. UNRELATED)
105 .addComponent(jRadioButton2))
106);
107
108 jLabe!3.setText("Print Type ");
109
110 jLabel4.setText("NAME");
111
112 jButton1 .setText("CAPTURE DATA"),
113 jButton1 .addActionListener(new java.awt.event.ActionListener() {
114 public void actionPerformed(java.awt.event.ActionEvent evt) {
115 jButton’ActionPerformed(evt);
116 }
117 Dy
118 ‘
119 jButton2.setText("PROCESS");
120 jButton2.addActionListener(new java.awt. event ActionListener) {
4124 public void actionPerformed(java.awt.event.ActionEvent evt) {
2.1 of 8 | 2015.06.08 12:36:27
=
Downloaded from hlayiso.com
Grl1-Paper1 MEMO QQuest!
122 jButton2ActionPerformed(evt);
123 }
124 yi
125
126 jJavax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(Panel2);
127 jPanel2.setLayout(Panel2Layout);
128 jPanel2Layout.setHorizontalGroup(,
129 jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
130 ,addGroup(Panel2Layout.createSequentialGroup()
134 .addContainerGap()
132 -addGroup(jPanel2Layout.createParallelGroup(javax.swing. GroupLayout.Alignment.LEADING)
133 .addGroup(jPanel2Layout.createSequentiaiGroup()
134 -addGroup(jPanel2Layout.createParalle!Group(javax.swing, GroupLayout.Alignment.LEADING)
135 .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 58,
javax.swing.GroupLayout.PREFERRED_SIZE)
136 .addComponent(jLabel3))
137 ,addGroup(jPanel2Layout.createParalle!Group(javax.swing, GroupLayout.Alignment. LEADING)
138 -addGroup(jPanel2Layout.createSequentialGroup()
139 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement. UNRELATED)
140 ° .addGroup(jPanel2Layout.createParalle|Group(javax.swing.GroupLayout.Alignment. LEADING)
144 -addGroup(jPanel2Layout.createSequentialGroup()
142 .addGap(0, 0, Short. MAX_VALUE)
143 -addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment. TRAILING)
144 ,addComponent(Label2, javax.swing.GroupLayout.PREFERRED_SIZE, 58,
javax.swing.GroupLayout. PREFERRED_SIZE)
145 .addComponent(jLabel1, javax.swing.GroupLayout,PREFERRED_SIZE, 125,
javax.swing.GroupLayout.PREFERRED_SIZE))
146 id .addGap(26, 26, 26)
147 a .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment. LEADING)
148 ee .addComponent(jJComboBox1, javax.swing.GroupLayout. Alignment. TRAILING,
Javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
149 .addComponent(Spinnert, javax.swing.GroupLayout.Alignment. TRAILING,
javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE))
150 -addGap(30, 30, 30)) :
151 .addComponent(jTextField1))
162 .addContainerGap())
153 .addGroup(jPanel2Layout. createSequentialGroup()
154 | -addGap(33, 33, 33)
155 -addComponent(Panel4, javax.swing.GroupLayout. PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
156 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
157 .addGroup(jPanel2Layout.createSequentialGroup()
158 -addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 198,
javax.swing.GroupLayout. PREFERRED_SIZE)
159 saddGap(18, 18, 18)
160 .addComponent(jButton2, Javax.swing.GroupLayout.PREFERRED_SIZE, 170,
javax.swing.GroupLayout.PREFERRED_SIZE)
161 .addGap(0, 21, Short. MAX_VALUE))))
162 ~~);
163 jPanel2Layout.setVerticalGroup(
164 jPanel2Layout.createParalle|Group(javax.swing.GroupLayout.Alignment.LEADING)
165 .addGroup(jPanel2Layout.createSequentialGroup()
166 .addGap(19, 19, 19)
167 .addGroup(jPanel2Layout.createParalle|Group(javax.swing.GroupLayout. Alignament.BASELINE)
168 .addComponent(jLabel1)
169 .addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, 30,
javax.swing.GroupLayout. PREFERRED_SIZE))
170 - .addGap(33, 33, 33)
174 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment. BASELINE)
172 .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 32,
3.1 of 8 2015.06.08 12:36:27
Downloaded from hlayiso.com
Grl11 Paper1 MEMO QQuest!
javax.swing.GroupLayout.PREFERRED_SIZE)
173 .addComponent(jLabel2))
174 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
175 .addGroup(/Panel2Layout.createParallelGroup(javax. swing, GroupLayout Alignment. LEADING)
176 ,addComponent(jLabel3)
177 .addComponent(jPanel4, javax.swing.GroupLayout. PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout. PREFERRED_SIZE))
178 vaddPreferredGap(javax.swing. LayoutStyle, ComponentPlacement. RELATED,
javax.swing,GroupLayout,DEFAULT_SIZE, Short.MAX_VALUE)
179 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout Alignment. BASELINE)
180 .addComponent(jLabel4)
181 ,addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout, DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
182 vaddGap(24, 24, 24)
183 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout Alignment. BASELINE)
184 .addComponent(jButton1)
185 .addComponent(jButton2))
186 .addContainerGap())
187 y
188
189 jPanel3.setBorder(javax.swing.BorderFactory.createTittedBorder(null, "Quotation",
javax.swing. border, TitledBorder.CENTER, javax.swing.border.TitledBorder, DEFAULT_POSITION));
190
191 jTextArea1.setColumns(20);
192 jTextArea1.setRows(5);
193 jScrollPane1 .setViewportView(jTextAreat );
194
195 JButton3.setText("Print Quote");
196 jButton3.addActionListener(new java.awt.event.ActionListener() {
197 public void actionPerformed(java.awt.event ActianEvent evt) {
198 JButton3ActionPerformed(evt);
4199 }
200 ys
201
202 Javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(Panel3);
203 jPanel3.setLayout(/Panel3Layout);
204 jPanel3Layout.setHorizontalGroup(
205 jPanel3Layout.createParallelGroup(javax.swing.GroupLayout Alignment.LEADING)
206 .addGroup(jPanel3Layout.createSéequentialGroup()
207 .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout. Alignment. LEADING)
208 .addGroup(jPanel3Layout.createSequentialGroup()
209 addGap(65, 65, 65)
210 .addGomponent(jButton3, javax.swing.GroupLayout. PREFERRED_SIZE, 161,
javax.swing.GroupLayout.PREFERRED_SIZE))
211 .addGroup(jPanel3Layout.createSequentialGroup()
212 .addContainerGap().
213 .addComponent(jScrollPane1, javax.swing.GroupLayout. PREFERRED_SIZE, 251,
javax.swing.GroupLayout.PREFERRED_SIZE)))
214 .addContainerGap(javax.swing.GroupLayout. DEFAULT_SIZE, Short.MAX_VALUE))
215 )
216 JPanel3Layout.setVerticalGroup(
217 jPanel3Layout.createParallelGroup(javax.swing.GroupLayout Alignment. LEADING)
218 .addGroup(javax.swing.GroupLayout.Aligament. TRAILING, jPanel3Layout.createSequentialGroup()
219 .addContainerGap(javax.swing.GroupLayout, DEFAULT_SIZE, Short.MAX_VALUE)
220 ,addComponent(jButton3)
221 .addPreferredGap(javax.swing.LayoutStyle, ComponentPlacement. UNRELATED)
222 .addComponent(ScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 251,
javax.swing.GroupLayout.PREFERRED_SIZE)
223 saddGap(7, 7, 7))
224 y
225
4.1 of 8 2015.06.08 12:36:27
()
—
Downloaded from hlayiso.com
Gril Paper! MEMO QQuestl
226 javax.swing.GroupLayout jPaneliLayout = new javax.swing.GroupLayout(/Panel1);
227 ° jPanel1.setLayout(jPanel1 Layout);
228 jPanel1Layout.setHorizontalGroup(
229 JPanel Layout.createParalleIGroup(javax.swing.GroupLayout.Alignment.LEADING)
230 -addGroup(|Panel1 Layout.createSequentialGroup()
231 .addGap(29, 29, 29)
232 -addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE,
Javax.swing.GroupLayout. DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
233 .addGap(18, 18, 18)
234 -addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
235 .addContainerGap(97, Short.MAX_VALUE))
236 ‘
237 jPaneltLayout.setVerticalGroup(
238 jPanelt Layout.createParalleIGroup(javax.swing.GroupLayout.Alignment.LEADING)
239 ,addGroup(Javax.swing.GroupLayout Alignment. TRAILING, jPanel1 Layout.createSequentialGroup()
240 -addGap(42, 42, 42)
241 .addGroup (JPanel Layout createParallelGroup(javax.swing.GroupLayout.Alignment. TRAILING)
242 . .addComponent(|Panel3, javax.swing.GroupLayout.DEFAULT_SIZE,
Javax.swing.GroupLayout.OEFAULT_SIZE, Short.MAX_VALUE)
243 .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
244 .addContainerGap()}
245 oH
246
247 Javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
248 getContentPane().setLayout(layout);
249 layout.setHorizontalGroup(
250 layout createParatle|Group javax.swing. GroupLayout. Alignment. LEADING)
251 .addGroup(javax.swing, GroupLayout Alignment. TRAILING, layout.createSequentialGroup(}
252 .addContainerGap()
253 .addComponent(jPanelt, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout, DEFAULT_SIZE,
Short.MAX_VALUE)
254 -addContainerGap())
255 )
256 layout.setVerticalGroup(
257 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
258 -addGroup(javax.swing.GroupLayout.Alignment. TRAILING, layout.createSequentialGroup()
259 .addContainerGap() .
260 .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
261 .addContainerGap())
262 \
263
264 pack();
265 = Mi </editor-fold>
266
267 private void /Button1ActionPerformed(java.awt.event.ActionEvent evt) {
268 numCopies = (int)(jSpinner1.getValue());
269 JOptionPane.showMessageDialog(null numCopies+""
270 String grd = (String)(j ComboBox! .getSelecteditem(
271 gr = Integer.parselnt(grd);
272 name = jTextField1.getText();
273 if(GRadioButton1 isSelected()) {
274 If (gr == 13) {
275 numCol = Integer.parselnt(JOptionPane.show!nputDialog("Enter number of colour copies!"));
276 numBlack = numCopies - numCol;
277 }
278
279 else {
280 * numBlack = numCopies;
5.1 of 8 2015.06.08 12:36:27
|
|
Downloaded from hlayiso.com oo
Grli Paper! MEMO QQuestl
281
282 JOptionPane.showMessageDialog(null,"You Cannot choose Colour!"),
283 }
284
285
286}
287 else {
288 numBlack = numCopies;
289 }
290 }
291
292 private void jButton2ActionPerformed(java.awtevent.ActionEvent evt) {
293
294 switch (gr) {
295 case 8; case 9: {
296 if(numCopies>15 && numCopies >50){
297 price = 15*0.5 + 35*0.8 + (numCopies - 50)*1.8;
298 jelse {
299 if(numCoples >16 && numCopies<=60){
300 price = 15*0.5 + (numCopies -15) *0,8;
301 } ~ )
302 else{ price = numCopies*0.5;} (
303 }
304 } break;
305 case 10; case 11: {
306 if(numCopies>25 && numCopies >50){
307 price = 15*0.8 + 25*1.3 + (numCopies - 50)*2.5;
308 jelse {
309 if(numCopies >15 && numCoples<=50){
310 price = 15*0.8 + (numCoples -25) *1.3;
341 }
312 else{ price = numCopies”0.8;}
313 }
314 } break;
315 case 12: {
316 if(numCopies>15 && numCopies >36){
317 price = (35-15)*1.1 + (numCopies - 35)*1.6;
318 Jelse { :
319 if(numCopies >15 && numCopies<=35){
320 price = (numCopies -15) “1.1;
321 }
322 : . ; C.
323 }
324
325 } break;
326 case 13:{
327 price = numCol * 4;
328 } break;
329
330}
331 /f deault: JOptionPane.showMessageDialog(null,"INVALID!");
332}
333°
334 private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
335 JTextArea’ append("NAME \t:"+namet+'"\n");
336 if(gr == 13)
337 jTextAreat.append("TEACHER\n");
338 }
339 else { .
340 jTextArea1.append("GRADE \t"+gr+"\n"); .
341 }
6.1 of 8 2015.06.08 12:36:27
as
Downloaded from hlayiso.com
Gr11 Paper] MEMO QQuest!
342 {TextArea1.append("NUM of Black Copies \t:"+numBlack+"\n");
343 JTextAreat append("NUM of Colour Copies \t:"+numCol+'\n");
344 jTextArea1.append("PRICE \t:R"+d.format(price)+"\n");
345 +}
346
347°
348 * @param args the command line arguments
349007
350 public static void main(String args[]) {
351 I* Set the Nimbus look and feel */
352 I/<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
353 * If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel,
354 * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.htm!
355 wh
356 try{
357 for (javax.swing.UIManager.LookAndFeellnfo info : javax.swing.UIManager.getinstalledLookAndFeels()) {
358 if ("Nimbus".equals(info,getName())) {
359 Javax.swing.UIManager,setLookAndFeel(info.getClassName());
360 break;
361 }
362 }
363 } catch (ClassNotFoundException ex) {
364 java.util. logging.Logger.getLogger(Q 1 Frame.class,getName()).log(java. util logging.Level.SEVERE, null, ex);
365 “ } catch (InstantiationException ex) {
366 java.util.logging.Logger.getLogger(Q 1 Frame.class.getName()).log(java.util.logging.Level. SEVERE, null, ex);
367 } catch (IllegalAccessException ex) {
368 java.util.logging. Logger.getLogger(Q1Frame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
369 } catch (javax.swing. UnsupportedLookAndFeelException ex) {
370 java.util. logging.Logger.getLogger(Q1Frame.class.getName()).log(java. util. logging.Level.SEVERE, null, ex);
374} ts
372 Ns/editor-fold>
373
374 /* Create and display the form */
375 java.awt. EventQueue.invokeLater(new Runnable() {
376 public void run() {
377 new Q1Frame().setVisible(true);
378 }
379 yk
380 }
381 7 Variables declaration - do not modify
382 private javax.swing.ButtonGroup buttonGroup1;
383 private javax.swing.JButton jButton1; .
384 _ private javax.swing.JButton jButton2;
385 private javax.swing.JButton jButton3;
386 private javax.swing.JComboBox jComboBox1;
387 private javax.swing.JLabel jLabel1;
388 _ private javax.swing.JLabel jLabel2;
389 private javax.swing.JLabel jLabel3;
390 private javax.swing.JLabel jLabel4;
391 private javax.swing.JLabel jLabel5;
392 private javax.swing.JPanel jPanel1;
393 private javax.swing.JPanel jPanel2;
394 private javax.swing.JPanel jPanel3;,
395 private jJavax.swing.JPanel jPanel4;
396 private javax.swing.JRadioButton jRadioButton1;
397 private javax.swing. JRadioButton jRadioButton2;
398 private javax.swing.JScrollPane jScrollPane1;
399 private javax.swing.JSpinner jSpinner1;
400 private javax.swing. JTextArea jTextAreat;
401 private javax.swing. JTextField jTextField1;
402 #/ End of variables declaration
7.1 of 8
2015.06.08 12:36:27
Grl1 Paperl
403 }
8.1 of 8
Downloaded from hlayiso.com
MEMO QQuestl
2015.06.08 12:36:27
Study this subject
Recommended for this subject

Memorandum
Information Technology Grade 11 P2 2015 Memo

Memorandum
Information Technology Grade 11 P1 2015 Memo (Eng)

Memorandum
Information Technology Grade 11 P1 2015 Memo (Afr)

Memorandum
Information Technology Grade 11 P1 2017 Memo

Question paper
Information Technology Grade 11 P1 2015 QP (Afr)

Question paper
Information Technology Grade 11 P1 2018 QP
More from Grade 11 Information Technology

Annual teaching plan
Gr 11 Info Tech ATP 2023 24

Question paper
Information Technology Grade 11 P1 2022 QP (Afr)

Question paper
Information Technology Grade 11 P1 2022 QP (Eng)

Question paper
Information Technology Grade 11 P2 2022 QP (Afr)

Question paper
Information Technology Grade 11 P2 2022 QP (Eng)

Question paper