

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
In File I/O, if we would like to open the file “test.dat” for reading and writing, without changing the content and having the initial position at the end, we use the line:
filePtr = fopen(“test.dat”, "
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
11 questions
Evaluating Expressions
Presentation
•
University
13 questions
Adding and Subtracting Fractions
Presentation
•
University
10 questions
Deadlock_BankersAlgo
Presentation
•
University
11 questions
Real Numbers and a Number Line
Presentation
•
University
12 questions
Geometry - Lesson Area of Circle Sector and Length of Arc
Presentation
•
12th Grade
11 questions
Integration by Substitution and Parts
Presentation
•
University
12 questions
Functor and Applicative Quiz
Presentation
•
University
11 questions
PARAGRAPH STRUCTURE
Presentation
•
University
Popular Resources on Wayground
10 questions
Safety Day 2026 – Student Review
Quiz
•
9th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
12 questions
Map Skills
Quiz
•
3rd Grade
22 questions
Continents and Oceans
Quiz
•
5th Grade
15 questions
Rounding Decimals
Quiz
•
5th Grade
Discover more resources for Computers
20 questions
Disney Trivia
Quiz
•
University
10 questions
Spanish Greetings and Goodbyes!
Presentation
•
6th Grade - University
20 questions
Physical or Chemical Change/Phases
Quiz
•
8th Grade - University
39 questions
Unit 7 Key Terms
Quiz
•
11th Grade - University
25 questions
SER and Subject Pronouns
Quiz
•
8th Grade - University
38 questions
Unit 6 Key Terms
Quiz
•
11th Grade - University
19 questions
Key Concepts in Buddhism
Quiz
•
University
0 questions
Cell Domain Basic Review (Biology)
Quiz
•
University