CS1101ProgrammingMethodology
Week5:RepetitionStatements
It is not hard to learn more. What is hard
is to unlearn when you discover yourself
wrong. ~ Martin H. Fischer
ThisweekwewillfocusonChapter6.(Pleasedonotuserecursion.)
Withthis,wehavecoveredallthethr
CS1101 AY09/2010 Sem1
Discussion Group 7
Week 5 Practice Exercises
Q1.
Write a program which takes a positive integer number from the keyboard and prints out the
remainder when the number is divided by 11.
You are not allowed to use modulus operator %, di
CS1101AY09/2010Sem1
DiscussionGroup7
Week3Revision
Chapter 3 Numerical Data
1. [ReviewExercisesQ1]
Supposewehavethefollowingdeclarations:
int i = 3, j = 4, k = 5;
float x = 34.5f, y = 12.25f;
Determinethevalueforeachofthefollowingexpressionsorexplainwhyi
CS1101C Lecture 5
Control Structures and Data Files (Part 2)
Raymond Tan
[email protected]
Semester 1 2008 / 2009
Department of Computer Science
School Of Computing
National University Of Singapore
CS1101C Lecture 5 p.1/76
Lecture Outline
Example: T
CS1101C Lecture 4
Control Structures and Data Files (Part 1)
Raymond Tan
[email protected]
Semester 1 2008 / 2009
Department of Computer Science
School Of Computing
National University Of Singapore
CS1101C Lecture 4 p.1/126
Lecture Outline
Algorithm
CS1101C Lecture 3
Simple C Programs (Part 2)
Raymond Tan
[email protected]
Semester 1 2008 / 2009
Department of Computer Science
School Of Computing
National University Of Singapore
CS1101C Lecture 3 p.1/127
Lecture Outline
Standard Input and Output
CS1101C Lecture 2
Simple C Programs (Part 1)
Raymond Tan
[email protected]
Semester 1 2008 / 2009
Department of Computer Science
School Of Computing
National University Of Singapore
CS1101C Lecture 2 p.1/108
Lecture Outline
Program Structure.
CS1101
Lecture Outline
Standard Input and Output.
CS1101C Lecture 3
Numerical Technique: Linear Interpolation.
Simple C Programs (Part 2)
Problem Solving Applied: Freezing
Temperature of Seawater.
Raymond Tan
Mathematical Functions.
[email protected]
Chara
CS1101C Lecture 1
Engineering Problem Solving
Raymond Tan
[email protected]
Semester 1 2008 / 2009
School Of Computing
National University Of Singapore
CS1101C Lecture 1 p.1/49
Lecture Outline
Engineering in the 21st Century.
CS1101C Lecture 1 p.2/4
CS1101AY09/2010Sem1
DiscussionGroup7
Week3PracticeExercises
1) (Textbook4thedition,pg.143,Q.14)
Writeanapplicationtosolvequadraticequationsoftheform
where the coefficients A, B and C are real numbers. The two real number solutions are
derivedbytheformula
CS1101ProgrammingMethodology
Week9:Strings,Arrays,Exceptions
Mans mind, once stretched by a new
idea, never regains its original
dimensions. ~Oliver Wendell Holmes
ThisweekwewillfocusonString,Array(includingArrayList)andExceptions.Therearemany
questionshe
CS1101ProgrammingMethodology
Week3:JavaBasics
No matter how one may think himself accomplished,
when he sets out to learn a new language, science, or
the bicycle, he has entered a new realm as truly as if he
were a child newly born into the world. ~ Franc
Recursion
Reading assignment:
What is Recursion: http:/www.sparknotes.com/cs/recursion/whatisrecursion/
Examples of Recursion: http:/www.sparknotes.com/cs/recursion/examples/
1. The Math class provides the method pow(double a, double b) that returns the v
CS1101ProgrammingMethodology
Week7:ObjectOrientedProgramming
Every act of conscious learning requires the
willingness to suffer an injury to one's selfesteem. That is why young children, before they
are aware of their own self-importance, learn so
easily.
CS1101 Programming Methodology
Week 11: Week 9 + File Input and Output
Learning is not compulsory
neither is survival.
~ W. Edwards Deming
This week we will continue on last discussion sessions (Week 9s) topics on String, Array
(including ArrayList) and E
CS1101 AY09/2010 Sem1
Discussion Group 7
Week 4 Practice Exercises
Q1.
John is a Singapore book seller and he wants a program to store information of books. As a
programmer, you are required to write a class Book to help him. A book has the following
prop
CS1101 AY09/2010 Sem1
Discussion Group 7
Week 7 Practice Exercises
Midterm Preparation
1. The modulus operator (%) in Java can be used only with variables of integer type.
True
False
2. Consider the statement "x = (a > b) ? a : b"; then the value of x i
CS1101 AY09/2010 Sem1
Discussion Group 7
Week 12 PE Preparation
Question:
A number of candidates from countries all over the world: England, Germany, US, UK, Singapore,
Viet Nam, China, Japan are going to make votes to choose which country will hold next
CS1101 AY09/2010 Sem1
Discussion Group 7
Recess-Week Practice Exercises
Q1.
Write a program that gets the input (a sentence) from keyboard and returns the word in the
sentence that has the maximum number of occurrence.
(Words are separated by spaces).
Sam
CS1101 AY09/2010 Sem1
Discussion Group 7
Week 11 Practice Exercises
An operator is one of cfw_+, -, *, / - plus, minus, time and divide.
An expression is defined as 1 of the following 2 ways:
Number<space>Operator<space>Number
e.g. 1234 * 5678
RoundBracke
CS1101C Lecture 2
Simple C Programs (Part 1)
Raymond Tan
[email protected]
Semester 1 2008 / 2009
Department of Computer Science
School Of Computing
National University Of Singapore
CS1101C Lecture 2 p.1/108
Lecture Outline
Program Structure.
Consta
Lecture Outline
Program Structure.
CS1101C Lecture 2
Constants and Variables.
Simple C Programs (Part 1)
Assignment Statements.
Raymond Tan
[email protected]
Semester 1 2008 / 2009
Department of Computer Science
School Of Computing
National Universi