SlideShare a Scribd company logo
1 of 18
Seminar: Coding Principles
Topic Number: 2
App Design for Business
Key topics and learning outcomes of this Seminar
• Reinforce the Java code introduced during Lecture 2 by
running Java code in IntelliJ;
• Develop confidence working with Intellij and logic/layout
files;
• Develop Mobile Application Programming skills;
Open IntelliJ, Create New Project
3
Select ‘Java’
B4004A L1 4
Select as Screenshot
B4004A L1 5
Add a Project name
B4004A L1 6
Opens Class File: Main.java
B4004A L1 7
Run the program, and check the terminal returns ‘Hello
World!’
B4004A L1 8
This is the ‘run’ button:
Type some code into Main.java and run it:
Type this code into the same file in IntelliJ and run it. Some code will need to be deleted to reflect
correctly the code below (ie the Hello World code section). Check the Terminal output.
public class Main {
public static void main(String[] args) {
int a = 2;int b = 4; int c;
c=a+b;
System.out.print(c);
}
}
Change the variables a and b to different values and then run the code again and check the
correct result shows in the Terminal.
B4004A L1 9
Create a for loop
Create a for loop:
public class Main {
public static void main(String[] args) {
for(int i=0;i<10;i++) {
int a = 2; int b = 4; int c;
c = a + b;
System.out.print(c);
}
}
}
… then make it print out each number on a new line by adding “n” for a new line:
System.out.print(c + "n");
… change i<10 to i<20 and run the program again to see what happens
B4004A L1 10
Change code to make it add 1 to each number.
… then make the program add 1 to each number and print it out in the Terminal by adding:
a = a+1;
You will need to move the declaration (int a = 2; int b = 4; int c;) out of the for loop, otherwise the result will remain static as the
program will always go back to those values. Try running it without moving the declaration first, check the output in the Terminal.
Then move it. Put it the line above the for loop. Run it again and check the output in the Terminal.
public class Main {
public static void main(String[] args) {
int a = 2; int b = 4; int c;
for(int i=0;i<13;i++) {
c = a + b;
a = a + 1;
System.out.print(c + "n");
}
}
}
B4004A L1 11
Using multiplication *
Change the code a little to make it run the 75 times table.
public class Main {
public static void main(String[] args) {
int a = 0; int b = 75; int c;
for(int i=0;i<13;i++) {
c = a * b;
a = a + 1;
System.out.print(c + "n");
}
}
}
B4004A L1 12
Concatenating Output
Change the output line of code to this and then look at the output:
System.out.print(a + " times " + b + " = " + c + "n");
Try and write some code to print a box using the character ‘X’ that prints out the same
number of ‘Xs’ across and down.
B4004A L1 13
Working with the if statement;
Try writing this code, changing the value of x to get it to run each statement, and then remove some lines of
code so that there are less decisions. Pay attention to the brackets. Finally end up with just an if statement,
without else.
public class Test {
public static void main(String args[]){
int x = 30;
if( x == 10 ){
System.out.print("Value of X is 10");
}else if( x == 20 ){
System.out.print("Value of X is 20");
}else if( x == 30 ){
System.out.print("Value of X is 30");
}else{
System.out.print("This is else statement");
}
}
}
B4004A L1 14
Summary
This seminar has reinforced the coding principles learned during the
corresponding lecture;
This seminar has provided users of IntelliJ with a good understanding
of how to manage Java code within IntelliJ Development Environment;
Next session
Workshop 2 – Coding Principles
This workshop covers Operators and Strings
End of Seminar
Note: This recording is for your
personal use only and not for further
distribution or wider review.
© Pearson College 2013
Seminar 2 coding_principles

More Related Content

What's hot

02 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_0202 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_02
Pooja Gupta
 
Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10
alish sha
 
Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7
alish sha
 
Qust & ans inc
Qust & ans incQust & ans inc
Qust & ans inc
nayakq
 
Flow Chart & Input Output Statement [3] M
Flow Chart & Input Output Statement [3] MFlow Chart & Input Output Statement [3] M
Flow Chart & Input Output Statement [3] M
ecko_disasterz
 

What's hot (20)

escape sequences and substitution markers
escape sequences and substitution markersescape sequences and substitution markers
escape sequences and substitution markers
 
Managing input and output operations in c
Managing input and output operations in cManaging input and output operations in c
Managing input and output operations in c
 
Input Output Management In C Programming
Input Output Management In C ProgrammingInput Output Management In C Programming
Input Output Management In C Programming
 
Relational Operators in C
Relational Operators in CRelational Operators in C
Relational Operators in C
 
csharp repitition structures
csharp repitition structurescsharp repitition structures
csharp repitition structures
 
CP Handout#6
CP Handout#6CP Handout#6
CP Handout#6
 
02 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_0202 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_02
 
Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10
 
CP Handout#7
CP Handout#7CP Handout#7
CP Handout#7
 
Lab 2
Lab 2Lab 2
Lab 2
 
Input output statement in C
Input output statement in CInput output statement in C
Input output statement in C
 
CP Handout#8
CP Handout#8CP Handout#8
CP Handout#8
 
selection structures
selection structuresselection structures
selection structures
 
CP Handout#2
CP Handout#2CP Handout#2
CP Handout#2
 
7. input and output functions
7. input and output functions7. input and output functions
7. input and output functions
 
Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7
 
Qust & ans inc
Qust & ans incQust & ans inc
Qust & ans inc
 
Basic Input and Output
Basic Input and OutputBasic Input and Output
Basic Input and Output
 
A simple program C# program
A simple program C# programA simple program C# program
A simple program C# program
 
Flow Chart & Input Output Statement [3] M
Flow Chart & Input Output Statement [3] MFlow Chart & Input Output Statement [3] M
Flow Chart & Input Output Statement [3] M
 

Similar to Seminar 2 coding_principles

Datastructure notes
Datastructure notesDatastructure notes
Datastructure notes
Srikanth
 
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docxSpring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
rafbolet0
 
Lecture 2 coding_principles
Lecture 2 coding_principlesLecture 2 coding_principles
Lecture 2 coding_principles
moduledesign
 
Mid term sem 2 1415 sol
Mid term sem 2 1415 solMid term sem 2 1415 sol
Mid term sem 2 1415 sol
IIUM
 
Introduction to Computer and Programing - Lecture 04
Introduction to Computer and Programing - Lecture 04Introduction to Computer and Programing - Lecture 04
Introduction to Computer and Programing - Lecture 04
hassaanciit
 
21: Which method determines if a JRadioButton is selected?
21: Which method determines if a JRadioButton is selected?21: Which method determines if a JRadioButton is selected?
21: Which method determines if a JRadioButton is selected?
sukeshsuresh189
 
Comp 328 final guide (devry)
Comp 328 final guide (devry)Comp 328 final guide (devry)
Comp 328 final guide (devry)
sukeshsuresh189
 

Similar to Seminar 2 coding_principles (20)

C#.net
C#.netC#.net
C#.net
 
Muzzammilrashid
MuzzammilrashidMuzzammilrashid
Muzzammilrashid
 
Python programming workshop session 2
Python programming workshop session 2Python programming workshop session 2
Python programming workshop session 2
 
C decision making and looping.
C decision making and looping.C decision making and looping.
C decision making and looping.
 
Datastructure notes
Datastructure notesDatastructure notes
Datastructure notes
 
UNIT-II CP DOC.docx
UNIT-II CP DOC.docxUNIT-II CP DOC.docx
UNIT-II CP DOC.docx
 
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docxSpring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
 
Programming Fundamentals Functions in C and types
Programming Fundamentals  Functions in C  and typesProgramming Fundamentals  Functions in C  and types
Programming Fundamentals Functions in C and types
 
Lecture 2 coding_principles
Lecture 2 coding_principlesLecture 2 coding_principles
Lecture 2 coding_principles
 
Practical basics on c++
Practical basics on c++Practical basics on c++
Practical basics on c++
 
Mid term sem 2 1415 sol
Mid term sem 2 1415 solMid term sem 2 1415 sol
Mid term sem 2 1415 sol
 
Introduction to Computer and Programing - Lecture 04
Introduction to Computer and Programing - Lecture 04Introduction to Computer and Programing - Lecture 04
Introduction to Computer and Programing - Lecture 04
 
Compiler Construction for DLX Processor
Compiler Construction for DLX Processor Compiler Construction for DLX Processor
Compiler Construction for DLX Processor
 
keyword
keywordkeyword
keyword
 
keyword
keywordkeyword
keyword
 
Fundamental of C Programming Language and Basic Input/Output Function
  Fundamental of C Programming Language and Basic Input/Output Function  Fundamental of C Programming Language and Basic Input/Output Function
Fundamental of C Programming Language and Basic Input/Output Function
 
Lecture 2 coding_principles
Lecture 2 coding_principlesLecture 2 coding_principles
Lecture 2 coding_principles
 
C important questions
C important questionsC important questions
C important questions
 
21: Which method determines if a JRadioButton is selected?
21: Which method determines if a JRadioButton is selected?21: Which method determines if a JRadioButton is selected?
21: Which method determines if a JRadioButton is selected?
 
Comp 328 final guide (devry)
Comp 328 final guide (devry)Comp 328 final guide (devry)
Comp 328 final guide (devry)
 

More from moduledesign

Bm512 b525 t5_l_v002
Bm512 b525 t5_l_v002Bm512 b525 t5_l_v002
Bm512 b525 t5_l_v002
moduledesign
 
Corporate reporting and finance lecture 1
Corporate reporting and finance lecture 1Corporate reporting and finance lecture 1
Corporate reporting and finance lecture 1
moduledesign
 
B502 ethics lecture t005_rf
B502 ethics lecture t005_rfB502 ethics lecture t005_rf
B502 ethics lecture t005_rf
moduledesign
 
Pearson principles of business implementing strategy lecture 2
Pearson principles of business implementing strategy lecture 2Pearson principles of business implementing strategy lecture 2
Pearson principles of business implementing strategy lecture 2
moduledesign
 
Generic lecture 3 literature review tutor
Generic lecture 3 literature review  tutorGeneric lecture 3 literature review  tutor
Generic lecture 3 literature review tutor
moduledesign
 
Tutor version slides seminar 9 implementing knowledge management
Tutor version slides seminar 9 implementing knowledge managementTutor version slides seminar 9 implementing knowledge management
Tutor version slides seminar 9 implementing knowledge management
moduledesign
 
Tutor version slides eminar 2 the nature of knowing
Tutor version slides eminar 2 the nature of knowingTutor version slides eminar 2 the nature of knowing
Tutor version slides eminar 2 the nature of knowing
moduledesign
 
Tutor version slides seminar 10 assignment support
Tutor version slides seminar 10 assignment supportTutor version slides seminar 10 assignment support
Tutor version slides seminar 10 assignment support
moduledesign
 
Tutor version slides seminar 5 the learning organisation
Tutor version slides seminar 5 the learning organisationTutor version slides seminar 5 the learning organisation
Tutor version slides seminar 5 the learning organisation
moduledesign
 
Tutor version slides seminar 1 introduction to knowledge management
Tutor version slides seminar 1 introduction to knowledge managementTutor version slides seminar 1 introduction to knowledge management
Tutor version slides seminar 1 introduction to knowledge management
moduledesign
 
Tutor version slides seminar 4 organisational learning
Tutor version slides seminar 4 organisational learningTutor version slides seminar 4 organisational learning
Tutor version slides seminar 4 organisational learning
moduledesign
 
Tutor version slides seminar 7 digital knowledge managment
Tutor version slides seminar 7 digital knowledge managment Tutor version slides seminar 7 digital knowledge managment
Tutor version slides seminar 7 digital knowledge managment
moduledesign
 

More from moduledesign (20)

Bm512 b525 t1_s_v002
Bm512 b525 t1_s_v002Bm512 b525 t1_s_v002
Bm512 b525 t1_s_v002
 
Bm512 b525 t5_l_v002
Bm512 b525 t5_l_v002Bm512 b525 t5_l_v002
Bm512 b525 t5_l_v002
 
Bm509 b519 t1_l_v002
Bm509 b519 t1_l_v002Bm509 b519 t1_l_v002
Bm509 b519 t1_l_v002
 
Corporate reporting and finance lecture 1
Corporate reporting and finance lecture 1Corporate reporting and finance lecture 1
Corporate reporting and finance lecture 1
 
Af502 b523 t1_l1_v002
Af502 b523 t1_l1_v002Af502 b523 t1_l1_v002
Af502 b523 t1_l1_v002
 
B515 lecture 1 edited_mr
B515 lecture 1 edited_mrB515 lecture 1 edited_mr
B515 lecture 1 edited_mr
 
B502 ethics lecture t005_rf
B502 ethics lecture t005_rfB502 ethics lecture t005_rf
B502 ethics lecture t005_rf
 
B526 ops pm lecture_t001b_with notes
B526 ops pm lecture_t001b_with notesB526 ops pm lecture_t001b_with notes
B526 ops pm lecture_t001b_with notes
 
B526 ops pm lecture_t009_rf
B526 ops pm lecture_t009_rfB526 ops pm lecture_t009_rf
B526 ops pm lecture_t009_rf
 
Pearson principles of business implementing strategy lecture 2
Pearson principles of business implementing strategy lecture 2Pearson principles of business implementing strategy lecture 2
Pearson principles of business implementing strategy lecture 2
 
Generic lecture 4 research design (1)
Generic lecture 4 research design (1)Generic lecture 4 research design (1)
Generic lecture 4 research design (1)
 
Generic lecture 3 literature review tutor
Generic lecture 3 literature review  tutorGeneric lecture 3 literature review  tutor
Generic lecture 3 literature review tutor
 
Generic lecture 2 research proposal student
Generic lecture 2 research proposal studentGeneric lecture 2 research proposal student
Generic lecture 2 research proposal student
 
Tutor version slides seminar 9 implementing knowledge management
Tutor version slides seminar 9 implementing knowledge managementTutor version slides seminar 9 implementing knowledge management
Tutor version slides seminar 9 implementing knowledge management
 
Tutor version slides eminar 2 the nature of knowing
Tutor version slides eminar 2 the nature of knowingTutor version slides eminar 2 the nature of knowing
Tutor version slides eminar 2 the nature of knowing
 
Tutor version slides seminar 10 assignment support
Tutor version slides seminar 10 assignment supportTutor version slides seminar 10 assignment support
Tutor version slides seminar 10 assignment support
 
Tutor version slides seminar 5 the learning organisation
Tutor version slides seminar 5 the learning organisationTutor version slides seminar 5 the learning organisation
Tutor version slides seminar 5 the learning organisation
 
Tutor version slides seminar 1 introduction to knowledge management
Tutor version slides seminar 1 introduction to knowledge managementTutor version slides seminar 1 introduction to knowledge management
Tutor version slides seminar 1 introduction to knowledge management
 
Tutor version slides seminar 4 organisational learning
Tutor version slides seminar 4 organisational learningTutor version slides seminar 4 organisational learning
Tutor version slides seminar 4 organisational learning
 
Tutor version slides seminar 7 digital knowledge managment
Tutor version slides seminar 7 digital knowledge managment Tutor version slides seminar 7 digital knowledge managment
Tutor version slides seminar 7 digital knowledge managment
 

Recently uploaded

Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Recently uploaded (20)

Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 

Seminar 2 coding_principles

  • 1. Seminar: Coding Principles Topic Number: 2 App Design for Business
  • 2. Key topics and learning outcomes of this Seminar • Reinforce the Java code introduced during Lecture 2 by running Java code in IntelliJ; • Develop confidence working with Intellij and logic/layout files; • Develop Mobile Application Programming skills;
  • 3. Open IntelliJ, Create New Project 3
  • 6. Add a Project name B4004A L1 6
  • 7. Opens Class File: Main.java B4004A L1 7
  • 8. Run the program, and check the terminal returns ‘Hello World!’ B4004A L1 8 This is the ‘run’ button:
  • 9. Type some code into Main.java and run it: Type this code into the same file in IntelliJ and run it. Some code will need to be deleted to reflect correctly the code below (ie the Hello World code section). Check the Terminal output. public class Main { public static void main(String[] args) { int a = 2;int b = 4; int c; c=a+b; System.out.print(c); } } Change the variables a and b to different values and then run the code again and check the correct result shows in the Terminal. B4004A L1 9
  • 10. Create a for loop Create a for loop: public class Main { public static void main(String[] args) { for(int i=0;i<10;i++) { int a = 2; int b = 4; int c; c = a + b; System.out.print(c); } } } … then make it print out each number on a new line by adding “n” for a new line: System.out.print(c + "n"); … change i<10 to i<20 and run the program again to see what happens B4004A L1 10
  • 11. Change code to make it add 1 to each number. … then make the program add 1 to each number and print it out in the Terminal by adding: a = a+1; You will need to move the declaration (int a = 2; int b = 4; int c;) out of the for loop, otherwise the result will remain static as the program will always go back to those values. Try running it without moving the declaration first, check the output in the Terminal. Then move it. Put it the line above the for loop. Run it again and check the output in the Terminal. public class Main { public static void main(String[] args) { int a = 2; int b = 4; int c; for(int i=0;i<13;i++) { c = a + b; a = a + 1; System.out.print(c + "n"); } } } B4004A L1 11
  • 12. Using multiplication * Change the code a little to make it run the 75 times table. public class Main { public static void main(String[] args) { int a = 0; int b = 75; int c; for(int i=0;i<13;i++) { c = a * b; a = a + 1; System.out.print(c + "n"); } } } B4004A L1 12
  • 13. Concatenating Output Change the output line of code to this and then look at the output: System.out.print(a + " times " + b + " = " + c + "n"); Try and write some code to print a box using the character ‘X’ that prints out the same number of ‘Xs’ across and down. B4004A L1 13
  • 14. Working with the if statement; Try writing this code, changing the value of x to get it to run each statement, and then remove some lines of code so that there are less decisions. Pay attention to the brackets. Finally end up with just an if statement, without else. public class Test { public static void main(String args[]){ int x = 30; if( x == 10 ){ System.out.print("Value of X is 10"); }else if( x == 20 ){ System.out.print("Value of X is 20"); }else if( x == 30 ){ System.out.print("Value of X is 30"); }else{ System.out.print("This is else statement"); } } } B4004A L1 14
  • 15. Summary This seminar has reinforced the coding principles learned during the corresponding lecture; This seminar has provided users of IntelliJ with a good understanding of how to manage Java code within IntelliJ Development Environment;
  • 16. Next session Workshop 2 – Coding Principles This workshop covers Operators and Strings
  • 17. End of Seminar Note: This recording is for your personal use only and not for further distribution or wider review. © Pearson College 2013

Editor's Notes

  1. Tutor notes to go in here
  2. Provide guidance to students on the preparation for next week’s activity.