1 Session-15 CSIT 121 Spring 2006 Selection with Switch~Case Selection with Switch~Case Need an integer or character to test for Need an integer or character.

Slides:



Advertisements
Similar presentations
Chapter 4 - Control Statements
Advertisements

CS110 Programming Language I
Growing Arrays in C By: Victoria Tielebein CS 265- Spring 2011.
Subject: Information Technology Grade: 10
Selection 03/7/15. Programs Get help if you are not getting homework. –It's 40% of your grade.
1 Session-17 CSIT 121 Spring 2006 Loops: Conditional and Count Controlled Loops: Conditional and Count Controlled LCV: Initialize; Test and Update LCV:
1 Session-12 CSIT 121 Spring 2006 Test-1 is on March 9 th ; Demo-5 due date extended to March 7 Test-1 is on March 9 th ; Demo-5 due date extended to March.
1 Session-16 CSIT 121 Spring 2006 Demo for switch-case due now Demo for switch-case due now String comparison String comparison Slide 23; sample case.
Announcements The first graded lab will be posted Sunday 2/15 and due Friday 2/27 at midnight It is brand new, so please don’t hand in last semester’s.
1 Lab Session-8 CSIT-121 Fall 2003 w Call by Reference w Lab Exercise 1 w Lab Exercise for Demo w Practice Problems.
1 Lab Session-3 CSIT221 Spring 2003 b Group Worksheet 3 Exercise (Demo Required) b No new lab demo will be assigned to allow you to focus on HW#1.
1 Session-7 CSIT 121 Spring 2006 Lab Demo of NiMo Lesson 3-2 Exercises 1,2,3,4,5,6 (Arithmetic Operators with Program ‘Convert.cpp’) Q&A about operators.
Flowcharts Remember that a solution to a problem is called an algorithm. Algorithms are often a series of steps required to solve the problem. A flowchart.
1 Session-11 CSIT 121 Spring 2006 Test-1 is on March 9 th ; Demo-4 due Now Chapter 4 topics –Using get and ignore to control input data (3-19) –Prompting.
1 Lab Session-7 CSIT-121 Fall Revising Structured Choice 4 The While Loop variations 4 Lab Exercises.
1 10/9/06CS150 Introduction to Computer Science 1 for Loops.
1 Lab Session-6 CSIT-121 Spring 2005 Structured Choice The do~While Loop Lab Exercises.
1 Lab Session-3 CSIT 121 Fall 2004 Section-3 should finish Lab-1 Exercise first Division rules Operator precedence rules Lab Exercise.
1 Lab Session-3 CSIT 121 Spring’05 Division rules Operator precedence rules Lab Exercise.
1 Lab Session-11 CSIT 121 Fall 2003 Using arrays in functions Programming Exercise.
Java vs. You.
1 Lab Session-III CSIT-120 Spring 2001 Revising Previous session Data input and output While loop Exercise Limits and Bounds GOTO SLIDE 13 Lab session.
1 Lab Session-7 CSIT-121 Fall Introducing Structured Choice 4 The do~While Loop 4 Lab Exercises.
Administrative MUST GO TO CORRECT LAB SECTION! Homework due 11:59pm on Tuesday. 25 points off if late (up to 24 hours) Cannot submit after 11:59pm on Wednesday.
1 Lab Session-VIII CSIT-121 Spring 2002 w Formatted Output w Call by Reference w Lab Exercises w File Handling w Lab Exercises.
1 Lab Session-3 CSIT221 Fall 2002 b Exception Handling b Lab Exercise (Demo Required)
Parent Session #1 Thursday, March 5th, Parent Session #1 Thursday, March 5, 2015.
Education in Hungary Secondary school 14 years old-18 years old
Mastering Char to ASCII AND DOING MORE RELATED STRING MANIPULATION Why VB.Net ?  The Language resembles Pseudocode - good for teaching and learning fundamentals.
1 Lab Session-8 CSIT-121 Spring 2005 Call by Reference Lab Exercise for Demo Practice Problems.
IF-ELSE IF-ELSE STATEMENT SWITCH-CASE STATEMENT Computer Programming Asst. Prof. Dr. Choopan Rattanapoka and Asst. Prof. Dr. Suphot Chunwiphat.
1 CSC 1401 S1 Computer Programming I Hamid Harroud School of Science and Engineering, Akhawayn University
CMPS 1371 Introduction to Computing for Engineers CONDITIONAL STATEMENTS.
Nested Control Structures * Conditional Operator (?:) * Preincrement and Postincrement * Predecrement and Postdecrement * Counter-Controlled Repetition.
DATA OVERVIEW: KIDS R KIDS WEST COBB APRIL 14, 2013 KENNESAW STATE UNIVERSITY EDL / ITEC 7305: SPRING 2013.
Introduction to Pascal The Basics of Program writing.
MULTIPLE ALTERNATIVES IF… THEN… ELSEIF SELECT CASE.
Count and add list of numbers From user input and from file.
CMP 131 Introduction to Computer Programming Violetta Cavalli-Sforza Week 3, Lecture 1.
CS161 Topic #16 1 Today in CS161 Lecture #16 Prepare for the Final Reviewing all Topics this term Variables If Statements Loops (do while, while, for)
22/11/ Selection If selection construct.
UFCEKS-20-2Multimedia Authoring Times Table Quiz.
Assignment statement and Arithmetic operation 1 The major part of data processing.
Exercise 1 Introduction to C# CIS Code the C# program to prompt the user to key in 12 integer values from the keyboard. If a value containing.
Validation final steps Stopping gaps being entered in an input.
Subroutines II. An Extended Example Subroutines are best used to simplify large and unwieldy programs. Here is one example of why and how they should.
Matlab Data types, input and output. Data types Char: >> a = ‘ Jim ’ Char: >> a = ‘ Jim ’ Numeric: uint8, uint16, uint32, uint64 int8, int16, int32, int64.
Homework #1: C++ Basics, Flow of Control, and Function Basics
LAB SESSION ONE DIMENSIONAL ARRAY.
More Sequences. Review: String Sequences  Strings are sequences of characters so we can: Use an index to refer to an individual character: Use slices.
Count Controlled Loops (Nested) Ain’t no sunshine when she’s gone …
31/01/ Selection If selection construct.
Algorithms, Part 3 of 3 Topics In-Class Project: The Box
Think First, Code Second Understand the problem Work out step by step procedure for solving the problem (algorithm) top down design and stepwise refinement.
Special Methods in Java. Mathematical methods The Math library is extensive, has many methods that you can call to aid you in your programming. Math.pow(double.
Learning Objective To be able to… Understand flow chart symbols Complete and correct flow chart algorithms Create a program based on a flow chart.
For loop. Exercise 1 Write a program to have the user input three (3) numbers: (f)rom, (t)o, and (i)ncrement. Count from f to t in increments of i, inclusive.
Selection Using IF THEN ELSE CASE Introducing Loops.
ECE Application Programming
Open AvgLoop. It should provide SOME guidance for today’s assignment, but don’t just copy-paste….THINK.
Lab Session-9 CSIT-121 Spring 2005
Python Lesson 6 Mr. Kalmes.
More Loops.
For Wednesday No new reading No quiz.
Class Examples.
CS150 Introduction to Computer Science 1
What should my students already know?
EECE.2160 ECE Application Programming
EECE.2160 ECE Application Programming
Types of Errors And Error Analysis.
Presentation transcript:

1 Session-15 CSIT 121 Spring 2006 Selection with Switch~Case Selection with Switch~Case Need an integer or character to test for Need an integer or character to test for Example: Counting vowels entered by the user Example: Counting vowels entered by the user Example: Deciding what the user wants to do Example: Deciding what the user wants to do

2 Demo Due Thu March 16 Develop a program that asks the user to enter the age of a child Develop a program that asks the user to enter the age of a child If the child is 5 years old, display “the child is admitted to Kindergarten” If the child is 5 years old, display “the child is admitted to Kindergarten” If the child is 6 years old, display “the child can enter Grade I” If the child is 6 years old, display “the child can enter Grade I” If the child is 7 years old, display “the child can enter Grade 2” If the child is 7 years old, display “the child can enter Grade 2” On the age of 8, 9 and 10 years, change the display to admit for Grade 3,4 and 5 On the age of 8, 9 and 10 years, change the display to admit for Grade 3,4 and 5 On any other age, display “error in age input, exiting….” On any other age, display “error in age input, exiting….” The program must use switch~case selection otherwise no points will be awarded The program must use switch~case selection otherwise no points will be awarded