

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
10 questions
Quiz : Literature Review
Presentation
•
University
10 questions
Daily Routines
Presentation
•
University
12 questions
Impossible math :)
Presentation
•
KG - University
13 questions
CAN, HAVE TO, MUST
Presentation
•
University
11 questions
MAT 143 9.3 Saving Money
Presentation
•
University
12 questions
Systems of Linear Equations (Part II)
Presentation
•
University
10 questions
Solving Two-Step Equations
Presentation
•
University
12 questions
Derivatives & Antiderivatives
Presentation
•
University
Popular Resources on Wayground
20 questions
STAAR Review Quiz #3
Quiz
•
8th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
6 questions
Marshmallow Farm Quiz
Quiz
•
2nd - 5th Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
20 questions
Inferences
Quiz
•
4th Grade
19 questions
Classifying Quadrilaterals
Quiz
•
3rd Grade
12 questions
What makes Nebraska's government unique?
Quiz
•
4th - 5th Grade