60 likes | 191 Vues
This document outlines the procedure for determining whether a student passes or fails their Multimedia course at ITESM based on their GPA. The minimum GPA required to pass is set at 70. The algorithm begins by accepting the student's GPA input, compares it to the minimum GPA, and then outputs whether the student has passed or failed the course. Test cases demonstrate the functionality, illustrating both scenarios: passing with a GPA of 70 and failing with a GPA of 68.
E N D
I. Definition Given one GPA print if the student passes or fails the Multimedia course in ITESM CEM
II. Analysis O boy, I failed the course! You need at least 70 to pass. Give me your GPA Yes, I passed the course!
II. Analysis • Constants: • IC: Minimum GPA to pass. (MGPA = 70) • Variables: • IV: GPA (GPA) • OV: Sign (text) stating if someone passes or fails (S) • Operators: • OP1: Relational, “>=” (greater than or equal) • Operations: GPA >= MGPA
III. Design: Algorithm and/or Pseudo Code (You can write either the Algorithm or Pseudo Code or both) • Start • Type the GPA • Save GPA into input variable GPA • Save 70 into input constantMGPA as the minimum grade to pass at ITESM. • Compare GPA >= MGPA, if the result is true (yes) then the output variable S = “Pass”, else (false/no) S = “Fail” • Print S • End
1 START True False “Type GPA” S = “failed” S = “passed” GPA = “Number typed” MGPA = 70 “You” S “the Multimedia course” GPA >= MGPA III. Design: Flow Chart END 1
IV. TestAssign input variables some “Run Test” values Hint: Remember to put between “” every Alphanumeric value • RUN TEST NO. 1 • Start • GPA = 70 • MGPA = 70 • ¿GPA >= MGPA? • True • S = “passed” • “You passed the Multimedia course” • End • RUN TEST NO. 2 • Start • GPA = 68 • MGPA = 70 • ¿GPA >= MGPA? • False • S = “failed” • “You failed the Multimedia course” • End