GCHM - Computational Chemistry

Slides:



Advertisements
Similar presentations
PHYS 2020 Pseudocode. Real Programmers Program in Pencil!  You can save a lot of time if you approach programming in a methodical way.  1) Write a clear.
Advertisements

Pseudocode.
Pseudocode.
Do Now Write down 4 things that you know about a COORDINATE GRID.
Selection Control Structures. Simple Program Design, Fourth Edition Chapter 4 2 Objectives In this chapter you will be able to: Elaborate on the uses.
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
Pseudocode. Simple Program Design, Fourth Edition Chapter 2 2 Objectives In this chapter you will be able to: Introduce common words, keywords, and meaningful.
Drill #10 List the relation (set of ordered pairs) and the domain and range of the following mapping: 1. Find the value of the following if f(x) = 2.f(
4 - Conditional Control Structures CHAPTER 4. Introduction A Program is usually not limited to a linear sequence of instructions. In real life, a programme.
DATA TYPES.
BCHM - Structural Biology
Warm Up Problem of the Day Lesson Presentation Lesson Quizzes.
OCHM – Organic Synthesis
MCAT Non-Sim General Chemistry GCHM - Stoichiometry 5 years
Points and their Coordinates
3-2 The Coordinate Plane Warm Up Problem of the Day
Objective Introduce the Coordinate plane, the 11 parts of it, how to name coordinates and plot points.
ALGORITHMS AND FLOWCHARTS
Understand Problem Solving Tools to Design Programming Solutions
OCHM – Organic Synthesis
GC101 Introduction to computers and programs
BIO – Genetics and Evolution
MCAT Non-Sim General Chemistry GCHM - Solutions 5 years Reyes, V. M.
Data Types Variables are used in programs to store items of data e.g a name, a high score, an exam mark. The data stored in a variable is entered from.
Warm Up Problem of the Day Lesson Presentation Lesson Quizzes.
OCHM - Molecular Structure
GCHM – Solutions & Electrochemistry
Objective The student will be able to:
Copyright 2012, 2008, 2004, 2000 Pearson Education, Inc.
Android 11: The Calculator Assignment
Programming Mehdi Bukhari.
Algorithms and Flowcharts
Understand Problem Solving Tools to Design Programming Solutions
Lecture 2 Introduction to Programming
Graphing Ordered Pairs
Linear Equations in Two Variables
Lesson 9: "if-else-if" and Conditional Logic
2008/09/24: Lecture 6b CMSC 104, Section 0101 John Y. Park
Quadrants and Reading Ordered Pairs
ALGORITHMS AND FLOWCHARTS
Control Structure Senior Lecturer
IFS410 Advanced Analysis and Design
Copyright © Cengage Learning. All rights reserved.
Graphing on the Coordinate Plane
Objective Introduce the Coordinate plane, the 11 parts of it, how to name coordinates and plot points.
Algorithm Discovery and Design
ALGORITHMS AND FLOWCHARTS
Algorithm and Ambiguity
Chapter 5: Control Structure
Graphing in the Coordinate Plane
Flowcharting & Algorithms
THE COORDINATE PLANE.
Go over homework – Practice Sheet 3-2 & 3-3 evens only
Chapter 3: Selection Structures: Making Decisions
Boolean Expressions to Make Comparisons
Flowcharts and Pseudo Code
4-1 The Coordinate Plane Warm Up Problem of the Day
Copyright © Cengage Learning. All rights reserved.
Warm Up Problem of the Day Lesson Presentation Lesson Quizzes.
Chapter 3: Selection Structures: Making Decisions
Graphing on the Coordinate Plane
Using C++ Arithmetic Operators and Control Structures
11.3 Coordinate Plane Math 1.
The COORDINATE PLANE The COORDINATE PLANE is a plane that is divided into four regions (called quadrants) by a horizontal line called the x-axis and a.
Points and their Coordinates
The Coordinate Plane #39.
Page 456 #1-17 Answers 6th Grade Math HOMEWORK 9-2
Points and their Coordinates
Warm Up Problem of the Day Lesson Presentation Lesson Quizzes 1.
The two number lines are called the axes.
Presentation transcript:

GCHM - Computational Chemistry Question Information Q-Bank MCAT Sim Non-Sim Subject General Chemistry Foundation GCHM - Computational Chemistry Validity 5 years Author(s) Reyes, V. M. Reviewer(s) 0000000 Editor(s) 0000000 Passage Information Passage ID Media ID(s) Passage Stem In this day and age of computers, every medical doctor is expected to be familiar with computers, the computational process, and some programming skills. Although there are literally a multitude of software available out there, all of them depend upon a computer programming language, of which there are also many that are available, with some more appropriate for particular applications than others. Some people, mostly computer scientists and professionals, usually know how to program in several languages, e.g., C, C++, Fortran, Pascal, to name a few. But all of these computer languages follow the same basic principles, and once a person learns how to program in one computer language by heart, s/he will be able learn other languages easily because the basic logic involved is the same across all languages.

Perhaps the most important of these basic principles or ingredients in computer programming are the ones called control structures, because they are the ones that direct the flow of the program. Here we shall direct our attention to a control structure called the “if-then-else” structure, a pseudocode for which is shown below. Most programmers, when creating a computer program for an application for the first time, will start with what is called a “pseudocode.” A pseudocode is a short-cut way of indicating the different steps, in plain English, to be undertaken in implementing the program. It is important that the steps are indicated in the exact order they are to be taken. After writing the pseudocode, the programmer usually tests a few simple inputs to see if the pseudocode gives the correct output. If it does, the pseudocode is then ready to be translated into whatever specific programming language the programmer wants to use. if (condition) then # statement 1 (1st alternative) # statement 2 else # statement 3 (2nd alternative) # statement 4 endif # statement 5 For example, assume you are trying to determine if a certain year is a leap year or not; you would write a pseudocode for this as follows: read year; # input the year you want if (year mod 4) = 0 # if remainder after division by 4 is zero print $year “is a leap year” # print output #1 else # if remainder after division by 4 is not zero print $year “is not a leap year” # print output #2 endif The “read” statement is often used to get the input (either from the keyboard or from a file; the modulo operator, e.g., “A mod B”, gives the remainder when A is divided by B; if this remainder is zero, the year is divisible by 4 hence a leap year, and the program prints this message (output #1). If the remainder is not zero, as indicated by the word “else”, then the program prints the second alternative message (output #2). Note that the “print” statement is for output, which is usually to the screen or to a file. $ refers to the value stored in the variable name that follows it.

if (condition) then # statement 1 (1st alternative) # statement 2 The condition may be singular or compound; compound conditions are those where two or more singular conditions are connected by Boolean operators such as ‘and’, ‘or’, or ‘not’. An example would be “x > 0 or x = 0” which would imply x is non-negative. The “endif” statement indicates the end of the “if-then-else” control structure. A variation of this control structure is used when there are more than two alternatives involved. For example, consider a situation when there are five alternatives; the pseudocode below would fit this example: if (condition) then # statement 1 (1st alternative) # statement 2 elseif # statement 3 (2nd alternative) # statement 4 elseif # statement 5 (3rd alternative) # statement 6 elseif # statement 7 (4th alternative) # statement 8 else # statement 9 (5th alternative) # statement 10 endif # statement 11 For example, if one wants to classify any country into the five continents of Asia, Europe, Africa, North and South America, one simply enters the name of a country and the program will output any of the five alternative continental names. (cont’d. on following page)

Question Attributes #1 (QID: 000000) Passage References PMID/Book Title of Publication or Book 000000000 J. D. Tisdall, Perl Programming for Bioinformatics (N/A) en.wikipedia.com, youtube.com (N/A) Author’s own lecture notes. Question Attributes #1 (QID: 000000) Topic Blueprint The If-then-else control statement Competency MCAT: BS-2: Application of Concepts & Principles To test the student’s level of computer programming proficiency by use of control structures, e.g., conditional statements, in pseudocode. Objective Media ID(s) 00000000 Question ID 00000000 Question Stem #1 Write a pseudocode, as simply and as concise as possible, that, given an ordered pair (a,b), determines whether the point lies on the first, second, third or fourth quadrants (Q I – Q IV) of the Cartesian plane. Answer Choices #1 A) I B) II C) III D) IV Correct: B)

I. II. III. IV. if (a>0 and b>0) then if (a > b) then print “pt. in Q I” elseif (a<0 and b>0) print “pt. in Q II” elseif (a<0 and b<0) print “pt. in Q III” elseif (a>0 and b<0) print “pt. in Q IV” else print “pt. on x- or y-axis” endif if (a > b) then print “pt. in Q I” elseif (a < b) print “pt. in Q II” elseif (a = b) print “pt. in Q III” elseif (a * b > 0) print “pt. in Q IV” else print “pt. is at origin” endif III. IV. if (a + b =1) then print “pt. in Q I” elseif (a + b = 2) print “pt. in Q II” elseif (a + b =3) print “pt. in Q III” elseif (a + b = 4) print “pt. in Q IV” else print “pt. is at infinity” endif if (a + b > 0) then print “pt. in Q I” elseif (a + b < 0) print “pt. in Q II” elseif (a - b = 0) print “pt. in Q III” elseif (b – a = 0) print “pt. in Q IV” else print “pt. on the axes” endif

marks the end of the if-then-else control structure. Explanation #1 The correct answer is B. The Cartesian plane is defined by the the x- and y- axes intersecting at right angles at the point where x = 0 and y = 0, which is called the origin, (0,0). if (a>0 and b>0) then #1 print “pt. in Q I” #2 elseif (a<0 and b>0) #3 print “pt. in Q II” #4 elseif (a<0 and b<0) #5 print “pt. in Q III” #6 elseif (a>0 and b<0) #7 print “pt. in Q IV” #8 else #9 print “pt. on x- or y-axis” #10 endif #11 The quadrant location of the point P specified by the ordered pair (a,b) depends on the values of a and b. If both are positive (statement #1), then P lies on the first quadrant (statement #2); if a is negative and b positive (statement #3), then P lies on the second quadrant (statement #4); if a and b are both negative (statement #5), then P lies on the third quadrant (statement #6); if a is positive and b negative (statement #7), then P lies of the fourth quadrant (statement #8); if none of the four previous conditions hold (statement #9), then either a or b or both are zero, in which case P lies on the x- or y-axis or is the origin (statement #10). Statement #11 (“endif”) simply marks the end of the if-then-else control structure. (Choice A) This choice is wrong because a>b, a<b, a=b and a*b >0 are not the right conditions for the point P as defined by (a,b) to be located on the first, second, third or fourth quadrants. (Choice C) This choice is also wrong because a+b>0, a+b<0, a-b =0 and b-a = 0 are not the right conditions for the point P as defined by (a,b) to be located on the first, second, third or fourth quadrants. (Choice D) This choice is wrong as well because a+b=1, a+b=2, a+b=3 and a+b=4 are not the right conditions for the point P as defined by (a,b) to be located on the first, second, third or fourth quadrants.

Educational objective: To test the student’s level of computer programming proficiency by use of control structures, e.g., conditional statements, in pseudocode. References #1 PMID/Book Title of Publication or Book 0000000 000000000 000000000 0000000 Verifications #1 Yes / No The question is at the Application or higher cognitive level. Yes / No The question is based on a realistic clinical scenario. Yes / No The question has at least one close distracter, and other options have educational value. Yes / No The question is appropriate to the entry level of nursing practice. Yes / No The explanation is short and concise, yet thorough. Yes / No The question has an appropriate table/flow chart/illustration.