Algoritma SELEKSI TUNGGAL Pertemuan 2 28 Febuari 2011.

Slides:



Advertisements
Similar presentations
Lecture Computer Science I - Martin Hardwick Streams In C++ rA stream is a sequence that you either read from or write to. l example – cin is a stream.
Advertisements

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 8: Arrays Starting Out with C++ Early Objects Seventh Edition by.
Suggested Solutions of Sharif Internet Contest 2010 Shayan Ehsani Saeed Seddighin.
Operator overloading redefine the operations of operators
This Time Whitespace and Input/Output revisited The Programming cycle Boolean Operators The “if” control structure LAB –Write a program that takes an integer.
The "if structure" is used to execute statement(s) only if the given condition is satisfied.
HTML Pertemuan ke 3. Mengatur Daftar Item Tag hampir sama fungsinya dengan preformat
CS31 You Lu CS31-1K TA. Hello World! Variable Out of the Range You input , but it outputs another different number.
 2003 Prentice Hall, Inc. All rights reserved. 1 Functions and Recursion Outline some useful problems.
Functions Prototypes, parameter passing, return values, activation frams.
Class Scope class Student { private: string id; string firstName, lastName; float gpa; public: void Read() { cin >> id >> firstName >> lastName >> gpa;
Review of Inheritance. 2 Several Levels of Inheritance Base Class B Derived class D Derived class D1.
Student Data Score First Name Last Name ID GPA DOB Phone... How to store student data in our programs? 1.
1 C++ string Class Chapter 6. 2 Agenda String Basics (cin, getline )  string operations mixed I/O using >> & getline() Table Output using setw() Functions.
C++ Basics March 10th. A C++ program //if necessary include headers //#include void main() { //variable declaration //read values input from user //computation.
AU/MITM/1.6 By Mohammed A. Saleh 1. Introducing the string Class  Instead of using a character array to hold a string, you can use a type string variable.
1 Class Vehicle #include #define N 10../.. 2 Class Vehicle class vehicle { public: float speed; char colour[N+1]; char make[N+1];
Enumeration Data Type enum Day {SUN, MON, TUE, WED, THU, FRI, SAT}; Day today; today = WED; if (today == FRI) cout
Union, bitfield, typedef, enum union nama_u{ }; union nama_u{ struct nama_s byte; }; enum{ }; Tipedef var BYTE.
Analyzing Arguments. Objectives Determine the validity of an argument using a truth table. State the conditions under which an argument is invalid.
A loop is a repetition control structure. it causes a single statement or block to be executed repeatedly What is a loop?
1 10/20/08CS150 Introduction to Computer Science 1 do/while and Nested Loops Section 5.5 & 5.11.
1 10/11/06CS150 Introduction to Computer Science 1 do/while and Nested Loops.
CS 140 Lecture 14 Professor CK Cheng 11/14/02. Part II. Standard Modules A.Interconnect B.Operators. Adders Multiplier Adders1. Representation of numbers.
30 September 2004Comp 120 Fall September 2004 Chapter 4 – Logic Gates Read in Chapter 4 pages , , section 4.8 through top of page.
CS 1400 Chapter 5, section 2. Loops! while (rel-expression)while (rel-expression) {statements statement } if the relational-expression is true, execute.
CS 117 Spring 2002 What's Next. Files How to get data from a file instead of the keyboard How to save data to a file You know most of this from using.
C++ Introduction : C++ compilation. Visual Studio 2008 : Creating Command-Line Program.
ORKUT OR GMAIL PASSWORD HACKING. EVEN A CHILD CAN HACK THE ORKUT OR GMAIL ID ORKUT OR GMAIL ID.
Carry look ahead adder P (I) = a(I) xor b(I); G(I) = a(I) and b(I); S(I) = p(I) xor c(I); Carry(I+1) = c(I)p(I) + g(I)
Review the following : Flowcharting Variable declarations Output Input Arithmetic Calculations Conditional Statements Loops.
Number Systems and Circuits for Addition Lecture 5 Section 1.5 Thu, Jan 26, 2006.
Objective: Students will be able to: Declare and use variables Input integers.
Discrete Mathematics Lecture 7. 2 Analysis of Algorithms Analyzing an algorithm Time complexity Space complexity Time complexity Running time needed by.
Lecture 4 Function example. Example1 int max (int a, int b) { int c; if (a > b) c = a; else c = b; return (c); } void main ( ) {int x, y; cin>>x>>y; cout.
Computer Science 101 More Devices: Arithmetic. From 1-Bit Equality to N-Bit Equality = A B A = B Two bit strings.
Number Systems and Circuits for Addition – Binary Adders Lecture 6 Section 1.5 Fri, Jan 26, 2007.
The Basics of Arrays Problem: How can the rancher easily catalog all of his cattle?
Infinite for Loop If you omit the test condition, the value is assumed to be TRUE so the loop will continue indefinitely unless you provide some other.
ECE 3110: Introduction to Digital Systems
C++ Iterative Constructs
Tutorial-03 Lecturer: dr. Ir. Adi surjosatyo, m.eng.
Dynamic Array Multidimensional Array Matric Operation with Array
Summary Half-Adder Basic rules of binary addition are performed by a half adder, which has two binary inputs (A and B) and two binary outputs (Carry out.
C++ Arrays.
Heterogeneous aggregate datatypes
Null-Terminated Character Arrays
Conditional Construct
Counting Loops.
Starting Out with C++: From Control Structures through Objects
ECE 301 – Digital Electronics
The Run-Time Stack and Reference Parameters
Text Files All the programs you've seen so far have one thing in common: Any data the program uses or calculates is lost when the program ends. In order.
Input Validation CSCE 121 J. Michael Moore
الوحدة الرابعة البرمجة وصياغة حل المسائل البرمجة وأهميتها أهداف الدرس الأول مفهوم البرمجة. الفرق بين المبرمج ومستخدم البرنامج. الحاجة إلى البرامج.
Decision Structures Case Structures.
CS150 Introduction to Computer Science 1
Introduction to Programming
FIGURE 1: SERIAL ADDER BLOCK DIAGRAM
CS150 Introduction to Computer Science 1
Alternate Version of STARTING OUT WITH C++ 4th Edition
Object Oriented Programming
Arrays of Two-Dimensions
Arithmetic Logic Unit (ALU)
Programming Strings.
Input Validation CSCE 121 Based on slides created by Carlos Soto.
CS150 Introduction to Computer Science 1
Four Bit Adder Sum A Cin B Cout 10/9/2007 DSD,USIT,GGSIPU.
微處理機 Microprocessor (100上) ARM 內核嵌入式SOC原理
Module 3 Selection Structures 12/7/2019 CSE 1321 Module 3.
Presentation transcript:

Algoritma SELEKSI TUNGGAL Pertemuan 2 28 Febuari 2011

1. cin>>Nama; cin>>NPM; cin>>Lulus; 2. If (Lulus==‘Y’) { 3. cout<<“LULUS” } Mulai Nama, NPM, Lulus Lulus=‘Y’ Y T “LULUS” Selesai 1 2 3

Void main () { String Nama,NPM; Char Lulus; 1.cout >Nama; cout >NPM; cout >Lulus; 2. If (Lulus==‘Y’) { 3. cout<<“SELAMAT ANDA LULUS….!”; } System (“pause”); }

1. cin>>Nama; cin>>NPM; cin>>Lulus; 2. If (Lulus==‘Y’) { 3. cout<<“LULUS”; } Else 5. Cout<<“Tidak Lulus”; Mulai Nama, NPM, Lulus Lulus=‘Y’ Y T “LULUS” Selesai “Tidak Lulus” 4 5