{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

2ProgramStructureI

# 2ProgramStructureI - Program Structure I Functions and...

This preview shows pages 1–5. Sign up to view the full content.

(CS1301) Introduction to Computer Programming City Univ of HK / Dept of CS / Helena Wong 2. Program Structure I - 1 http://www.cs.cityu.edu.hk/~helena Program Structure I Program Structure I Functions and Variables Introduction to Functions Example: Marks to Grade Conversion Parameters and Return Statement Flowchart Comments Example: Find Highest Mark Introduction to Variables Use of Local Variables and Global Variables Example: Counter [Please switch off your phone]

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
(CS1301) Introduction to Computer Programming City Univ of HK / Dept of CS / Helena Wong 2. Program Structure I - 2 http://www.cs.cityu.edu.hk/~helena Introduction to Functions An Example: Marks to Grade Conversion 4 Grades: F: 0-45 C: 46-65 B: 66-80 A: 81-100 65 80 90 C B A The design: The header The table containing marks and grades The marks, grades, and the button are elements of a form , specified by <input..> . Marks are text boxes where the user can type: <input type="text" ../> Grades are read-only text boxes: <input type="text" readonly="true" ../> The button has the name "Convert" (the value attribute). It accepts the onclick event and shows the grades: <input type =" button " value =" Convert " onclick ="…." />

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern