

Problem-solving
Presentation
•
Computers, Mathematics
•
University
•
Practice Problem
•
Hard
Alaa AlChalabi
Used 14+ times
FREE Resource
10 Slides • 6 Questions
1
Review
GNG 1106

2
Reminder
Deliverable 1 of the project is due Nov 29, 2020 at 11:59 pm.
3
Problem Solving Method - An Example
4
Problem
A train leaves city A travelling towards city B at some given speed (km/h). At the same time a train leaves city B going to city A at some given speed (km/h). Write a program that will compute the distance from city A where the trains will pass each other.
5
Multiple Choice
What is the first step of problem solving?
Identification
I/O Information Gathering
Test Cases and Design
Implementation
Testing and Verification
6
Step 1: Identification
In this case the problem is rather simple and unambiguously defined so step 1 is simply a re-statement of the problem described:
A train leaves city A travelling towards city B at some given speed (km/h). At the same time a train leaves city B going to city A at some given speed (km/h). Write a program that will compute the distance from city A where the trains will pass each other.
7
Multiple Choice
In which step of problem-solving do we start coding/programming?
1
2
3
4
5
8
Step 4: Implementation
It is actually step 4 where the coding should start after identifying the problem, analyzing its parameters, and designing the solution.
9
Multiple Select
In plotting using PLPLOT library, which of the following is the correct order of the functions that needs to be used for plotting?
plinit, plstring, plssub, plline, plend
plstar, plenv, plend, pllab, plline
plinit, plenv, plcol0, plpoin, plend
plstar, plenv, plcol0, plline, plenv, plpoin, plend
10
Plplot library
plinit to initialize the plot.
plenv to define the range and scale of the graph, axes, etc. (pllab can be used to set the labels on the graph).
One or more calls (can draw more than one curve on the set of axes) to plline or plpoin to draw lines or points.
plend, to close the plot.
11
Fill in the Blanks
Type answer...
12
Flow chart – Open file modes
13
Open Ended
Why is the null check important in this following code? And what is the exact type of errors does it handle?
FILE *filePtr;
filePtr = fopen(“test.dat”, “r”);
if(filePtr == NULL)
__printf(“Error encountered opening file.\n”);
14
NULL Check in File I/O
If there was an error opening the file then fopen returns the NULL address which helps in avoiding Run-time errors.
E.g.: FILE *filePtr;
filePtr = fopen(“test.dat”, “r”);
if(filePtr == NULL)
printf(“Error encountered opening file.\n”);
15
Poll
Did you guys have fun reviewing the material?
Yes
No
16
Review
GNG 1106

Show answer
Auto Play
Slide 1 / 16
SLIDE
Similar Resources on Wayground
13 questions
too, too much/many, enough
Presentation
•
University
13 questions
Relative Pronouns
Presentation
•
University
13 questions
Present simple vs present continuous
Presentation
•
University
15 questions
Order of Operations (Live)
Presentation
•
KG - University
10 questions
Solving Equations
Presentation
•
6th Grade
11 questions
Present Simple vs. Present Continuous
Presentation
•
University
10 questions
Cardiovascular System
Presentation
•
University
12 questions
Anne Frank Character Change
Presentation
•
6th - 9th Grade
Popular Resources on Wayground
6 questions
Secondary Safety Quiz
Presentation
•
9th - 12th Grade
10 questions
MyPath Diagnostic Overview
Presentation
•
6th - 8th Grade
20 questions
Lab Safety Quiz
Quiz
•
6th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
20 questions
Adding and Subtracting Decimals
Quiz
•
5th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade
21 questions
Lab Safety
Quiz
•
10th Grade
Discover more resources for Computers
20 questions
Disney Trivia
Quiz
•
University
20 questions
Brand Trivia
Quiz
•
9th Grade - University
10 questions
Would you rather...
Quiz
•
KG - University
21 questions
Mapa países hispanohablantes
Quiz
•
1st Grade - University
10 questions
Spanish Greetings and Goodbyes!
Presentation
•
6th Grade - University
12 questions
CE 2b Early Documents Review
Quiz
•
7th Grade - University
30 questions
Multiplying and Dividing Integers
Quiz
•
6th Grade - University
13 questions
Back to School
Quiz
•
KG - University