0% found this document useful (0 votes)
104 views5 pages

CMPE 012-1-1 Lab Exercises 1F

This document provides instructions for 4 lab exercises to refresh understanding of Python concepts like lists, conditionals, loops, and functions. Students are asked to complete the following activities: 1) A number processing program that calculates sums and products based on number types. 2) A grade classifier that assigns a letter grade based on a numeric score. 3) An age group classifier. 4) A basic student management system that allows adding and viewing students using loops. The exercises are to be submitted in Word format by a deadline for grading.
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)
104 views5 pages

CMPE 012-1-1 Lab Exercises 1F

This document provides instructions for 4 lab exercises to refresh understanding of Python concepts like lists, conditionals, loops, and functions. Students are asked to complete the following activities: 1) A number processing program that calculates sums and products based on number types. 2) A grade classifier that assigns a letter grade based on a numeric score. 3) An age group classifier. 4) A basic student management system that allows adding and viewing students using loops. The exercises are to be submitted in Word format by a deadline for grading.
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/ 5

Refresher (Lab Exercise)

BSECE 1-1

Before we proceed on a more complex topic, let’s assess and refresh first our understanding from
the previous lesson.
 Create the following activity in PyCharm or online-python.com.
 For checking:
o This will be 100 pts for Lab Exercise #1F
o Act #1 - #4 will be 20 pts each with criteria of:
 Submit the following activity in word format.
 All Font Calibri (Light), font size 12, Portrait, Margin 1” all side.
 Use the following template up to Activity #4

o 100 pts for individual recitation/actual demo of program on 01/27/2024 (Lab


Exercise 2F)
 Submit until 1 pm of January 20, 2024.
 Beyond 1 pm submission subject to 10 points deduction every hour late.
Activity #1: Number Processor
Objective:
Create a Python program that processes a list of user-inputted numbers. The program should
calculate the sum of even numbers and the product of odd numbers.
Instructions:
1. Ask the user to enter a list of numbers separated by spaces.
2. Convert the input string into a list of integers.
3. Initialize variables sum_even and product_odd to zero and one, respectively.
4. Use a loop to iterate through the list of numbers:
 If a number is even, add it to sum_even.
 If a number is odd, multiply it with product_odd.
5. Print the original list of numbers, the sum of even numbers, and the product of odd
numbers.
Example Output:

Activity #2: Grade Classifier

Objective:

Create a Python program that takes a user-inputted numeric grade and classifies it into a letter grade
using only if statements.

Instructions:

1. Prompt the user to enter a numeric grade (an integer between 0 and 100 inclusive).
2. Use if statements to classify the grade into one of the following grade comments:
 Very Good! = 90-100
 Nice! = (80-89)
 Hmm = (70-79)
 Ano na = (60-69)
 Mag shift na = (0-59)
*Please note grade notes above are just for fun. But use this on your activity.

3. Print the corresponding grade comment.

Example Output:
Activity #3: Age Group Classifier

Objective:

Create a Python program that takes a user-inputted age and classifies it into different age groups using
only if-else statements.

Instructions:

1. Prompt the user to enter their age.


2. Use if-else statements to classify the age into one of the following groups:
 Infant (0-2 years)
 Toddler (3-5 years)
 Child (6-12 years)
 Teenager (13-19 years)
 Adult (20 years and above)
3. Print the corresponding age group.

Example Output:

Activity #4: Student Management System


Objective:
Create a Python program for a basic student management system using only for loops. The
program should allow users to add students and view all students.

Instructions:

1. Initialize an empty list to store student information.


2. Display a menu with options to:
 Add a new student (name, age, grade).
 View all students.
 Exit the program.

3. Use for loops to implement the menu and functionalities.


4. Add at least 2-3 students (of your choice) initially for testing.

Example Output

You might also like