0% found this document useful (0 votes)
9 views3 pages

Workshop 01

The workshop focuses on programming fundamentals using C, specifically for managing class scores and statistics. Participants will learn to input and validate student scores, calculate total and average scores, and classify students as passed or failed. Key programming concepts include using logical control structures and loops for data processing and validation.

Uploaded by

lethuthuy1973ym
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views3 pages

Workshop 01

The workshop focuses on programming fundamentals using C, specifically for managing class scores and statistics. Participants will learn to input and validate student scores, calculate total and average scores, and classify students as passed or failed. Key programming concepts include using logical control structures and loops for data processing and validation.

Uploaded by

lethuthuy1973ym
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Subject: PRF192 - Programming Fundamental with C

Workshop 1
Objectives:
In this workshop, you will:

- Understand how to analyze problems and propose appropriate implementation


methods.
- Proficient in techniques for declaring and using variables effectively in programs.
- Perform basic input and output operations efficiently.
- Understand and apply fundamental arithmetic operations to process data.
- Know how to use logical control structures (e.g., if-else, switch-case, loops) to
handle program requirements.

Problem: Class Score Management and Statistics


Situation Description:
1. A teacher wants to input and manage the scores of students in a class.

2. The teacher needs to calculate and display:

o The total score of the class.

o The average score of the class.

o The number of students who passed and failed (passing score is >= 5).

3. The program must validate the input to ensure that scores are within the range of
0 to 10.

4. Data should be processed by iterating through the list of students.

Syntax Use in the Problem:


1. if and else:

o To check if the scores are valid (in the range 0–10).

o To classify students as “passed” or “failed” based on their scores.

2. for:

o To loop through the list of students and input their scores.

3. while:
o To handle repetitive actions, such as input validation for the number of
students and their scores.

Specific Requirements:
1. Requirement 1: Input Data

o Input the number of students.

o Input each student's score, validating the input using if-else.

2. Requirement 2: Calculation

o Use for to calculate the total score and count the number of students who
passed or failed.

3. Requirement 3: Statistics

o Display:

 The total score of the class.

 The average score of the class.

 The number of students who passed and failed.

4. Requirement 4: Validation

o Ensure that the input is an integer and scores are in the valid range (0–10).

Hint: Code Design


Output Sample:

You might also like