Triana Elizabeth, S.Kom. #include using namespace std; void main () { for (int i = 1; i <= 9; i++) { for (int j =1; j <=6; j++) { if (i 10-j) { cout<<"

Slides:



Advertisements
Similar presentations
Complete Structure class Date {class Date { private :private : // private data and functions// private data and functions public :public : // public data.
Advertisements

MACHINE PROJECT CS10L/B13 Submitted by: Bugayong, Capellamaeye S. Gresola, Camille C. Moreno, Jeannie Lou H. Queado,Princess Rachell Norielynn P.
Lecture Computer Science I - Martin Hardwick Strings #include using namespace std; int main () { string word; cout
Continuation of chapter 6…. Nested while loop A while loop used within another while loop is called nested while loop. Q. An illustration to generate.
Lecture 14 Today: Overloading: Revision on this Revision on increment operators the assignment operator the [] operator Book: p , 215,
Knuth-Morris-Pratt algoritmus (KMP) Farkas Attila FAANABI.ELTE.
For(int i = 1; i
Computer Science 1620 Math Library. Remember this program? suppose that I invest $25000 into a mutual fund that returns 8% per year. Write a program to.
PHYS707: Special Topics C++ Lectures Lecture 3. Summary of Today’s lecture: 1.Functions (call-by-referencing) 2.Arrays 3.Pointers 4.More Arrays! 5.More.
Pass by Value. COMP104 Pass by Value / Slide 2 Passing Parameters by Value * A function returns a single result (assuming the function is not a void function)
Chapter 12 Separate Compilation and Namespaces. Abstract Data Type (ADT) ADT: A data type consisting of data and their behavior. The abstraction is that.
Factorial Preparatory Exercise #include using namespace std; double fact(double); int fact(int); int main(void) { const int n=20; ofstream my_file("results.txt");
Chapter 16 Exception Handling. What is Exception Handling? A method of handling errors that informs the user of the problem and prevents the program from.
Vectors, lists and queues
Chapter 6 Advanced Function Features Pass by Value Pass by Reference Const parameters Overloaded functions.
void count_down (int count) { for(i=count; i>1; i--) printf(" %d\t", count); } printf("A%d\n", count); if(count>1) count_down(count-1); printf("B%d\n",
Problem You require an algorithm that will receive the length of the hypotenuse and one of the sides of a right triangle, and calculate the length of the.
ELEC 206 Computer Applications for Electrical Engineers Dr. Ron Hayne
Derived data types Dealing with data –Where the information is stored –What value is kept there –What kind of information is stored Address operator Pointers.
Exercise 2.
Data Structures (Second Part) Lecture 2 : Pointers Bong-Soo Sohn Assistant Professor School of Computer Science and Engineering Chung-Ang University.
Revision.
Copyright © 2008 Pearson Addison-Wesley. All rights reserved. Chapter 5 Functions for All Subtasks.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 102 Computer Programming II (Lab:
File and I/O system calls int open(const char* path, int flags, mode_t modes) int creat(const char *path, mode_t mode) ssize_t read(int fd, void *buf,
第三次小考. #include using namespace std; int aaa(int *ib,int a1,int a2) { int u,v; int m=(a1+a2)/2; if(a1==a2)return ib[a1]; u=aaa(ib,a1,m); cout
Chapter 8 Scope, Lifetime and More on Functions. Definitions Scope –The region of program code where it is legal to reference (use) an identifier Three.
Derived Classes. C++ 2 Outline  Definition  Virtual functions  Virtual base classes  Abstract classes. Pure virtual functions.
Lecture Notes 3 Loops (Repetition)
Tinaliah, S. Kom.. * * * * * * * * * * * * * * * * * #include using namespace std; void main () { for (int i = 1; i
// Functions that take no arguments #include using namespace std; void function1(); void function2( void ); int main() { function1(); function2(); return.
1 Lab Session-9 CSIT221 Fall 2002 Lab Exercise Based on operator overloading (Demo Required)
1 Lab Session-4 CSIT121 Fall 2004 Scope of Variables Top Down Design Problem The Solution Lab Exercise for Demo.
1 Lab Session-9 CSIT-121 Fall 2003 w Random Number Generation w Designing a Game.
Pointers Example Use int main() { int *x; int y; int z; y = 10; x = &y; y = 11; *x = 12; z = 15; x = &z; *x = 5; z = 8; printf(“%d %d %d\n”, *x, y, z);
1 Session-9 CSIT 121 Spring 2006 Lab Demo (first 20 minutes) The correct way to do the previous lab sheet Function calls Calling void functions Calling.
CS1201: Programming Language 2 Recursion By: Nouf Almunyif.
Functions Pass by Reference Alina Solovyova-Vincent Department of Computer Science & Engineering University of Nevada, Reno Fall 2005.
Multiple Files. Monolithic vs Modular  one file before  system includes  main driver function  prototypes  function.
Tracing through E01, question 9 – step 1 // p02.cc P. Conrad, for CISC181 07S // Exam question for E01 #include using namespace std; void mysteryFunction(int.
Objective: Students will be able to: Declare and use variables Input integers.
The This Pointer Programming in C++ Fall 2008 Dr. David A. Gaitros
Print Row Function void PrintRow(float x[ ][4],int i) { int j; for(j=0;j
Classes Sujana Jyothi C++ Workshop Day 2. A class in C++ is an encapsulation of data members and functions that manipulate the data. A class is a mechanism.
Int fact (int n) { If (n == 0) return 1; else return n * fact (n – 1); } 5 void main () { Int Sum; : Sum = fact (5); : } Factorial Program Using Recursion.
Copyright © Curt Hill STL Priority Queue A Heap-Like Adaptor Class.
1 Compiler directive: #define, usage 1 #include using namespace std; #define TAX //double TAX=0.08; #define LAST_NAME "Li" #define FIRST_NAME "Dennis"
1 Generating Random Numbers Textbook ch.6, pg
Looping I (while statement). CSCE 1062 Outline  Looping/repetition construct  while statement (section 5.1)
#define #include<iostream> using namespace std; #define GO
using System; namespace Demo01 { class Program
Pointers Psst… over there.
לולאות קרן כליף.
Random Number Generation
Funkcijų naudojimas.
Programming -2 برمجة -2 المحاضرة-7 Lecture-7.
הרצאה 03 אבני היסוד של תוכנית ב- C
Starting Out with C++: From Control Structures through Objects
Pointers & Functions.
مقدمه ای بر مهارت های زندگی
Anatomy of a Function Part 1
Code::Block vs Visual C++
class PrintOnetoTen { public static void main(String args[]) {
CS1201: Programming Language 2
Arrays of Two-Dimensions
foo.h #ifndef _FOO #define _FOO template <class T> class foo{
Inline Functions.
Pointers & Functions.
Anatomy of a Function Part 1
Introduction to Algorithms and Programming COMP151
Presentation transcript:

Triana Elizabeth, S.Kom

#include using namespace std; void main () { for (int i = 1; i <= 9; i++) { for (int j =1; j <=6; j++) { if (i 10-j) { cout<<" "; } else { cout<<"*"; } cout<<endl; } _getch(); } * * * * * * * * * * * * * * * * *

* * * * * * * * * * * * * * * * Algoritma Bentuk_Bintang { Menampilkan Bentuk Bintang } DEKLARASI i, j : integer DESKRIPSI : for i  1 to 9 do for j  1 to 6 do if (i 10-j) then write (‘ ’) else write (‘*‘) endif endfor write (enter) endfor

* * * * * * * #include using namespace std; void main () { for (int i = 1; i <= 7; i++) { for (int j =1; j <=7; j++) { if (j==i || j== 8-i) { cout<<"*"; } else { cout<<" "; } cout<<endl; } _getch(); }

* * * * * * * Algoritma Bintang_Silang { Menampilkan Bintang Berbentuk Silang } DEKLARASI i, j : integer DESKRIPSI : for i  1 to 7 do for j  1 to 7 do if (j = i or j = 8-i) then write (‘*’) else write (‘ ‘) endif endfor write (enter) endfor