Review Materi Widodo.com. 1. Definisi dari Algoritma yang benar ialah : a. A procedure used to solve a mathematical or computational problem or to address.

Slides:



Advertisements
Similar presentations
AP Computer Science Anthony Keen. Computer 101 What happens when you turn a computer on? –BIOS tries to start a system loader –A system loader tries to.
Advertisements

Taking Input Java Md. Eftakhairul Islam
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 3: Flow Control I: For Loops.
Programming Methodology (1). public class Hello { public static void main(String[] args) { System.out.println("Hello world"); } } Hello world.
Chapter 8: Arrays.
Pemrograman Dasar Control Flow Statements: Decision Making or Selection PTIIK - UB 1.
STRING AN EXAMPLE OF REFERENCE DATA TYPE. 2 Primitive Data Types  The eight Java primitive data types are:  byte  short  int  long  float  double.
Data Types Session 2.  Primitive data types  int, float, double, char  Aggregate data types  Arrays come.
1. Penulisan array yang benar adalah : double[] myList; myList = new double[10];  Array with myList has variable dimension 10  Index begin from 0 till.
Today’s lecture Review of Chapter 1 Go over homework exercises for chapter 1.
Pemrograman VisualMinggu …6… Page 1 MINGGU Ke Enam Pemrograman Visual Pokok Bahasan: Module, Class & Methods Tujuan Instruksional Khusus: Mahasiswa dapat.
L2:CSC © Dr. Basheer M. Nasef Lecture #2 By Dr. Basheer M. Nasef.
Chapter 2 Elementary Programming
Enkripsi dan Dekripsi Data
Control Structures in C Risanuri Hidayat, Ir., M.Sc.
Variabel, Tipe Data & Operator Teguh Sutanto, M.Kom.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 2 1 Chapter 2 Primitive.
Primitive Data Types and Operations. Introducing Programming with an Example public class ComputeArea { /** Main method */ public static void main(String[]
1 Chapter 3 Arithmetic Expressions. 2 Chapter 3 Topics l Overview of Java Data Types l Numeric Data Types l Declarations for Numeric Expressions l Simple.
Chapter 2: Java Fundamentals Input and Output statements.
1 Pertemuan 09 Binary Tree Matakuliah: T0534/Struktur Data Tahun: 2005 Versi: September 2005.
Java Overview CS2336: Computer Science II1. First Program public class HelloWorld { public static void main(String args[]) { System.out.println("Hello.
Data Structures 1- Course Syllabus. 2- Introduction about Data Structures.
Principles of Computer Programming (using Java) Review Haidong Xue Summer 2011, at GSU.
Intro to Java Programming  A computer follows the instruction precisely and exactly.  Anything has to be declared and defined before it can be used.
Introduction to Java Appendix A. Appendix A: Introduction to Java2 Chapter Objectives To understand the essentials of object-oriented programming in Java.
Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved. 1 Chapter 2 Elementary Programming.
1 Chapter 2 Primitive Data Types and Operations F Introduce Programming with an Example  The MyInput class F Identifiers, Variables, and Constants F Primitive.
Java Fundamentals 3 Input and Output statements. Standard Output Window Using System.out, we can output multiple lines of text to the standard output.
JAVA 0. HAFTA Algorithms FOURTH EDITION Robert Sedgewick and Kevin Wayne Princeton University.
Chapter 2 Elementary Programming
Using Java Class Library
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
FUNDAMENTALS 2 CHAPTER 2. OPERATORS  Operators are special symbols used for:  mathematical functions  assignment statements  logical comparisons 
Spring 2009 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 8.
Chapter 1 Java Programming Review. Introduction Java is platform-independent, meaning that you can write a program once and run it anywhere. Java programs.
C++ Course SarMag Trimester 31 Programming in C++ Prerequisite: CS1 or some programming experience Text: C++ How to Program, Deitel & Deitel.
Desain & Analisis Algoritma
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Elementary Programming.
1 1 Chapter 2 Elementary Programming. 2 2 Motivations In the preceding chapter, you learned how to create, compile, and run a Java program. Starting from.
1 Lecture # 2. * Introducing Programming with an Example * Identifiers, Variables, and Constants * Primitive Data Types * Byte, short, int, long, float,
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
Fundamentals 2 1. Programs and Data Most programs require the temporary storage of data. The data to be processed is stored in a temporary storage in.
CS 201 Lecture 2: Elementary Programming Tarik Booker CS 201 California State University, Los Angeles.
Topics introduced today (these topics would be covered in more detail in later classes) – Primitive Data types Variables Methods “for” loop “if-else” statement.
Part 2 Variabel & Data types
OPERATOR Dalam Java.
Variabel Dan Tipe data
Method Pemrograman Dasar.
OPERASI HITUNG BILANGAN
SISTEM DIGITAL MUHAMAD ARPAN, S.Kom.
Elementary Programming
Internet and Java Foundations, Programming and Practice
English Lessons UNIVERSITAS MUHAMMADIYAH TANGERANG
Chapter 3 Java Input/Output.
Variabel Dan Tipe data
Dasar-Dasar Pemrograman
Bab 4: Operator & Ungkapan
Chapter 2 Elementary Programming
Starting JavaProgramming
Principles of Computer Programming (using Java) Chapter 2, Part 1
null, true, and false are also reserved.
الكلية الجامعية للعلوم التطبيقية
A+ Computer Science INPUT.
Review for Exam 1 Spring 2007 CS 101/CS 101-E.
Fundamentals 2.
Chapter 3 Input/Output.
Chapter 2: Java Fundamentals
A+ Computer Science INPUT.
CS2011 Introduction to Programming I Elementary Programming
Presentation transcript:

Review Materi Widodo.com

1. Definisi dari Algoritma yang benar ialah : a. A procedure used to solve a mathematical or computational problem or to address a concurency issue. In the latter sense, an algorithm is a set of step-by-step commands or instructions designed to reach a general goals. b. A procedure used to solve a mathematical or computational problem or to address a data processing issue. In the latter sense, an algorithm is a set of step-by- step commands or instructions designed to reach a particular goal.

2. Yang bukan termasuk karakteristik Algoritma adalah:  Input  Output  result  Finiteness  Effectiveness

3. Definisi pseudocode yang tepat ialah : a. Pseudocode adalah detail deskripsi dari apa yang program komputer atau algoritma harus lakukan yang diwujudkkan dengan bahasa berstyle alami (bukan dari suatu bahasa pemrograman). b. Pseudocode adalah detail deskripsi dari apa yang program komputer atau algoritma harus lakukan yang diwujudkkan dengan bahasa berstyle suatu bahasa pemrograman tertentu dengan alur yang jelas.

4. Yang bukan termasuk karateristik bahasa Java : a. Object-oriented b. Distributed c. Interpreted d. Robust e. Multi OS

5. Java runtime environment (JRE) adalah software yang : a. Mengkompilasi program java di Windows b. Mengeksekusi program java c. Mengompilasi program java di DOS

6. Yang tidak termasuk modifier pada Java adalah : a. Public b. Static c. Private d. Final e. System.out.

7. Yang tidak termasuk data type di java adalah : a. Based on Complexity :  Atomic DT (boolean, byte, char, short, int, long, float, double)  Composite DT (Array, Struct, List, Queue, Stack, String, Tree) b. Based on Source:  Native / primitive / basic DT  Abstract DT c. Based on function:  String datatype

8. Perhatikan kode berikut double d = 4.5; int i = (int) d; Konversi diatas berupa : a. Mengubah d menjadi integer b. Mengubah i menjadi double c. Mengubah d dibuatlkan ke atas

ClassKonversi ke tipe dataPemakaian BooleanbooleanBoolean.parseBoolean(…); BytebyteByte.parseByte(…); CharactercharString.charAt( ); ShortshortShort.parseShort(…); IntegerintInteger.parseInt(…); LonglongLong.parseLong(…); FloatfloatFloat.parseFloat(…); DoubledoubleDouble.parseDouble(…);

9. Apa hasil dari program berikut :

Method terima input MethodUse next();Input String (word) nextLine();Input String (sentence) nextByte();Input number (byte) nextShort();Input number (short) nextInt();Input number (int) nextLong();Input number (long) nextFloat();Input number (float) nextDouble();Input number (double)

Penting  Final is a keyword in Java to declare constant.  Declaration :  final datatype CONSTANTNAME = VALUE;  Example: final double PHI = ;

10. Apa hasil dari program ini

Penting OperatorNameDescription ++varpreincrementvar is incremented by 1 first before its value is used. var++postincrementvar is incremented by 1 after its value has been used. --varpredecrementvar is decremented by 1 first before its value is used. var--postdecrement var is incremented by 1 after its value has been used.

Penting  Starts i=8; and j=3;  i+=(++j); Equal to: j=j+1;  j=4 i=i+j;  i=12  i+=(j++); Equal to: i=i+j;  i=16 j=j+1;  j=5

Penting  String comparison

Essai 1. Buat : a. Flowchart dan pseudocode b. program java menggunakan switch-case untuk terima input 2 bilangan, dengan terlebih dahulu menerima pilihan input : a= operasi pertambahan b=operasi pengurangan

2. Buat program untuk membangkitkan bilangan random antara menggunakan while: int number=(int)(Math.random() *101) Dengan looping menggunakan while Program Tebak bilangan atara 0 dan 100 Masukkan tebakkan :50 Tebakannya ketinggian Masukkan tebakkan : 6 Tebakan kerendahan Masukkan tebakan : 9 Ya, tebakannya adalah 9