This document discusses control structures in programming, including selection structures like if/else and switch statements. It provides examples of using these structures in C++ to evaluate conditions and choose which code to execute. Pseudocode is used to illustrate algorithms and control flow before translating them into C++ code. Flowcharts are also presented as a way to visually represent program logic and control structures.
This course provides a strong background about JAVA programming language in the field of computing. The course begins with an introductory overview of the Computer and programs, with distinguishes the terms API, IDE and JDK, and gives a comprehensive knowledge about Java development kits and Java integrative development environments like eclipse and NetBeans. Furthermore, the course prepares student to write, compile, run and develop Java applications which are used to find out the solution for several real life problems, in conjunction with using GUI to obtain input, process and display outputs like message dialog boxes, input dialog boxes, confirmation dialog and so on.
JAVA is a computer programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible.
The aim of this course is to explore Java programming fundamentals related to write, compile, run and develop Java applications that are used to discover the solution for several real life problems.
The official learning outcome for this course is: Upon successful completion of the course the students:
• Must know the basic concepts related JAVA programming language.
• Must know how to write, compile, run and develop java applications.
A combination of lectures and practical sessions will be used in this course in order to achieve the aim of the course.
By MSc. Karwan Mustafa Kareem
This slide includes: Control Flow and Functions.
That is Boolean values and operators.
It include Iteration,Fruitful functions,Scope of Variable and Modules.
This course provides a strong background about JAVA programming language in the field of computing. The course begins with an introductory overview of the Computer and programs, with distinguishes the terms API, IDE and JDK, and gives a comprehensive knowledge about Java development kits and Java integrative development environments like eclipse and NetBeans. Furthermore, the course prepares student to write, compile, run and develop Java applications which are used to find out the solution for several real life problems, in conjunction with using GUI to obtain input, process and display outputs like message dialog boxes, input dialog boxes, confirmation dialog and so on.
JAVA is a computer programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible.
The aim of this course is to explore Java programming fundamentals related to write, compile, run and develop Java applications that are used to discover the solution for several real life problems.
The official learning outcome for this course is: Upon successful completion of the course the students:
• Must know the basic concepts related JAVA programming language.
• Must know how to write, compile, run and develop java applications.
A combination of lectures and practical sessions will be used in this course in order to achieve the aim of the course.
By MSc. Karwan Mustafa Kareem
This slide includes: Control Flow and Functions.
That is Boolean values and operators.
It include Iteration,Fruitful functions,Scope of Variable and Modules.
The Three Basic Selection Structures in C++ Programming ConceptsTech
Now check the powerpoint presentation about selection structures in programming. For more visit www.techora.net
Three types of selection structures are available like :
1 - Sequence Structure
2 - Selection Strcuture
3 - Repetition Structure
In this PPT slide, we discuss about the selection structure
1 - if statements
2 - if else statement
3 - switch statement
In this lesson you will learn how to use basic syntax, conditions, if-else statements and loops (for-loop, while-loop and do-while-loop) in Java and how to use the debugger.
Watch the video lesson and access the hands-on exercises here: https://softuni.org/code-lessons/java-foundations-certification-basic-syntax-conditions-and-loops
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Acetabularia Information For Class 9 .docxvaibhavrinwa19
Acetabularia acetabulum is a single-celled green alga that in its vegetative state is morphologically differentiated into a basal rhizoid and an axially elongated stalk, which bears whorls of branching hairs. The single diploid nucleus resides in the rhizoid.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
Francesca Gottschalk - How can education support child empowerment.pptxEduSkills OECD
Francesca Gottschalk from the OECD’s Centre for Educational Research and Innovation presents at the Ask an Expert Webinar: How can education support child empowerment?
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
2. 2
2.1 Introduction
Before writing a program
Have a thorough understanding of problem
Carefully plan your approach for solving it
While writing a program
Know what “building blocks” are available
Use good programming principles
3. 3
2.2 Algorithms
Computing problems
Solved by executing a series of actions in a
specific order
Algorithm is a procedure determining
Actions to be executed
Order to be executed
Example: recipe
Program control
Specifies the order in which statements are
executed
4. 4
2.3 Pseudocode
Pseudocode
Artificial, informal language used to develop
algorithms
Similar to everyday English
Not executed on computers
Used to think out program before coding
Easy to convert into C++ program
Only executable statements
No need to declare variables
5. 5
2.4 Control Structures
Sequential execution
Statements executed in order
Transfer of control
Next statement executed not next one in sequence
3 control structures (Bohm and Jacopini)
Sequence structure
Programs executed sequentially by default
Selection structures
if, if/else, switch
Repetition structures
while, do/while, for
6. 6
2.4 Control Structures
C++ keywords
Cannot be used as identifiers or variable names
C++ Keywords
Keywords common to the
C and C++ programming
languages
auto break case char const
continue default do double else
enum extern float for goto
if int long register return
short signed sizeof static struct
switch typedef union unsigned void
volatile while
C++ only keywords
asm bool catch class const_cast
delete dynamic_cast explicit false friend
inline mutable namespace new operator
private protected public reinterpret_cast
static_cast template this throw true
try typeid typename using virtual
wchar_t
7. 7
2.4 Control Structures
Flowchart
Graphical representation of an algorithm
Special-purpose symbols connected by arrows (flowlines)
Rectangle symbol (action symbol)
Any type of action
Oval symbol
Beginning or end of a program, or a section of code (circles)
Single-entry/single-exit control structures
Connect exit point of one to entry point of the next
Control structure stacking
8. 8
2.5 if Selection Structure
Selection structure
Choose among alternative courses of action
Pseudocode example:
If student’s grade is greater than or equal to 60
Print “Passed”
If the condition is true
Print statement executed, program continues to next
statement
If the condition is false
Print statement ignored, program continues
Indenting makes programs easier to read
C++ ignores whitespace characters (tabs, spaces, etc.)
9. 9
2.5 if Selection Structure
Translation into C++
If student’s grade is greater than or equal to 60
Print “Passed”
if ( grade >= 60 )
cout << "Passed";
Diamond symbol (decision symbol)
Indicates decision is to be made
Contains an expression that can be true or false
Test condition, follow path
if structure
Single-entry/single-exit
10. 10
2.5 if Selection Structure
Flowchart of pseudocode statement
true
false
grade >= 60 print “Passed”
A decision can be made on
any expression.
zero - false
nonzero - true
Example:
3 - 4 is true
11. 11
2.6 if/else Selection Structure
if
Performs action if condition true
if/else
Different actions if conditions true or false
Pseudocode
if student’s grade is greater than or equal to 60
print “Passed”
else
print “Failed”
C++ code
if ( grade >= 60 )
cout << "Passed";
else
cout << "Failed";
12. 12
2.6 if/else Selection Structure
Nested if/else structures
One inside another, test for multiple cases
Once condition met, other statements skipped
if student’s grade is greater than or equal to 90
Print “A”
else
if student’s grade is greater than or equal to 80
Print “B”
else
if student’s grade is greater than or equal to 70
Print “C”
else
if student’s grade is greater than or equal to 60
Print “D”
else
Print “F”
13. 13
2.6 if/else Selection Structure
Example
if ( grade >= 90 ) // 90 and above
cout << "A";
else if ( grade >= 80 ) // 80-89
cout << "B";
else if ( grade >= 70 ) // 70-79
cout << "C";
else if ( grade >= 60 ) // 60-69
cout << "D";
else // less than 60
cout << "F";
14. 14
Importance of Curly Braces
Print “We have a problem” if examGrade < 60
Print “We have a real problem” if examGrade < 60 and
quizGrade < 10
Print “Ok” if examGrade >= 60
int examGrade, quizGrade;
if (examGrade < 60)
cout << “We have a problem” << endl;
if (quizGrade < 10)
cout << “We have a real problem” << endl;
else
cout << “Ok”;
15. 15
Exam Grade Flowchartint examGrade, quizGrade;
if (examGrade < 60)
cout << “We have a problem” << endl;
if (quizGrade < 10)
cout << “We have a real problem” << endl;
else
cout << “Ok”;
examGrade < 60
“We have a problem”
“We have a real problem”
true
quizGrade < 10
“Ok”
truefalse
16. 16
Writing Cases
Print “We have a problem” if examGrade < 60
Print “We have a real problem” if examGrade < 60 and
quizGrade < 10
Print “Ok” if examGrade >= 60
examGrade < 60 quizGrade < 10 Action
Case 1 true false “We have a problem”
Case 2 true true “We have a problem” and
“We have a real problem”
Case 3 false true/false “Ok”
17. 17
Putting it all together
examGrade < 60 quizGrade < 10 Action
Case 1 true false “We have a problem”
Case 2 true true “We have a problem” and
“We have a real problem”
Case 3 false true/false “Ok”
int examGrade, quizGrade;
if (examGrade < 60)
System.out.println(“We have a problem”);
if (quizGrade < 10)
System.out.printl(“We have a real problem”);
else
System.out.println(“Ok”);
int examGrade, quizGrade;
if (examGrade < 60) {
cout << “We have a problem” << endl;
if (quizGrade < 10)
cout << “We have a real problem” << endl;
}
else
cout << “Ok”;
18. 18
boolean Operators
Combines multiple boolean expressions
If person’s age greater than or equal to 13 and less
than 17, he can go to G and PG-13 rated movies,
but not R rated movies
if (age >= 13 && age < 17)
cout << “You can go to G and PG-13”
<< “ rated movies, but not R” +
<< “ rated movies.”) << endl;
boolean operators
and - && (true if all conditions are true)
or - || (true if one condition is true)
not - ! (true if conditions is false)
19. 19
Expression Combinations
operand1 operand2 operand1 && operand2
true true true
true false false
false true false
false false false
if (age >= 13 && age < 17)
cout << “You can go to G and PG-13”
<< “ rated movies, but not R” +
<< “ rated movies.” << endl;
Let age = 12
Let age = 16
Let age = 17
The && (and) operator
20. 20
Expression Combinations
operand1 operand2 operand1 || operand2
true true true
true false true
false true true
false false false
The || (or) operator
operand !operand
true false
false true
The ! (not) operator
Example
if ( !( grade == sentinelValue ) )
cout << "The next grade is "
<< grade << endl;
Alternative:
if ( grade != sentinelValue )
cout << "The next grade is "
<< grade << endl;
21. 21
Playing Cards
Exercise with playing cards
Numbers represent the rank and suit of cards
// Codes for suits
const int SPADES = 0;
const int HEARTS = 1;
const int DIAMONDS = 2;
const int CLUBS = 3;
// Codes for nonnumeric ranks
const int ACE = 1;
const int JACK = 11;
const int QUEEN = 12;
const int KING = 13;
22. 22
Prints a Card Name
Print “rank of suit”
Consider just the rank part
if (rank == JACK)
cout << "Jack";
else if (rank == QUEEN)
cout << "Queen";
else if (rank == KING;
cout << "King";
else if (rank == ACE)
cout << "Ace";
else
cout << rank;
Notice:
comparing rank to
a number of
different value
23. 23
2.16switch Multiple-Selection
Structure
switch
Test variable for multiple values
Series of case labels and optional default case
switch ( variable ) {
case value1: // taken if variable == value1
statements
break; // necessary to exit switch
case value2:
case value3: // taken if variable == value2 or == value3
statements
break;
default: // taken if variable matches no other cases
statements
break;
}