0% found this document useful (0 votes)
14 views2 pages

Cse107 Mid

Uploaded by

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

Cse107 Mid

Uploaded by

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

Presidency University

Department of Computer Science and Engineering


MID Assessment[Summer 2024]
Course Code: 107 Section: 5 & 6
Course Title: Introduction to Computer Science

Deadline: 13/11/24 Full Marks: 10

Question 1: (2.5)
Take an hour from the user as input and tell it is time for which meal.
• The user will input the number in a 24-hour format. So, 14 means 2 pm, 3 means 3 am, 18
means 6 pm, etc.
• Valid inputs are 0 to 23. Inputs less than 0 or more than 23 are invalid in 24-hour clock.
• Assume, Input will be whole numbers. For example, 3.5 will NOT be given as input.

Inputs: Message to be printed


4 to 6: Breakfast
12 to 13: Lunch
16 to 17: Snacks
19 to 20: Dinner
For all other valid inputs, say "Patience is a virtue"
For all other invalid inputs, say "Wrong time"
==========================================================
For example,
If the user enters 4, your program should print the message "Breakfast".
If the user enters 5, your program should print the message "Breakfast".
If the user enters 6, your program should print the message "Breakfast".
If the user enters 0, your program should print the message "Patience is a virtue".
If the user enters 1, your program should print the message "Patience is a virtue".
If the user enters 18, your program should print the message "Patience is a virtue".
If the user enters 23, your program should print the message "Patience is a virtue".
If the user enters 24, your program should print the message "Wrong Time".
If the user enters -1, your program should print the message "Wrong Time".
If the user enters 27, your program should print the message "Wrong time".
Question 2:
Write Python code of a program to compute and display a person’s weekly salary as determined
by the following conditions: If the hours worked are less than or equal to 40, the person receives
Tk200.00 per hour, else the person receives Tk8000.00 plus Tk300.00 for each hour worked over
40 hours. The program should request the hours worked as input and should display the salary as
output. (2.5)
==========================================================
hint: You can consider the hour(the user input) to be an integer
==========================================================
Example:
Input: 100
Output: 26000

Question 3
Write a Python code to displays all the odd numbers between 10 and 50. (2.5)

Question 4:
Write Python code of a program that reads an integer, and prints the integer if it is a multiple
of either 2 or 5. (2.5)
==================================================================

1. Plagiarism Policy: Plagiarism will not be tolerated. Any student caught plagiarizing will
receive a zero for the assignment and may face further academic consequences.
2. Format: Soft copies will not be accepted. All assignments must be submitted in hard
copy.
3. Deadline: Late submissions will incur penalties unless a valid reason is provided
beforehand.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy