Continue with conditional

Slides:



Advertisements
Similar presentations
Program Development Cycle Prof. Carlos Rodríguez Sánchez.
Advertisements

Weeks – 01/ 2 Introduction to flowcharts components and psuedocode.
PROBLEM SOLVING TECHNIQUES
Al-Karma Language School Computer Department Prep. 3.
Subject: Information Technology Grade: 10
Fundamentals of Algorithms MCS - 2 Lecture # 4
Algorithms. Software Development Method 1.Specify the problem requirements 2.Analyze the problem 3.Design the algorithm to solve the problem 4.Implement.
Algorithms. Software Development Method 1.Specify the problem requirements 2.Analyze the problem 3.Design the algorithm to solve the problem 4.Implement.
7. C program structure.
Programming Fundamentals (750113) Ch1. Problem Solving
Chapter 1 Pseudocode & Flowcharts
PYTHON PROGRAMMING Week 10 – Wednesday. TERMS – CHAPTER 1 Write down definitions for these terms:  Computation  Computability  Computing  Artificial.
Looping While-continue.
Python File Handling. In all the programs you have made so far when program is closed all the data is lost, but what if you want to keep the data to use.
Mastering Char to ASCII AND DOING MORE RELATED STRING MANIPULATION Why VB.Net ?  The Language resembles Pseudocode - good for teaching and learning fundamentals.
End Show Writing a computer program involves performing the following tasks. 1. Understanding the problem 2. Developing an Algorithm for the problem 3.
Writing Program Code in BASIC Write a program to prompt for and accept values into TWO variables, numx and numy. The program should square the value stored.
EXERCISE IN CLASS CHAPTER 2. PART 1 SEQUENCE SCENARIO 1 Write an algorithm for a C program, that prompts user to enter total number of umbrellas he/she.
Problem : At Kiddy School, the teachers used the A, B,C for grading the students’ works. If the student get an A, then the teacher will print “Excellent”
Control Structures II Repetition (Loops). Why Is Repetition Needed? How can you solve the following problem: What is the sum of all the numbers from 1.
CSEB 134 Assignment 1 Problem Solving. Instructions  This is a group assignment on Problem Solving  Each group consist 2 or 3 students.  Each group.
Writing JavaScript Functions. Goals By the end of this unit, you should understand … How to breakdown applications into individual, re-usable modules.
Program Planning and Design. What is Program Planning and Design? Program planning and design is simply knowing what you want to do and how you want to.
Continue with conditional
CS 100 Introduction to Computing Seminar
1 Program Planning and Design Important stages before actual program is written.
Fundamentals of Algorithms MCS - 2 Lecture # 5. Representation of Algorithms (continued) Flowcharts.
Sensitivity Analysis A systematic way of asking “what-if” scenario questions in order to understand what outcomes could possibly occur that would effect.
Algorithm Discovery and Design Objectives: Interpret pseudocode Write pseudocode, using the three types of operations: * sequential (steps in order written)
Python Lesson 1 1. Starter Create the following Excel spreadsheet and complete the calculations using formulae: 2 Add A1 and B1 A2 minus B2 A3 times B3.
Concepts of Algorithms CSC-244 Unit Zero Pseudo code, Flowchart and Algorithm Master Prince Computer College Qassim University K.S.A.
If statement.  It is made up of three main components:  The keyword itself,  an expression that is tested for its truth value,  and a code suite to.
Learning Objective To be able to… Understand flow chart symbols Complete and correct flow chart algorithms Create a program based on a flow chart.
Introduction to Programming Python Lab 7: if Statement 19 February PythonLab7 lecture slides.ppt Ping Brennan
1 VB-04-Control Structures 16 March 2016 Visual Basic Control Structures - Selection.
CIS 115 All Exercises Devry University (Devry) For more course tutorials visit CIS 115 All Exercises Devry University.
CIS 115 AID Peer Educator/cis115aid.com FOR MORE CLASSES VISIT
CIS 115 All Exercises Devry University (Devry) FOR MORE CLASSES VISIT CIS 115 All Exercises Devry University.
CIS 115 ALL EXERCISES DEVRY UNIVERSITY (DEVRY)  CIS 115 All Exercises Devry University CIS 115 ALL ILABS DEVRY UNIVERSITY (DEVRY)  CIS 115 All iLabs.
Repetition statements
BIT116: Scripting Lecture 05
Program Development Cycle
CIS 115 Slingshot Academy / cis115.com
Lesson Objectives Aims To be able to write an algorithm in Pseudo Code
3.1 Fundamentals of algorithms
Exercise : Write a program that print the final price of purchase at a store where everything costs exactly one dollar. Ask for the number of items purchased.
Introduction to Programming
Lecture 2 Introduction to Programming
ALGORITHM Basic CONCEPTS of Basic Concepts of Algorithm
CS 108 Computing Fundamental Notes for Thursday, October 5, 2017
ALGORITHMS & FLOWCHARTING II
CIS 115 Possible Is Everything/snaptutorial.com
CIS115 Education for Service-- snaptutorial.com
BIS 155 PAPERS Perfect Education/ bis155papers.com.
CIS 115 Teaching Effectively-- snaptutorial.com
For Monday Read WebCT quiz 18.
Introduction to Programming
Programming Fundamentals (750113) Ch1. Problem Solving
Programming Fundamentals (750113) Ch1. Problem Solving
1) C program development 2) Selection structure
For Wednesday No new reading No quiz.
Introduction to Programming
Creating Goals and Objectives
Creating Goals and Objectives
Programming Fundamentals (750113) Ch1. Problem Solving
Programming Fundamentals (750113) Ch1. Problem Solving
Building Windows Applications by Visual C++ and Homework #3 Assignment
Thank you to the creator of this – name is unknown.
Introduction to Programming
WJEC GCSE Computer Science
Presentation transcript:

Continue with conditional

If statements-example 1 Problem : At Kiddy School , the teachers used the A, B,C for grading the students’ works. If the student get an A, then the teacher will print “Excellent” and if the student get B, the teacher will print “Good”. For students that get C, the teacher will print “Work Harder”. Given the problem above, design a solution using flowchart.

Example 2: Problem: Your instructor asked you to design a program that can receive two input number (assumed that both number are not the same) and determine the larger of the two. Design a flowchart the problem above.

Exercise 1 Problem: Your instructor asked you to design a program that can take 3 input and determine the largest of three input integers. Draw flowchart and write Python code for the problem above.

Exercise 2 Start Put the envelope in the mail box Go to the mail box Using the text given, draw a flowchart for mailing a letter: Start Put the envelope in the mail box Go to the mail box Stop Seal the envelope Put the airmail stamp on Put letter in the envelope Address the envelope Is it airmail? Put the local stamp on http://chatt.hdsb.ca/~druivenm/computer/resources/start_html/ch02.htm

Exercise 3 Given the following text, construct a flowchart for changing a flat tire on a car. Lower the car Put the spare tire Is flat a front tire? start Jack up the front of car Remove the jack from the trunk stop Put Jack & flat in the trunk Remove the spare from the trunk Remove the flat tire Jack up rear of car http://chatt.hdsb.ca/~druivenm/computer/resources/start_html/ch02.htm

Exercise 4 Draw a flowchart for a Patient Intake Process in the clinic. Use all the texts presented below. Patient in the system? Patient fill up the new patient form Patient leave the clinic Patient arrives at Front Desk Nurse ask for patient’s name and search the database Patient go to exam room Ask patient to be seated in the waiting room HIVQUAL Group Learning Guide

Exercise 5 The table below shows the normal boiling points of several substances. Design a program that prompts a user for the observed boiling point of a substance in degree Celsius ( C0 ) and identifies the substances if the observed boiling point is within 5% of the expected boiling point. If the data input is more than 5% higher or lower than any of the boiling points in the table, the program should output the message Substance unknown

Continue.. In your design : Identify the input The desired output Substance Normal boiling point (Celsius) Water 100 Mercury 357 Copper 1187 Silver 2193 Gold 2660 In your design : Identify the input The desired output Write the algorithm and pseudo code

Exercise 6 Keith’s Sheet Music needs a program to implement its music teacher’s discount policy. The program is to prompt the user to enter the purchase total to indicate whether the purchaser is a teacher. Music teachers receive a 10% discount on their sheet music purchases unless the purchase total is RM100 or higher. In that case, the discount is 12%. The discount calculation occurs before addition of the 5% sales tax. The sample outputs are as below: two output , 1 for teacher another one is not teacher.

Continue.. What you need to do? Analyze the problem - Identify input Identify output Identify formula 2. Write a pseudo code 3.Draw a flowchart 4. Write a Python code Total purchases RM122.00 Teacher’s discount RM 14.64 Discounted total RM 107.36 Sales tax RM 5.37 Total RM 112.73 Total purchases RM 24.90 Sales tax RM 1.25 Total RM 26.15