Task 1: Define variables for your name, age, and whether you are a student. Print out each variable and its type. Task 2: Write a program that takes a number as input and checks if it is positive, negative, or zero. # Use if-elif-else structure. Task 3: Write a program that keeps asking the user for input until they enter "stop". • Task 4: Write a function called `is_even` that takes a number and returns True if the number is even, False otherwise. # Call the function with different numbers to test it. 22/03/1446 • Task 5: Write a program that defines a list of 5 fruits. 1. Add one more fruit to the list. 2. Print the first and last fruit in the list. 3. Remove one fruit from the list and print the updated list. • Homework: 1. Create a dictionary that contains the names of three students and their corresponding ages. • 1. Add a new student and their age. • 2. Print the name and age of each student. 2. Write a program that asks the user to enter a number and divide 100 by that number. # Use try-except to handle the case where the user enters 0. 22/03/1446

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter16: Searching, Sorting And Vector Type
Section: Chapter Questions
Problem 20PE
icon
Related questions
Question
Task 1: Define variables for your name, age, and whether you are a
student. Print out each variable and its type.
Task 2: Write a program that takes a number as input and checks if it is
positive, negative, or zero. # Use if-elif-else structure.
Task 3: Write a program that keeps asking the user for input until they
enter "stop".
• Task 4: Write a function called `is_even` that takes a number and
returns True if the number is even, False otherwise. # Call the function
with different numbers to test it.
22/03/1446
• Task 5: Write a program that defines a list of 5 fruits.
1. Add one more fruit to the list.
2. Print the first and last fruit in the list.
3. Remove one fruit from the list and print the updated list.
• Homework:
1. Create a dictionary that contains the names of three students and their
corresponding ages.
• 1. Add a new student and their age.
• 2. Print the name and age of each student.
2. Write a program that asks the user to enter a number and divide 100 by
that number. # Use try-except to handle the case where the user enters 0.
22/03/1446
Transcribed Image Text:Task 1: Define variables for your name, age, and whether you are a student. Print out each variable and its type. Task 2: Write a program that takes a number as input and checks if it is positive, negative, or zero. # Use if-elif-else structure. Task 3: Write a program that keeps asking the user for input until they enter "stop". • Task 4: Write a function called `is_even` that takes a number and returns True if the number is even, False otherwise. # Call the function with different numbers to test it. 22/03/1446 • Task 5: Write a program that defines a list of 5 fruits. 1. Add one more fruit to the list. 2. Print the first and last fruit in the list. 3. Remove one fruit from the list and print the updated list. • Homework: 1. Create a dictionary that contains the names of three students and their corresponding ages. • 1. Add a new student and their age. • 2. Print the name and age of each student. 2. Write a program that asks the user to enter a number and divide 100 by that number. # Use try-except to handle the case where the user enters 0. 22/03/1446
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr