Introduction to PASS, and Exercises on Operators and Basic I/O.

Slides:



Advertisements
Similar presentations
Credit hours: 4 Contact hours: 50 (30 Theory, 20 Lab) Prerequisite: TB143 Introduction to Personal Computers.
Advertisements

1 ECSU-NAM 2OO8 STUDENT RESEARCH INSTITUTE IN COMPUTATIONAL SCIENCE- SCIENTIFIC VISUALIZATION Programming in Java: Problem Solving Moderator: Dr. Jamiiru.
C++ Basics March 10th. A C++ program //if necessary include headers //#include void main() { //variable declaration //read values input from user //computation.
CS1010 Programming Methodology
Topic 8 :PROGRAMMING 8.4 Use of control structure Learning Outcome : Write a program segment by using appropriate control structure.
Introduction to Application Programming IST 256 Application Programming for Information Systems Xiaozhong Liu
CS 177 Recitation Week 8 – Methods. Questions? Announcements  Project 3 milestone due next Thursday 10/22 9pm  Turn in with: turnin –c cs177=xxxx –p.
Copyright 2008 by Pearson Education Building Java Programs Chapter 3: Parameters, Return, and Interactive Programs Lecture 3-3: Interactive Programs w/
Rossella Lau Lecture 1, DCO10105, Semester B, DCO10105 Object-Oriented Programming and Design  Lecture 1: Introduction What this course is about:
1 9/08/06CS150 Introduction to Computer Science 1 Arithmetic Operators.
Lecture 5 Input and Output inputfprintf © 2007 Daniel Valentine. All rights reserved. Published by Elsevier.
1 CS150 Introduction to Computer Science 1 Relational Operators and the If Statement 9/22/08.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Java Programming Practice.
The If/Else Statement, Boolean Flags, and Menus Page 180
Click 98 bmi 1,75 kg m 98 bmi 1,75 kg m 32 Applet for calculation of body mass index.
Copyright 2006 by Pearson Education 1 Building Java Programs Chapter 3: Parameters, Return, and Interactive Programs with Scanner.
Body Mass Index and Calorie. Body Mass Index Body Mass Index, or BMI, is a tool that helps you measure the amount of body fat you have based on your height.
Introduction to Information and Computer Science Computer Programming Lecture c This material (Comp4_Unit5c), was developed by Oregon Health and Science.
WHAT IS BMI? BMI BODY MASS INDEX- BASED ON HEIGHT AND WEIGHT TO DETERMINE AMOUNT OF FAT AN INDIVIDUAL HAS OBESE BMI > 30.
Java Programming, 3e Concepts and Techniques Chapter 3 Section 62 – Manipulating Data Using Methods – Day 1.
Introduction to Information and Computer Science Computer Programming Lecture d This material (Comp4_Unit5d) was developed by Oregon Health and Science.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Agenda  Commenting  Inputting Data from Keyboard (scanf)  Arithmetic Operators  ( ) * / + - %  Order of Operations  Mixing Different Numeric Data.
Input, Output, and Processing
Chapter 02 (Part III) Introduction to C++ Programming.
How to start Visual Studio 2008 or 2010 (command-line program)
CSE1222: Lecture 3The Ohio State University1. Assignment Operations  The C++ assignment operator is: =  Examples: x = 3 * 5; y = x – 7; y = y + 4; Do.
1 Chapter-01 Introduction to Software Engineering.
Chapter 7 Formatted input and output. 7.1 introduction Tax: This result is correct; but it would be better Maybe as $13, Make formatting.
Chapter 2 Introduction to C++ Department of Computer Science Missouri State University.
02 Variables1November Variables CE : Fundamental Programming Techniques.
Component 4: Introduction to Information and Computer Science Unit 5: Overview of Programming Languages, Including Basic Programming Concepts Lecture 3.
Exercise 1 #include int main() { printf(“Hello C Programming!\n”); return 0; } 1.Run your Visual Studio 2008 or Create a new “project” and add.
1 Project 2: Using Variables and Expressions. 222 Project 2 Overview For this project you will work with three programs Circle Paint Ideal_Weight What.
5 February 2016Birkbeck College, U. London1 Introduction to Programming Lecturer: Steve Maybank Department of Computer Science and Information Systems.
1 Chapter-01 Introduction to Software Engineering.
Variables in C Topics  Naming Variables  Declaring Variables  Using Variables  The Assignment Statement Reading  Sections
CMSC 104, Version 8/061L09VariablesInC.ppt Variables in C Topics Naming Variables Declaring Variables Using Variables The Assignment Statement Reading.
CPSC 233 Tutorial 5 February 9 th /10 th, Java Classes Each Java class contains a set of instance variables and methods Instance Variables: Type.
Lab 9 Exercises.
Building Java Programs Chapter 4 Lecture 4-1: Scanner ; cumulative algorithms reading: 3.3 – 3.4, 4.2.
QUIZ Start. What does BMI stand for? A) Big massive idiot B) Body mass indent C) Body muscle index D) Body mass index.
Functions and an Introduction to Recursion.  Write a program for learn C++ subfunction.  Exercise: ◦ Please implement the following functions:  double.
Caloric Expenditure November 30 th and December 1 st.
2.3 Output Formatting. Outputting Format Specify the number of spaces, “c”, used to print an integer value with specifier %cd, e.g., %3d, %4d. E.g. printf.
Intelligent Data Systems Lab. Department of Computer Science & Engineering Practices 컴퓨터의 개념 및 실습 4 월 25 일.
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 3: Input/Output Samples.
INPUT & OUTPUT 10/20/2016Department of Computer Science, UOM | Introduction | Fakhre Alam.
GCSE COMPUTER SCIENCE Practical Programming using Python Lesson 4 - Selection.
Introduction to Programming
How to Calculate Your Body Mass Index (BMI)
GCSE COMPUTER SCIENCE Practical Programming using Python
Input and Output: I/O Finish reading chapters 1 and 2 of the text
CS1010 Discussion Group 11 Week 4 – Overview of C programming.
Functions CIS 40 – Introduction to Programming in Python
Functions Chapter 20.
Administrative things
Variables In programming, we often need to have places to store data. These receptacles are called variables. They are called that because they can change.
Review Tab Click on the Review tab to: - view the entire course - use Highwire to print the course or save the file to your computer This tab allows.
Introduction to Programming
Introduction to cout / cin
TIERING ACTIVITY FITNESS.
Introduction to C Programming
Building Java Programs
Unit 3: Variables in Java
National Chiao Tung University
General Computer Science for Engineers CISC 106 Lecture 03
Variables in C Topics Naming Variables Declaring Variables
Introduction to cout / cin
Building Java Programs
Presentation transcript:

Introduction to PASS, and Exercises on Operators and Basic I/O

3 Q1a. Download area.cpp file from the course website. There are syntax/logical errors in this area.cpp file, please correct them.

Program reads the width and height of a rectangle. The program computes and output the area of the rectangle. Is the program easy to understand? Why?

5 Q1b. Revise program to print notes for the input and output of the program Test your program using PASS

Q1c: Improve the programming style of the program More meaningful variable name to reflect the purpose of the variable Indentation (use the tab character to indent) Add comments; 6

Q2a: Body Mass Index (BMI) Read the weight and height of a person Calculate and print the Body Mass Index (BMI) Test your program using PASS 7

- Consider the data type needed, int or double? - To print to 2 decimal places, you may use cout<<setprecision(2). - To use setprecision(), you need #include 8

Q2b: Body Mass Index (BMI) in pounds 1 kg = 2.21 pounds Test your program using PASS 9

Q3: Write a program to converts the input value to Minutes and Seconds Read in the number of seconds Converts it to minutes and seconds. Test your program using PASS 10

Q4: Write a program to converts the input value to Hours, Minutes and Seconds Problem in Q3 60 minutes equal to 1 hour. Test your program using PASS 11