Pemrograman VisualMinggu …2… Page 1 MINGGU Ke Dua Pemrograman Visual Pokok Bahasan: Console Application Tujuan Instruksional Khusus: Mahasiswa dapat menjelaskan.

Slides:



Advertisements
Similar presentations
Pemrograman VisualMinggu …6… Page 1 MINGGU Ke Enam Pemrograman Visual Pokok Bahasan: Module, Class & Methods Tujuan Instruksional Khusus: Mahasiswa dapat.
Advertisements

Pemrograman VisualMinggu …5… Page 1 MINGGU Ke Lima Pemrograman Visual Pokok Bahasan: Control Statement II Tujuan Instruksional Khusus: Mahasiswa dapat.
Pemrograman VisualMinggu …3… Page 1 MINGGU Ke Tiga Pemrograman Visual Pokok Bahasan: Class, Objects, Methods and Instance Variable Tujuan Instruksional.
Pemrograman VisualMinggu …12… Page 1 MINGGU Ke Duabelas Pemrograman Visual Pokok Bahasan: File and Stream Tujuan Instruksional Khusus: Mahasiswa dapat.
Pemrograman VisualMinggu …4… Page 1 MINGGU Ke Empat Pemrograman Visual Pokok Bahasan: Control Statement I Tujuan Instruksional Khusus: Mahasiswa dapat.
Lecture 2 Introduction to C Programming
Introduction to C Programming
CS 6301 Lecture 2: First Program1. CS Topics of this lecture Introduce first program  Explore inputs and outputs of a program Arithmetic using.
 2005 Pearson Education, Inc. All rights reserved Introduction.
1 Chapter 2 Introduction to Java Applications Introduction Java application programming Display ____________________ Obtain information from the.
 2000 Prentice Hall, Inc. All rights reserved. Chapter 2 - Introduction to C Programming Outline 2.1Introduction 2.2A Simple C Program: Printing a Line.
Introduction to C Programming
1 Outline 13.1Introduction 13.2A Simple Program: Printing a Line of Text in a Web Page 13.3Another JavaScript Program: Adding Integers 13.4Memory Concepts.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
 2002 Prentice Hall. All rights reserved. 1 Outline 3.1Introduction 3.2Simple Program: Printing a Line of Text 3.3Another Simple Program: Adding Integers.
 2007 Pearson Education, Inc. All rights reserved Introduction to C Programming.
Chapter 2 - Introduction to Java Applications
Introduction to C Programming
COMPUTER SCIENCE I C++ INTRODUCTION
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 6 Enhancing the Inventory Application Introducing Variables, Memory Concepts and.
 2003 Prentice Hall, Inc. All rights reserved. 1 Introduction to C++ Programming Outline Introduction to C++ Programming A Simple Program: Printing a.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing.
Pemrograman VisualMinggu …12… Page 1 MINGGU Ke Duabelas Pemrograman Visual Pokok Bahasan: Exception Handling Tujuan Instruksional Khusus: Mahasiswa dapat.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 2 - Welcome Application: Introduction to C++
Chapter 3 – Introduction to Visual Basic Programming
Android How to Program, 2/e © Copyright by Pearson Education, Inc. All Rights Reserved.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
 2009 Pearson Education, Inc. All rights reserved Introduction to Visual Basic Programming.
1 Introduction to C# Programming Console applications No visual components Only text output Two types MS-DOS prompt - Used in Windows 95/98/ME Command.
 Simple C# program  Console applications input and output text in a console window, which in Windows XP and Windows Vista is known as the Command Prompt.
Ch 6: JavaScript Introduction to scripting part 2.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 2 Chapter 2 - Introduction to C Programming.
Introduction to Visual Basic Programming Introduction to Visual Basic Programming Ch3 – Deitel’s Book.
Introduction to C Programming Angela Chih-Wei Tang ( 唐 之 瑋 ) Department of Communication Engineering National Central University JhongLi, Taiwan 2010 Fall.
 2000 Prentice Hall, Inc. All rights reserved. 1 Chapter 2 - Introduction to Java Applications Outline 2.1Introduction 2.2A Simple Program: Printing a.
 Pearson Education, Inc. All rights reserved Introduction to Java Applications.
1 Introduction to C# Programming Console applications No visual components Only text output Two types MS-DOS prompt - Used in Windows 95/98/ME Command.
Introduction to Visual Basic Programming. Introduction Simple Program: Printing a Line of Text Another Simple Program: Adding Integers Memory Concepts.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Introduction to Visual Basic Programming Chapter 3 – Introduction to Visual Basic Programming.
 2000 Deitel & Associates, Inc. All rights reserved. Outline 8.1Introduction 8.2A Simple Program: Printing a Line of Text in a Web Page 8.3Another JavaScript.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 2A Reading, Processing and Displaying Data (Concepts)
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Part:2.  Keywords are words with special meaning in JavaScript  Keyword var ◦ Used to declare the names of variables ◦ A variable is a location in the.
 2003 Prentice Hall, Inc. All rights reserved. Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 3 – Introduction to C# Programming Outline 3.1 Introduction 3.2 Simple Program: Printing a Line.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 2 - Introduction to C Programming Outline.
1 CISC181 Introduction to Computer Science Dr. McCoy Lecture 2 September 3, 2009.
 2003 Prentice Hall, Inc. All rights reserved Basics of a Typical C++ Environment C++ systems –Program-development environment –Language –C++
REEM ALMOTIRI Information Technology Department Majmaah University.
 2007 Pearson Education, Inc. All rights reserved Introduction to Visual Basic Programming.
1 Lecture 2 - Introduction to C Programming Outline 2.1Introduction 2.2A Simple C Program: Printing a Line of Text 2.3Another Simple C Program: Adding.
Chapter 6 JavaScript: Introduction to Scripting
Chapter 2 Introduction to C++ Programming
2.5 Another Java Application: Adding Integers
Introduction to Scripting
Chapter 7 - JavaScript: Introduction to Scripting
Introduction to C++ Programming
Advanced Programming Lecture 02: Introduction to C# Apps
Chapter 3 – Introduction to C# Programming
Programs written in C and C++ can run on many different computers
Capitolo 1 – Introduction C++ Programming
Chapter 7 - JavaScript: Introduction to Scripting
Chapter 7 - JavaScript: Introduction to Scripting
Introduction to C Programming
Chapter 7 - JavaScript: Introduction to Scripting
Presentation transcript:

Pemrograman VisualMinggu …2… Page 1 MINGGU Ke Dua Pemrograman Visual Pokok Bahasan: Console Application Tujuan Instruksional Khusus: Mahasiswa dapat menjelaskan dan mengaplikasikan console apllication, tipe data, operator aritmatika, relational operator dan message dialogs Referensi: Deitel Deitel, Visual Basic 2008 (2009), How to Program, Prentice Hall. Chapter 3

Pemrograman VisualMinggu …2… Page 2 Agenda Displaying line of text Creating console application Adding Integer Memory concepts Arithmetic Equality and Relational operator Message Dialog to display message

Pemrograman VisualMinggu …2… Page 3 Displaying Line of Text

Pemrograman VisualMinggu …2… Page 4 Module Module1 Sub Main() Console.WriteLine("Wellcome to Visual Basic.NET") Console.ReadKey() End Sub End Module Perbedaan Write dengan WriteLine Fungsi ReadKey() Displaying Line of Text (Continued …)

Pemrograman VisualMinggu …2… Page 5 Creating a Console Application

Pemrograman VisualMinggu …2… Page 6 IDE with an open console application

Pemrograman VisualMinggu …2… Page 7 Renaming the program files in the properties windows

Pemrograman VisualMinggu …2… Page 8 Setting the Startup Object

Pemrograman VisualMinggu …2… Page 9 Writing Code and Using IntelliSense

Pemrograman VisualMinggu …2… Page 10 Parameter Info Window

Pemrograman VisualMinggu …2… Page 11 Running the program from the command prompt

Pemrograman VisualMinggu …2… Page 12 Syntax Error Indicated by the IDE

Pemrograman VisualMinggu …2… Page 13 Adding Integer

Pemrograman VisualMinggu …2… Page 14 Adding Integer (Continued …)

Pemrograman VisualMinggu …2… Page 15 The ReadLine method cause the program to pause and wait for user input, once the user presses the enter key, the input is returned to the program and execution resumes A Syntax error indicates a violation of visual basic’s rule for creating Adding Integer Summary

Pemrograman VisualMinggu …2… Page 16 Primitive Types

Pemrograman VisualMinggu …2… Page 17 Memory Concepts Variable names, such as number1, number2, total, correspond to locations in the computer’s memory Each variable has a name, type, size and value Whenever a value is placed in a memory location, it replaces the value previously stored in that location. The Previous value is destroyed When a value is read from a memory location, the process is nondestructive, meaning that the value in a memory is not changed

Pemrograman VisualMinggu …2… Page 18 Memory locations after an addition operation

Pemrograman VisualMinggu …2… Page 19 Arithmetic Operator

Pemrograman VisualMinggu …2… Page 20 Precedence of Arithmetic Operator

Pemrograman VisualMinggu …2… Page 21 Example Precedence of Arithmetic Operator

Pemrograman VisualMinggu …2… Page 22 Summary Arithmetic Binary operators operate on two operands; unary operator operate on one operand. The Mod operator yields the remainder after division. Arithmetic expressions in visual basic must be written in straight-line form to enter programs into a computer. Parentheses are used in visual basic expressions in the same manner as in algebraic expressions. Visual basic applies the operators in arithmetic expressions in a precise sequence, which is determine by the rule of the operator precedence If an expression contains multiple operator with the same precedence, the order in which the operators are applied is determined by their associability. In VB, all binary operators associate from left to right.

Pemrograman VisualMinggu …2… Page 23 Equality and Operational Operators

Pemrograman VisualMinggu …2… Page 24 Comparison with equality and relational operators

Pemrograman VisualMinggu …2… Page 25 Summary Equality and Operational Operators Visual Basic’s If… Then statement allows a program to make a decision based on the truth or falsity of a condition. If the condition is true, the statement in the body of the If… Then statement executes. If the condition is false, the body statement does not execute. Conditions in If… Then statements can be formed by using the equality operators and relational operators. Equality operators and relational operators are also called comparison operators. Relational and equality operators have the same level of precedence and associate from left to right

Pemrograman VisualMinggu …2… Page 26 Message dialog to display message

Pemrograman VisualMinggu …2… Page 27 Message dialog to display message (Continued …) Visual Basic provides class MessageBox for creating message dialogs Line 10 calls the Sqrt method of the Math class to compute the square root of 2. The value returned is a floating-point number, so we declare the variable root as type Double. Note the use of spacing in lines 13–14 of Fig To improve readability, long statements may be split over several lines using the line-continuation character, _. Line 13 uses the line-continuation character to indicate that line 14 is a continuation of the pre-ceding line. Lines 13–14 (Fig. 3.28) call method Show of class MessageBox. This method takes a comma-separated argument list. The first argument is the string that is displayed in the message dialog. The second argument is the string that is displayed in the message dialog’s title bar.

Pemrograman VisualMinggu …2… Page 28 Analyzing the MessageBox

Pemrograman VisualMinggu …2… Page 29 Summary Message dialog to display message Message dialogs are windows that display messages to the user. Visual Basic provides the class MessageBox for creating message dialogs. The.NET Framework Class Library organizes groups of related classes into namespaces. The System.Windows.Forms namespace contains windows-related classes (i.e., forms and dialogs) that help you define graphical user interfaces (GUIs) for their applications. GUI components facilitate data entry by the user and the formatting and presenting of data outputs to the user. An Imports statement indicates that a program uses the features provided by a specific namespace, such as System.Windows.Forms. To improve readability, long statements may be split over several lines with the line-continuation character ( _ ). Although a single statement can contain as many line-continuation characters as necessary, at least one whitespace character must precede each line-continuation character. Assemblies that contain compiled classes for reuse in applications are located in files with a.dll (dynamic link library) extension.

Pemrograman VisualMinggu …2… Page 30 Questions & Answers

Pemrograman VisualMinggu …2… Page 31 Thank You