The document provides an agenda for an introduction to computers lab covering repetition structures (loops), introduction to Visual Studio, and C++ programs. It discusses while, do-while, and for loops through flowcharts and C++ code examples. It also covers solutions containers, projects containers, program components in Visual Studio, and provides examples of C++ programs for various algorithms including determining if a number is positive/negative, even/odd, in a range, and baby weight classification. Exercises include finding maximum of numbers, GCD calculation, decimal to binary conversion, and factorial calculation.
Identify and explain the problem-solving steps. • Compare/contrast ideas within algorithms (pseudo-code and Flowcharts) to apply logical thinking in problem-solving.
Iterative control structures, looping, types of loops, loop workingNeeru Mittal
Introduction to looping, for loop. while loop, do loop jump statements, entry controlled vs exit controlled loop, algorithm and flowchart of loops, factorial of a number
this pdf is share here so that student can get material through this website.
this website actually helps as everybody website to uploud one's own material so that it reach every body.
so well will post our material for our student via this website cause we
not have one.
what is cool about this website is that it can serve any body particularly teacher to reach their readers our students.
Identify and explain the problem-solving steps. • Compare/contrast ideas within algorithms (pseudo-code and Flowcharts) to apply logical thinking in problem-solving.
Iterative control structures, looping, types of loops, loop workingNeeru Mittal
Introduction to looping, for loop. while loop, do loop jump statements, entry controlled vs exit controlled loop, algorithm and flowchart of loops, factorial of a number
this pdf is share here so that student can get material through this website.
this website actually helps as everybody website to uploud one's own material so that it reach every body.
so well will post our material for our student via this website cause we
not have one.
what is cool about this website is that it can serve any body particularly teacher to reach their readers our students.
At the end of this lecture students should be able to;
Describe the looping structures in C programming language.
Practice the control flow of different looping structures in C programming language.
Practice the variants in control flow of different looping structures in C programming language.
Apply taught concepts for writing programs.
Using Monte Carlo Simulation in Project Estimates by Akram Najjar
The PMI Lebanon is glad to announce that Akram Najjar is the speaker for the a lecture titled “Using Monte Carlo Simulation in Project Estimates” delivered on Thursday, 28 July 2016
Lecture Outline
* Why are single point estimates unreliable and what is the alternative?
* What are distributions and how do we extract random samples from them (using Excel)? Two costing examples.
* How to setup a Monte Carlo Simulation model in a spreadsheet?
* Two PM examples (in detail)
* How to statistically analyze the thousands of runs to reach reliable estimates?
Lecture Objectives
* A Project Manager usually knows how certain parameters (such as duration, resource rates or quantities) behave. However, the PM can almost never define reliable single point estimates for these parameters. The result: many projects fail due to unreliable estimates. The alternative? The PM has to use his/her knowledge of how specific parameters behave statistically. For example, the PM knows that a specific task’s duration is distributed according to the bell shaped curve OR that another is uniformly distributed (flat variation), or triangular, or Beta-PERT, etc. The PM can then use Monte Carlo Simulation (MCS) to arrive at statistically significant and robust results. Monte Carlo Simulation (MCS) is a technique that relies on two processes. Process 1 aims at developing a spreadsheet model that calculates the critical path or the total cost, etc. The calculation is setup in a single row (or Run). This row is then duplicated a large number of times (thousands). Process 2 aims at inserting Excel functions in each of the parameters (durations, costs). In each row (or Run), such functions will provide a sample drawn from a statistical distribution that properly describes the behavior of that parameter. For example, a specific duration follows a Normal (Bell) distribution with an Average A and a Standard Deviation S. The model will then generate for each run and for that duration a different value that conforms with the bell shaped curve as defined (A and S). Each of these thousands of runs will provide the PM with a different “simulation” of the duration or the total cost, etc. By statistically analyzing the thousands of results, the PM can arrive at a robust and reliable estimate. Proprietary Add On’s for Monte Carlo Simulation in Microsoft Project are available. However, it is easy, free and more flexible to use native Microsoft functions to carry out the full simulation. The talk covered all the steps needed for such simulations giving several examples
Algorithm and C code related to data structureSelf-Employed
Everything lies inside an algorithm in the world of coding and algorithm formation which is the basis of data structure and manipulation of the algorithm in computer science and information technology which is ultimately used to find a particular problems solution
At the end of this lecture students should be able to;
Describe the looping structures in C programming language.
Practice the control flow of different looping structures in C programming language.
Practice the variants in control flow of different looping structures in C programming language.
Apply taught concepts for writing programs.
Using Monte Carlo Simulation in Project Estimates by Akram Najjar
The PMI Lebanon is glad to announce that Akram Najjar is the speaker for the a lecture titled “Using Monte Carlo Simulation in Project Estimates” delivered on Thursday, 28 July 2016
Lecture Outline
* Why are single point estimates unreliable and what is the alternative?
* What are distributions and how do we extract random samples from them (using Excel)? Two costing examples.
* How to setup a Monte Carlo Simulation model in a spreadsheet?
* Two PM examples (in detail)
* How to statistically analyze the thousands of runs to reach reliable estimates?
Lecture Objectives
* A Project Manager usually knows how certain parameters (such as duration, resource rates or quantities) behave. However, the PM can almost never define reliable single point estimates for these parameters. The result: many projects fail due to unreliable estimates. The alternative? The PM has to use his/her knowledge of how specific parameters behave statistically. For example, the PM knows that a specific task’s duration is distributed according to the bell shaped curve OR that another is uniformly distributed (flat variation), or triangular, or Beta-PERT, etc. The PM can then use Monte Carlo Simulation (MCS) to arrive at statistically significant and robust results. Monte Carlo Simulation (MCS) is a technique that relies on two processes. Process 1 aims at developing a spreadsheet model that calculates the critical path or the total cost, etc. The calculation is setup in a single row (or Run). This row is then duplicated a large number of times (thousands). Process 2 aims at inserting Excel functions in each of the parameters (durations, costs). In each row (or Run), such functions will provide a sample drawn from a statistical distribution that properly describes the behavior of that parameter. For example, a specific duration follows a Normal (Bell) distribution with an Average A and a Standard Deviation S. The model will then generate for each run and for that duration a different value that conforms with the bell shaped curve as defined (A and S). Each of these thousands of runs will provide the PM with a different “simulation” of the duration or the total cost, etc. By statistically analyzing the thousands of results, the PM can arrive at a robust and reliable estimate. Proprietary Add On’s for Monte Carlo Simulation in Microsoft Project are available. However, it is easy, free and more flexible to use native Microsoft functions to carry out the full simulation. The talk covered all the steps needed for such simulations giving several examples
Algorithm and C code related to data structureSelf-Employed
Everything lies inside an algorithm in the world of coding and algorithm formation which is the basis of data structure and manipulation of the algorithm in computer science and information technology which is ultimately used to find a particular problems solution
Adjusting primitives for graph : SHORT REPORT / NOTESSubhajit Sahu
Graph algorithms, like PageRank Compressed Sparse Row (CSR) is an adjacency-list based graph representation that is
Multiply with different modes (map)
1. Performance of sequential execution based vs OpenMP based vector multiply.
2. Comparing various launch configs for CUDA based vector multiply.
Sum with different storage types (reduce)
1. Performance of vector element sum using float vs bfloat16 as the storage type.
Sum with different modes (reduce)
1. Performance of sequential execution based vs OpenMP based vector element sum.
2. Performance of memcpy vs in-place based CUDA based vector element sum.
3. Comparing various launch configs for CUDA based vector element sum (memcpy).
4. Comparing various launch configs for CUDA based vector element sum (in-place).
Sum with in-place strategies of CUDA mode (reduce)
1. Comparing various launch configs for CUDA based vector element sum (in-place).
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...John Andrews
SlideShare Description for "Chatty Kathy - UNC Bootcamp Final Project Presentation"
Title: Chatty Kathy: Enhancing Physical Activity Among Older Adults
Description:
Discover how Chatty Kathy, an innovative project developed at the UNC Bootcamp, aims to tackle the challenge of low physical activity among older adults. Our AI-driven solution uses peer interaction to boost and sustain exercise levels, significantly improving health outcomes. This presentation covers our problem statement, the rationale behind Chatty Kathy, synthetic data and persona creation, model performance metrics, a visual demonstration of the project, and potential future developments. Join us for an insightful Q&A session to explore the potential of this groundbreaking project.
Project Team: Jay Requarth, Jana Avery, John Andrews, Dr. Dick Davis II, Nee Buntoum, Nam Yeongjin & Mat Nicholas
Show drafts
volume_up
Empowering the Data Analytics Ecosystem: A Laser Focus on Value
The data analytics ecosystem thrives when every component functions at its peak, unlocking the true potential of data. Here's a laser focus on key areas for an empowered ecosystem:
1. Democratize Access, Not Data:
Granular Access Controls: Provide users with self-service tools tailored to their specific needs, preventing data overload and misuse.
Data Catalogs: Implement robust data catalogs for easy discovery and understanding of available data sources.
2. Foster Collaboration with Clear Roles:
Data Mesh Architecture: Break down data silos by creating a distributed data ownership model with clear ownership and responsibilities.
Collaborative Workspaces: Utilize interactive platforms where data scientists, analysts, and domain experts can work seamlessly together.
3. Leverage Advanced Analytics Strategically:
AI-powered Automation: Automate repetitive tasks like data cleaning and feature engineering, freeing up data talent for higher-level analysis.
Right-Tool Selection: Strategically choose the most effective advanced analytics techniques (e.g., AI, ML) based on specific business problems.
4. Prioritize Data Quality with Automation:
Automated Data Validation: Implement automated data quality checks to identify and rectify errors at the source, minimizing downstream issues.
Data Lineage Tracking: Track the flow of data throughout the ecosystem, ensuring transparency and facilitating root cause analysis for errors.
5. Cultivate a Data-Driven Mindset:
Metrics-Driven Performance Management: Align KPIs and performance metrics with data-driven insights to ensure actionable decision making.
Data Storytelling Workshops: Equip stakeholders with the skills to translate complex data findings into compelling narratives that drive action.
Benefits of a Precise Ecosystem:
Sharpened Focus: Precise access and clear roles ensure everyone works with the most relevant data, maximizing efficiency.
Actionable Insights: Strategic analytics and automated quality checks lead to more reliable and actionable data insights.
Continuous Improvement: Data-driven performance management fosters a culture of learning and continuous improvement.
Sustainable Growth: Empowered by data, organizations can make informed decisions to drive sustainable growth and innovation.
By focusing on these precise actions, organizations can create an empowered data analytics ecosystem that delivers real value by driving data-driven decisions and maximizing the return on their data investment.
4. Repetition Structure
• A repetition structure represents part of the
program that repeats. This type of structure is
commonly known as a loop.
4
5. Repetition Structure
• Notice the use of the diamond symbol. A loop tests a
condition, and if the condition exists, it performs an
action. Then it tests the condition again. If the
condition still exists, the action is repeated. This
continues until the condition no longer exists.
5
6. Repetition Structure
• In the flowchart segment, the question “is x < y?” is
asked.
• If the answer is yes, then Process A is performed.
• The question “is x < y?” is asked again. Process A is
repeated as long as x is less than y.
• When x is no longer less than y, the repetition stops
and the structure is exited.
x < y? Process A
YES
6
NO
7. Repetition Structure
• The flowchart segment below shows a
repetition structure expressed in C++ as a
while loop.
while (x < y)
x++;
Flowchart C++ Code
x < y? Add 1 to x
YES
7
NO
8. Controlling a Repetition
Structure
• The action performed by a repetition structure
must eventually cause the loop to terminate.
Otherwise, an infinite loop is created.
• In this flowchart segment, x is never changed.
Once the loop starts, it will never end.
x < y? Display x
YES
8
QUESTION: How can this
flowchart be modified so
it is no longer an infinite
loop? NO
9. Controlling a Repetition
Structure
• ANSWER: By adding an action within
the repetition that changes the value of x.
x < y? Display x Add 1 to x
YES
9
NO
10. A Pre-Test Repetition
Structure
• This type of structure is known as a pre-test
repetition structure. The condition is tested
BEFORE any actions are performed.
x < y? Display x Add 1 to x
YES
10
NO
11. A Pre-Test Repetition
Structure
• In a pre-test repetition structure, if the
condition does not exist, the loop will
never begin.
x < y? Display x Add 1 to x
YES
11
NO
12. A Post-Test Repetition
Structure
• This flowchart segment shows a post-
test repetition structure.
• The condition is tested AFTER the
actions are performed.
• A post-test repetition structure always
performs its actions at least once.
Display x
Add 1 to x
YES
x < y?
12
NO
13. A Post-Test Repetition
Structure
• The flowchart segment below shows a post-test
repetition structure expressed in C++ as a do-while
loop.
do
{
cout << x << endl;
x++;
} while (x < y);
Flowchart
C++ Code
Display x
Add 1 to x
YES
x < y?
13
NO
14. WHILE Expression
Action
ENDWHILE
1. WHILE Loop
Logical expression that
determine whether the
action is to be executed
Action to be
iteratively
performed until
logical expression
is false 14
15. Expression
Action
true
false
Expression is
evaluated at the start
of each iteration of
the loop
If expression is
false, program
execution
continues with next
statement outside
the loop
If expression is
true ,Action is
executed
15
16. Exercise 1
• Write down an algorithm and draw a flowchart to find and
print the largest of N numbers.
16
17. Print max
Set max = x ,
counter = 1
counter<n
Input x
counter=counter+1
x>max
START
max = x
True
Stop
Input n , x
True
false
false
17
18. Exercise 2
• Write a program that prompts the user to enter two positive
integers and finds their greatest common divisor.
• The greatest common divisor of integers 16 and 24 is 8.
So , how do you find the greatest common divisor ?
• Let the two input integers be n1 and n2. Number 1 is a
common divisor, but it may not be the greatest commons
divisor.
• So, you can check whether k (for k = 2, 3, 4, and so on) is
a common divisor for n1 and n2, until k is greater than n1
or n2.
18
20. 2. Do .. While
DO
Action
WHILE Expression
ENDWHILE
Execute Action
If Expression is true then
execute Action again ,
Repeat this process until
Expression evaluates to
false
20
22. Exercise 3
• Write down an algorithm and draw a flowchart to convert from
Positive decimal number to binary number.
22
23. START
Input N
remainder= N% 2
N = N/2
Print remainder
N <> 0
END
false
True
23
X=1
binaryNum = 0
binaryNum += remainder*x
X *= 10
24. 3. For Loop
FOR( initialization , condition , increment )
statements
ENDFOR
The increment portion is
executed at the end of
each iteration
The statements are executed until
this condition becomes false
The initialization is executed once
before the loop begins
24
25. Condition is evaluated at the start
of each iteration of the loop
If condition is true the
Action is executed
Initialization
Action
Increment
Condition
Executed once at the beginning of
for loop
True
False
If condition is false ,
program execution
continues with next
statements.
After the action has
completed , the increment is
evaluated , then the next
iteration of the loop starts.
25
29. What is Visual Studio?
• Visual Studio is a complete set of development tools for
building ASP.NET Web applications, XML Web Services,
desktop applications, and mobile applications. Visual
Basic, Visual C++, Visual C#, and Visual J#.
29
30. Containers
( Solutions and Projects )
• Visual Studio provides two containers to help you
efficiently manage the items that are required by your
development effort, such as references, data
connections, folders, and files. These containers are
called solutions and projects.
30
31. Solutions as Containers
• A solution can contain multiple projects and a project
typically contains multiple items (Items can be files and
other parts of your project such as references, data
connections, or folders).
• Visual Studio automatically generates a solution when
you create a new project. As needed, you can then add
other projects to the solution.
31
32. Projects as Containers
• Visual Studio projects are used as containers within a
solution to logically manage, build, and debug the items
that comprise your application.
• The output of a project is usually an executable program
(.exe), a dynamic-link library (.dll) file or a module,
among others
32
33. Program components
• Header Files : (file.h) contain constant, variable, and
function declarations needed by a program.
• Source Files : (file.cpp) consists of the program
statements comprising a C++ or other programming
language program.
36. Exercise 1
• Algorithm for program that reads a number and
determines whether it is positive, negative or zero.
36
37. Exercise 1: Solution
#include<iostream>
using namespace std;
int main()
{
int number ;
cout<<"Please enter number: ";
cin>> number;
if (number>0)
cout<< "Number is positiven";
else if(number == 0)
cout<< "Number is zeron";
else
cout<< "Number is Negativen";
return 0;
}
37
38. Exercise 2
• Algorithm for program that reads a number and
determines whether it is even or odd.
38
39. Exercise 2: Solution
#include<iostream>
using namespace std;
int main()
{
int number ;
cout<<"Please enter number: ";
cin>> number;
if (number%2 == 0)
cout<< "Number is evenn";
else
cout<< "Number is oddn";
return 0;
}
39
40. Exercise 3
• Algorithm for program that checks whether an input
number lies between specified range. For example: If
user enters range (20, 50) and queried number 34, the
program should display “In range”. On the other hand, if
he enters 76, the program should display “Not in
Range”.
40
41. Exercise 3: Solution
#include<iostream>
using namespace std;
int main()
{
int start,end,number;
cout<<"Please enter range: ";
cin>> start >> end;
cout<<"Please enter number: ";
cin>> number;
if(number >= start )
{
if (number <= end)
cout<<"In rangen";
else
cout<<"Not in rangen";
}
else
cout<<"Not in rangen";
return 0;
}
41
42. Exercise 3: Another Solution
#include<iostream>
using namespace std;
int main()
{
int s,e,number;
cout<<"Please enter range: ";
cin>> s >> e;
cout<<"Please enter number: ";
cin>> number;
if(number>= s && number <= e)
cout<<"In rangen";
else
cout<<"Not in rangen";
return 0;
}
42
43. Exercise 4
• Algorithm for program that determines whether a baby’s
weight is normal or not. For girls, normal babies weight
are 2.5 to 4.5 KG. On the other hand, for boys the
normal weights are 4 to 5.5 KG.
43
45. Exercise 5
• Write an algorithm for electricity company, which charges
customers according to their usage rank (1,2 or 3) and
reading (watt). In rank 1, customers pay 1 L.E./100 watt
with minimum 10 L.E. In rank 2, customers pay 2
L.E./100 watt, but pay at maximum 400 L.E. In rank 3,
customers pay 2.5 L.E./100 watt. Program reads the
usage rank and reading and displays the charged
amount.
45
46. #include<iostream>
using namespace std;
int main()
{
int rank , reading;
cout <<"Enter rank: ";
cin>> rank;
cout<<"Enter Reading watt: ";
cin>> reading;
float price = 0;
switch (rank)
{
case 1:
price = (reading/100.0) *1 ;
if(price < 10)
` cout<<"Total cost is:
"<<price<<endl;
else
cout<<"The custmer is in
anthor rankn";
break;
case 2:
price = (reading/100.0)*2;
if(price <= 400)
cout<<"Total cost is:
"<<price<<endl;
else
cout<<"The custmer is in
anther rankn";
break;
case 3:
price = (reading/100.0)*2.5;
if(price > 400)
cout<<"Total cost is:
"<<price<<endl;
else
cout<<"The custmer is in
anther rankn";
break;
default:
break;
}
return 0;
}
Exercise 5: Solution
46
47. Exercise 6
• Write a program for a calculator that works on integer
numbers. The user enters two numbers to perform only
one of three basic arithmetic operations (+, -, * and /).
• The interaction with the user might look like this: Enter
your Fractional expression: 1 + 2 The result = 3
• Hint: The user is allowed to do only one operation at a
time.
47
48. Exercise 6: Solution
# include <iostream>
using namespace std;
int main()
{
char op;
float num1, num2;
cout << "Enter operator either + or - or * or /: ";
cin >> op;
cout << "Enter two operands: ";
cin >> num1 >> num2;
switch(op)
{ case '+':
cout << num1+num2;
break;
case '-':
cout << num1-num2;
break;
case '*':
cout << num1*num2;
break;
case '/':
cout << num1/num2;
break;
default: // If the operator is other than +, -, * or /, error message is shown
cout << "Error! operator is not correct";
break;
}
return 0;
}
48
49. Lab Exercise
• A program to swap the values of two integers
using third variable.
49
50. Lab Exercise: Solution
#include <iostream>
using namespace std;
int main()
{
int a = 5, b = 10, temp;
cout << "Before swapping." << endl;
cout << "a = " << a << ", b = " << b << endl;
temp = a;
a = b;
b = temp;
cout << "nAfter swapping." << endl;
cout << "a = " << a << ", b = " << b << endl;
return 0;
}
50