SlideShare a Scribd company logo
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

escape sequences and substitution markers
escape sequences and substitution markersescape sequences and substitution markers
escape sequences and substitution markers
Micheal Ogundero
 
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
niyamathShariff
 
Input Output Management In C Programming
Input Output Management In C ProgrammingInput Output Management In C Programming
Input Output Management In C Programming
Kamal Acharya
 
Relational Operators in C
Relational Operators in CRelational Operators in C
Relational Operators in C
Lakshmi Sarvani Videla
 
csharp repitition structures
csharp repitition structurescsharp repitition structures
csharp repitition structures
Micheal Ogundero
 
CP Handout#6
CP Handout#6CP Handout#6
CP Handout#6
trupti1976
 
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_02Pooja Gupta
 
Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10alish sha
 
CP Handout#7
CP Handout#7CP Handout#7
CP Handout#7
trupti1976
 
Lab 2
Lab 2Lab 2
Input output statement in C
Input output statement in CInput output statement in C
Input output statement in C
Muthuganesh S
 
CP Handout#8
CP Handout#8CP Handout#8
CP Handout#8
trupti1976
 
selection structures
selection structuresselection structures
selection structures
Micheal Ogundero
 
CP Handout#2
CP Handout#2CP Handout#2
CP Handout#2
trupti1976
 
7. input and output functions
7. input and output functions7. input and output functions
7. input and output functions
Way2itech
 
Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7alish sha
 
Qust & ans inc
Qust & ans incQust & ans inc
Qust & ans incnayakq
 
A simple program C# program
A simple program C# programA simple program C# program
A simple program C# program
Micheal Ogundero
 
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] Mecko_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

C#.net
C#.netC#.net
C#.net
vnboghani
 
Python programming workshop session 2
Python programming workshop session 2Python programming workshop session 2
Python programming workshop session 2
Abdul Haseeb
 
C decision making and looping.
C decision making and looping.C decision making and looping.
C decision making and looping.
Haard Shah
 
Datastructure notes
Datastructure notesDatastructure notes
Datastructure notesSrikanth
 
UNIT-II CP DOC.docx
UNIT-II CP DOC.docxUNIT-II CP DOC.docx
UNIT-II CP DOC.docx
JavvajiVenkat
 
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
 
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
imtiazalijoono
 
Lecture 2 coding_principles
Lecture 2 coding_principlesLecture 2 coding_principles
Lecture 2 coding_principles
moduledesign
 
Practical basics on c++
Practical basics on c++Practical basics on c++
Practical basics on c++
Marco Izzotti
 
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 04hassaanciit
 
Compiler Construction for DLX Processor
Compiler Construction for DLX Processor Compiler Construction for DLX Processor
Compiler Construction for DLX Processor
Soham Kulkarni
 
keyword
keywordkeyword
keyword
teach4uin
 
keyword
keywordkeyword
keyword
teach4uin
 
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
imtiazalijoono
 
Lecture 2 coding_principles
Lecture 2 coding_principlesLecture 2 coding_principles
Lecture 2 coding_principles
moduledesign
 
C important questions
C important questionsC important questions
C important questions
JYOTI RANJAN PAL
 
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 t1_s_v002
Bm512 b525 t1_s_v002Bm512 b525 t1_s_v002
Bm512 b525 t1_s_v002
moduledesign
 
Bm512 b525 t5_l_v002
Bm512 b525 t5_l_v002Bm512 b525 t5_l_v002
Bm512 b525 t5_l_v002moduledesign
 
Bm509 b519 t1_l_v002
Bm509 b519 t1_l_v002Bm509 b519 t1_l_v002
Bm509 b519 t1_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
 
Af502 b523 t1_l1_v002
Af502 b523 t1_l1_v002Af502 b523 t1_l1_v002
Af502 b523 t1_l1_v002
moduledesign
 
B515 lecture 1 edited_mr
B515 lecture 1 edited_mrB515 lecture 1 edited_mr
B515 lecture 1 edited_mr
moduledesign
 
B502 ethics lecture t005_rf
B502 ethics lecture t005_rfB502 ethics lecture t005_rf
B502 ethics lecture t005_rfmoduledesign
 
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
moduledesign
 
B526 ops pm lecture_t009_rf
B526 ops pm lecture_t009_rfB526 ops pm lecture_t009_rf
B526 ops pm lecture_t009_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 4 research design (1)
Generic lecture 4 research design (1)Generic lecture 4 research design (1)
Generic lecture 4 research design (1)
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
 
Generic lecture 2 research proposal student
Generic lecture 2 research proposal studentGeneric lecture 2 research proposal student
Generic lecture 2 research proposal student
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

Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
bennyroshan06
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 

Recently uploaded (20)

Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 

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.