Presentation is loading. Please wait.

Presentation is loading. Please wait.

March 2005 1R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Exam TopicsExam Topics.

Similar presentations


Presentation on theme: "March 2005 1R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Exam TopicsExam Topics."— Presentation transcript:

1 March 2005 1R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Exam TopicsExam Topics

2 March 2005 2R. Smith - University of St Thomas - Minnesota Exam Format Short answersShort answers Some short programsSome short programs Interpretation of short flow chartsInterpretation of short flow charts Interpretation of series of statementsInterpretation of series of statements Open book, closed notesOpen book, closed notes –You can add notes (post-its, whatever) to your book –You must figure out where the good reference materials are!

3 March 2005 3R. Smith - University of St Thomas - Minnesota Programming Strategies Focus on inputs and outputsFocus on inputs and outputs –Identify the inputs –Identify the outputs –Identify the calculations needed to make it happen Look at dependenciesLook at dependencies –The outputs depend on various inputs –Identify which outputs depend on which calculations –Identify which calculations depend on which inputs –You’re backtracking from the answer to the solution Write a flow chartWrite a flow chart –If you’re uncomfortable with Ifs and loops, draw the chart Do at least one calculation by hand to checkDo at least one calculation by hand to check

4 March 2005 4R. Smith - University of St Thomas - Minnesota Chapters 2-3 Chapter 2: ProgrammingChapter 2: Programming –Steps in creating a program EditEdit CompileCompile LinkLink Execute/TestExecute/Test Chapter 3: BasicsChapter 3: Basics –All of it: it’s pretty basic –“Hello World” – type programs –Basic variable printout –Basic arithmetic

5 March 2005 5R. Smith - University of St Thomas - Minnesota Chapter 4: Variables Using a variable (“3 steps”)Using a variable (“3 steps”) –Declare, Initialize, Use Types int, char, and doubleTypes int, char, and double –How to use them in arithmetic Other TypesOther Types –What’s the difference between the “usual” variables, and –short, long, long long; or float vs double Arithmetic operators, including %Arithmetic operators, including % –Add, subtract, multiply, divide

6 March 2005 6R. Smith - University of St Thomas - Minnesota Chapter 4 continued Conversion and castingConversion and casting –Double <- int is OK, since no data is lost –Int <- double is risky, since you may lose the fractions Division and castingDivision and casting –Must use casting on division when making doubles from ints ‘printf’ codes for output‘printf’ codes for output –%i, %g, %.2g, %6s, $%.2g for dollars –In other words How to print out integers, doubles, strings, charsHow to print out integers, doubles, strings, chars Control the number of decimal pointsControl the number of decimal points Specify the number of characters wide the number isSpecify the number of characters wide the number is Adding a dollar signAdding a dollar sign

7 March 2005 7R. Smith - University of St Thomas - Minnesota Chapter 5: Loops ‘for’ loops‘for’ loops –What are the 3 parts for? ‘scanf’ for input‘scanf’ for input –Scanning %i, using & in front of the variable name Relational operatorsRelational operators –==, !=, = –Difference between = and == ++ operation++ operation Nested loopsNested loops ‘while’ and ‘do’ loops‘while’ and ‘do’ loops –“Leading” (while) versus “trailing” (do)

8 March 2005 8R. Smith - University of St Thomas - Minnesota Chapters 6-7 Chapter 6: if StatementChapter 6: if Statement –‘else’ and ‘else if’ –Compound relationals Using && and ||Using && and || –Nested ‘if’ –“Comb structure” – a series of “else if” tests Chapter 7: ArraysChapter 7: Arrays –1D arrays –Declaration, initialization Type, name, size; curly brace initializationType, name, size; curly brace initialization With a ‘for’ loopWith a ‘for’ loop –Using array elements in calculations

9 March 2005 9R. Smith - University of St Thomas - Minnesota Questions?

10 March 2005 10R. Smith - University of St Thomas - Minnesota Creative Commons License This work is licensed under the Creative Commons Attribution-Share Alike 3.0 United States License. To view a copy of this license, visit http://creativecommons.org/licenses/by- sa/3.0/us/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.


Download ppt "March 2005 1R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Exam TopicsExam Topics."

Similar presentations


Ads by Google