Review Materials I (T) Subject : T0016 – ALGORITHM AND PROGRAMMING

Slides:



Advertisements
Similar presentations
CS107 Introduction to Computer Science Lecture 3, 4 An Introduction to Algorithms: Loops.
Advertisements

ECE 331 – Digital System Design
Subject: Information Technology Grade: 10
 Control structures  Algorithm & flowchart  If statements  While statements.
An Introduction to Programming with C++ Fifth Edition Chapter 5 The Selection Structure.
1 Arithmetic in C. 2 Type Casting: STOPPED You can change the data type of the variable in an expression by: (data_Type) Variable_Name Ex: int a = 15;
Algorithms. Introduction Before writing a program: –Have a thorough understanding of the problem –Carefully plan an approach for solving it While writing.
CSCI/CMPE 4341 Topic: Programming in Python Chapter 3: Control Structures (Part 1) – Exercises 1 Xiang Lian The University of Texas – Pan American Edinburg,
ECE 301 – Digital Electronics Course Introduction, Number Systems, Conversion between Bases, and Basic Binary Arithmetic (Lecture #1)
CIS162AD - C# Decision Statements 04_decisions.ppt.
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 4: Control Structures I (Selection)
1 CSC 1401 S1 Computer Programming I Hamid Harroud School of Science and Engineering, Akhawayn University
Number System. Number Systems Important Number systems – Decimal – Binary – Hexadecimal.
1 CSC103: Introduction to Computer and Programming Lecture No 7.
Control Structures (A) Topics to cover here: Introduction to Control Structures in the algorithmic language Sequencing.
 Wednesday, 9/18/02, Slide #1 CS106 Introduction to CS1 Wednesday, 9/18/02  QUESTIONS?? HW #1 due today at 5!!  Today: Loops, and two new data types.
1 09/20/04CS150 Introduction to Computer Science 1 Let ’ s all Repeat Together.
Lecture 4: Calculating by Iterating. The while Repetition Statement Repetition structure Programmer specifies an action to be repeated while some condition.
Chapter 3 - Structured Program Development Outline 3.1Introduction 3.2Algorithms 3.3Pseudocode 3.4Control Structures 3.5The If Selection Structure 3.6The.
The IF-statements 31-Jan-2005 Venkatesh Ramamoorthy.
C++ Programming Lecture 7 Control Structure I (Selection) – Part II The Hashemite University Computer Engineering Department.
Computer Programming TCP1224 Chapter 5 The Selection Structure.
CSC 1010 Programming for All Lecture 3 Useful Python Elements for Designing Programs Some material based on material from Marty Stepp, Instructor, University.
EGR 115 Introduction to Computing for Engineers Branching & Program Design – Part 3 Friday 03 Oct 2014 EGR 115 Introduction to Computing for Engineers.
Lecture 7: Menus and getting input. switch Multiple-selection Statement switch Useful when a variable or expression is tested for all the values it can.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
An Introduction to Programming with C++1 The Selection Structure Tutorial 6.
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.
Decision making If.. else statement.
Input and Output Upsorn Praphamontripong CS 1110
while Repetition Structure
Selection Control Structure
CS1001 Programming Fundamentals 3(3-0) Lecture 2
Pseudocode Upsorn Praphamontripong CS 1110 Introduction to Programming
Introduction to Programming
The Selection Structure
Chapter 5: Control Structure
Unit 2 Smarter Programming.
Week 4 – Chapter 3 Repetition.
JavaScript: Control Statements I
Lecture2.
An Introduction to Programming with C++ Fifth Edition
Looping.
Number Systems and Binary Arithmetic
Control Structure Senior Lecturer
Chapter 2 - Introduction to C Programming
SELECTION STATEMENTS (2)
Structured Program
Objectives After studying this chapter, you should be able to:
3 Control Statements:.
Algorithms, Part 2 of 3 Topics Problem Solving Examples Pseudocode
Decision making If statement.
Chapter 8: More on the Repetition Structure
Selection Control Structure
CS2011 Introduction to Programming I Loop Statements (II)
Visual Basic – Decision Statements
ECE 301 – Digital Electronics
Chapter 5: Control Structure
elementary programming
Exercise Solution First questions What's output What's input
Language Constructs Construct means to build or put together. Language constructs refers to those parts which make up a high level programming language.
Flowcharts and Pseudo Code
Programming Concepts and Database
Introduction to C Programming
Chapter 4: Boolean Expressions, Making Decisions, and Disk Input and Output Prof. Salim Arfaoui.
Programming Dr. Jalal Kawash.
The Selection Structure
Chapter 5: The Selection Structure
DATA TYPES AND OPERATIONS
C++ Programming Lecture 7 Control Structure I (Selection) – Part II
Presentation transcript:

Review Materials I (T) Subject : T0016 – ALGORITHM AND PROGRAMMING Year : 2013 Review Materials I (T)

T0016 - Algorithm and Programming Review Materials Algorithm & Programming Introduction to C Programming I Introduction to C Programming II Operator, Operand, and Arithmetic Program Control: Selection Program Control: Repetition Pointers and Arrays T0016 - Algorithm and Programming

T0016 - Algorithm and Programming Exercise Create Pseudocode and Flowchart for the following problem : A shopping market is in need of a program to support cashier. The program will first read the product code from screen, validate that product code should be 10 digits of characters. Other than that, quantity and price will be asked for each of products. Program will also need to validate if quantity and price is all numbers with minimum value of 1. All these process will be repeated for every products shopped by customer. Program will stop computing and display the amount that should be paid by customer when user input product code with 0000000000. T0016 - Algorithm and Programming

T0016 - Algorithm and Programming Exercise 2. Decide if the following statements are TRUE or FALSE a) Variable name can be started with numbers, ex : 1name b) Variable name can not consist of more than a word c) We can make variable with name of : system 3. Do the following syntax : scanf(“%s”, temp) and gets(temp) have the same function? What is the output if the input is : “Good Morning” ? T0016 - Algorithm and Programming

T0016 - Algorithm and Programming Exercise 4. If all variables are integer, then state the value of A if: B=13; C=11; D=42; E=0; A = B && E; A = B & C; A = C || D; A = B | D; A = B > 2; A = B >> 2; A = C < 3; A = C << 3; A = B = C; A = B == C; T0016 - Algorithm and Programming

T0016 - Algorithm and Programming Exercise 5. Given the following decimal : 15870, convert it to : a) Binary b) Octal c) Hexadecimal 6. What is the result of z = (x ==1) ? 5 : 7 if x is 0 ? 7. Are these two block of codes the same? If mark is 90, what is the output of grade from (a) and (b)? if(mark>=85) grade = 'A'; if(mark>=75) grade = 'B'; (a) if(mark>=85) grade = 'A' else if(mark>=75) grade = 'B‘ (b) T0016 - Algorithm and Programming

T0016 - Algorithm and Programming Exercise 8. What is Nested if? 9. What is the main difference between do-while statements and while statements in C? 10. Create the following program : N = 10 11. How do we validate length of a string is no more than 30 and not less than 5? T0016 - Algorithm and Programming

T0016 - Algorithm and Programming Exercise 12. Create a program to convert all first letters of every word to be uppercase, while the rest is remain unchanged Example : happy Birthday  Happy Birthday Good MorNinG  Good MorNinG good night  Good Night T0016 - Algorithm and Programming

T0016 - Algorithm and Programming Exercise 13. Create a program to check if a word is palindrome! example : exe, madam, mam, mom, dad 14. Create a program to do multiplication of these two matrices, using array 2D! T0016 - Algorithm and Programming

T0016 - Algorithm and Programming END T0016 - Algorithm and Programming