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.

Slides:



Advertisements
Similar presentations
Computing Science Software Design and Development SOFTWARE DESIGN AND DEVELOPMENT USING PYTHON.
Advertisements

Computer Programming Lab(7).
ATM User Interface V3. I/O Devices Input: Keyboardfor input, option select Keyboardfor input, option select Or Touch screen Or Touch screenOutput: Screenfor.
1 Lab Session-1 CSIT221 Fall 2002 b Refresher slides b Practice Problem b Lab Exercise (Demo Required)
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.
1 Session-5 CSIT 121 Spring 2006 Part D due now String Rules Chapter 2 Topics Lab Demo Exercise Assignment.
1 Lab Session-2 CSIT221 Spring 2003 b Intro to Object Oriented Programming b Practice Problem b Lab Exercise (Demo Required)
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 Lecture 19 Chapter 4 Program Input and the Software Design Process Dale/Weems/Headington.
1 Lab Session-1 CSIT221 Spring 2003 b Group Programming Challenge b Individual Lab Exercise (Demo Required)
1 Lab Session-VI CSIT-120 Spring 2001 Let us look at C++ syntax rules in brief Exercise VI-A (Demo Required) Lab Assignment#4 Due May 1st, 2001 (No Lab.
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.
1 Lab Session-XIV CSIT121 Spring 2002 b Namespaces b First Class Travel b Lab Exercise 14 (Demo) b Lab Exercise b Practice Problem.
1 Session-14 CSIT 121 Spring 2006 Demo due today; demo hint was sent to your campus accounts Demo due today; demo hint was sent to your campus .
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.
1 Lab Session-2 CSIT 121 Spring 2005 Debugging Tips NiMo’s Varying Rates Lab-2 Exercise.
1 Lab Session-XIII CSIT121 Fall 2000 b Lab Exercise13-A for Handling Files b Lab Exercise 13-B for Using Classes.
1 Lab Assignment#5 Due 12/7 A car can hold 12 gallons of gasoline and it can travel 360 miles without refuelling. Write a program the displays the trip.
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.
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.
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.
1 Session-13 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.
1 Lab Session-VIII CSIT-121 Spring 2002 w Formatted Output w Call by Reference w Lab Exercises w File Handling w Lab Exercises.
Program Input and the Software Design Process ROBERT REAVES.
1 ENG236: ENG236: C++ Programming Environment (2) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.
CS0007: Introduction to Computer Programming File IO and Recursion.
© Copyright 2012 by Pearson Education, Inc. All Rights Reserved. Chapter 13 Files and Exception Handling 1.
1 Lab Session-III CSIT-120 Fall 2000 Revising Previous session Data input and output While loop Exercise Limits and Bounds Session III-B (starts on slide.
Introduction to the WebBoard Terry Dennis. The WebBoard - Our Connection The WebBoard URL is
1 Lab Session-8 CSIT-121 Spring 2005 Call by Reference Lab Exercise for Demo Practice Problems.
Chapter 9 I/O Streams and Data Files
Topics 1.File Basics 2.Output Formatting 3.Passing File Stream Objects to Functions 4.More Detailed Error Testing 5.Member Functions for Reading and 6.Writing.
File Input and Output in C++. Keyboard and Screen I/O #include cin (of type istream) cout (of type ostream) Keyboard Screen executing program input data.
CHAPTER 7 DATA INPUT OUTPUT Prepared by: Lec. Ghader R. Kurdi.
What does C store? >>A = [1 2 3] >>B = [1 1] >>[C,D]=meshgrid(A,B) c) a) d) b)
My Python Programmes NAME:.
Program #2 Algorithm for Parking at PSU. Understanding the Assignment You will be writing a program to find out how much someone at PSU might be spending.
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.
Operating System Using setw and setprecision functions Using setiosflags function Using cin function Programming 1 DCT
Programming Fundamentals I Java Programming Spring 2009 Instructor: Xuan Tung Hoang TA: Tran Minh Trung Lab 03.
Chapter 15 Strings as Character Arrays
Copyright 2006 Addison-Wesley Brief Version of Starting Out with C++ Chapter 5 Looping.
1 Project 5: Leap Years. 222 Leap Years Write a program that reads an integer value from the user representing a year and determines if the year is a.
1 Project 4: Computing Distance. 222 Computing Distance Write a program to compute the distance between two points. Recall that the distance between the.
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.
Dictionaries and File I/O George Mason University.
Sibling Group Icon. The following graphics are designed to help you to navigate through this Computer Based Training. The navigational guides require.
EET 2259 Unit 13 Strings and File I/O
Topics discussed in this section:
Chapter 1 Introduction to Java
Section 64 – Manipulating Data Using Methods – Java Swing
Maha AlSaif Maryam AlQattan
Alternate Version of STARTING OUT WITH C++ 4th Edition
Lesson 08: Files Topic: Introduction to Programming, Zybook Ch 7, P4E Ch 7. Slides on website.
HOW TO CREATE A CLASS Steps:
Reading and Writing Text Files
Chapter 3 Input output.
Suppose I want to add all the even integers from 1 to 100 (inclusive)
Input Based Programs.
EET 2259 Unit 13 Strings and File I/O
File Handling.
Topics discussed in this section:
PLEASE ADD YOUR TITLE HERE.
Presentation transcript:

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 for input and echo printing (28-29) –Reading and Writing files (30-32) –Detecting I/O failure Run program Frame and add echo printing to confirm the input data before displaying results Add File I/O to the program Frame

2 Lab Exercise Demo Due March 7 Worried about our calorie intake, we would like to develop a program that reads the dinner items from a file and saves their names and individual calorie count, followed by total count of calories in a file. If the total calorie count is more than 1,000, a warning is displayed. On the following slides, a sample input data file is shown followed by the expected output file contents.. Take filename at runtime and warn the user on file opening error.

3 Sample Input Here are the contents of a sample input file Onion Soup 20 Beef Roast 6 Oz 410 Brown Rice 1 serving 230 Peach Pie One piece 405 Sweetened Instant Tea 85

4 The contents of output file Onion Soup 20 Beef Roast 6 Oz 410 Brown Rice 1 serving 230 Peach Pie One piece 405 Sweetened Instant Tea 85 ========================== The total count of calories in your dinner is 1150 Please avoid such feasts

5 File Handling Errors Please accept the input file’s name at runtime Your program should issue meaningful error messages when the file I/O stream enters fail state