CSEB114: PRINCIPLE OF PROGRAMMING Quiz 1. Rules  No cheating  No reference  No discussion  Only best 5 quizzes will be counted in your final marks,

Slides:



Advertisements
Similar presentations
C Programming Technique – Firdaus-Harun.com
Advertisements

PROBLEM SOLVING TECHNIQUES
Section 5.2 Normal Distributions: Finding Probabilities.
Normal Distributions: Finding Probabilities
7.7 Choosing the Best Model for Two-Variable Data p. 279.
CS1010 Programming Methodology
ALGORITHMS AND FLOWCHARTS
Designing Algorithms Csci 107 Lecture 3. Designing algorithms Last time –Pseudocode –Algorithm: computing the sum 1+2+…+n –Gauss formula for 1+2+…+n Today.
Designing Algorithms Csci 107 Lecture 3. Administrativia Lab access –Searles 128: daily until 4pm unless class in progress –Searles 117: 6-10pm, Sat-Sun.
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.
Chapter 4 Control Structure: Loop Knowledge: Understand the various concepts of loop control structure Skill: Be able to develop a program involving loop.
Review Algorithm Analysis Problem Solving Space Complexity
Ma 109 College Algebra Section 001 Fall 2005 Dr. Carl Eberhart, Professor of Mathematics
Chapter 1 Pseudocode & Flowcharts
Warm Up Problem of the Day Lesson Presentation Lesson Quizzes.
Agenda  Commenting  Inputting Data from Keyboard (scanf)  Arithmetic Operators  ( ) * / + - %  Order of Operations  Mixing Different Numeric Data.
Take Me Out to the Ballgame A Lesson on Metric Money Management.
1 Introduction to Flowcharting. 2 Writing a program Defining the problem –Write down what the program will do Planning –Write down the steps, draw a flowchart.
CSEB114: Principle of programming
1. Definition and General Structure 2. Small Example 1 3. Simplified Structure 4. Short Additional Examples 5. Full Example 2 6. Common Error The for loop.
PSEUDOCODE C Programming Technique – Firdaus-Harun.com.
Chapter 2 - Algorithms and Design print Statement input Statement and Variables Assignment Statement if Statement Flowcharts Flow of Control Looping with.
ALGORITHMS AND FLOWCHARTS CSCI 105 – Computer Fluency.
Lecture 4: Calculating by Iterating. The while Repetition Statement Repetition structure Programmer specifies an action to be repeated while some condition.
Copyright ©2005  Department of Computer & Information Science JavaScript Modularity.
Definition A random variable is a variable whose value is determined by the outcome of a random experiment/chance situation.
1 Program Planning and Design Important stages before actual program is written.
The IF-statements 31-Jan-2005 Venkatesh Ramamoorthy.
Lecture 5: Stopping with a Sentinel. Using a Sentinel Problem Develop a class-averaging program that will process an arbitrary number of grades each time.
CSI: Time of Death (Due Friday). Example Problem: A coroner was called to the home of a person who had died during the night. In order to estimate the.
1 Programming 2 Overview of Programming 1. Write the equations in C++ notation : a) R =   a + b  24  2 a  b) W = a 12 + b 2 – 2abcos(y) 2a.
Warm Up Turn your homework into the box BEFORE the 7:15 bell! We will start the quiz immediately.
Agenda Perform Quiz #1 (20 minutes) Loops –Introduction / Purpose –while loops Structure / Examples involving a while loop –do/while loops Structure /
Chapter 7 Problem Solving with Loops
Algorithms, Part 3 of 3 Topics In-Class Project: The Box
1 CS 1430: Programming in C++. 2 Input: Input ends with -1 Sentinel-Controlled Loop Input: Input begins with.
Concepts of Algorithms CSC-244 Unit Zero Pseudo code, Flowchart and Algorithm Master Prince Computer College Qassim University K.S.A.
Bell Work: Olivya is 6 feet 2 inches tall. How many inches tall is Olivya?
Elapsed Time How Can We Calculate How Much Time Has Gone By? April 5, 2010.
PROBLEM SOLVING. REDBLUE GREENPINK ORANGEYELLOW Exit.
Lab 9 Exercises.
Ratios and Rates Objective: SWBAT use ratios and rates to solve real-life problems.
ALGORITHMS AND FLOWCHARTS. A typical programming task can be divided into two phases: Problem solving phase  produce an ordered sequence of steps that.
Lecture 5: Layers of Control. Nested while Loops Problem Multiplying two numbers and outputting the result only if they are both less than 5. (i.e. Start.
Lecture 19 Approximating Integrals. Integral = “Area”
3-3 Dividing Decimals Do Now Multiply   (-19.21)  (–2.1)
MOTION Motion: Change in position over time and is described by speed, velocity and acceleration.
Discrete vs continuous
Smarter Balanced Assessment Questions
Lesson Objectives Aims To be able to write an algorithm in Pseudo Code
Learn to divide decimals.
GC101 Introduction to computers and programs
while Repetition Structure
COVERED BASICS ABOUT ALGORITHMS AND FLOWCHARTS
CS111 Computer Programming
Algorithms and Flowcharts
Selection Structures (Part 1)
Introduction to Programming
ALGORITHM Basic CONCEPTS of Basic Concepts of Algorithm
ALGORITHMS AND FLOWCHARTS
Section 2.1 Input and Output
2 Variation Real World.
For Wednesday No new reading No quiz.
example 3 Miles Per Gallon
Ratio, Proportion, and Other Applied Problems
Introduction to Programming
Warm Up Problem of the Day Lesson Presentation Lesson Quizzes.
Warm Up Problem of the Day Lesson Presentation Lesson Quizzes.
Warm Up Problem of the Day Lesson Presentation Lesson Quizzes.
Presentation transcript:

CSEB114: PRINCIPLE OF PROGRAMMING Quiz 1

Rules  No cheating  No reference  No discussion  Only best 5 quizzes will be counted in your final marks, however, if you are caught cheating, one of your best 5 quizzes will be 0  Those who submitted the quiz later than the time given, will get 0  Good Luck

Questions  Create a pseudocode and a flowchart of a program that first prompts the user to enter values for the length of a car trip in kilometers, and the amount of gasoline (in gallons) in the car’s tank at the beginning and end of the trip, and then computes and prints the average gasoline consumption in kilometer per gallon for the trip. (10 marks) (10 marks)

Question  Write a pseudocode and flowchart of a program that reads three numbers from the user and then calculates the average of the numbers. The number can be any number, positive or negative. Display the average of the numbers. (10 marks)  Write a pseudocode and flowchart of a program that display a message indicating the educational level of a student based on the student’s number of years of schooling. Use the table below. Print a message to indicate invalid data as well. Number of YearsEducational Level 0None 1-5Elementary 6-8Middle School 9-12High School More than 12College

Question  Write a pseudocode or flowchart for a program that estimates the temperature in a freezer (in ° C) given the elapsed time (hours) since a power failure. Assume this temperature (T) is given by where t is the time since the power failure. Your program should prompt the user to enter how long it has been since the start of the power failure in whole hours and minutes. Note that you need to convert the elapsed time into hours. For example, if the user entered 2 30 (2 hours 30 minutes), you would need to convert this to 2.5 hours.