



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Instructions
Units Consumed Charge per Unit
First 100 units ₹
Next 100 units ₹
Above 200 units ₹
Write a program to accept the number of units consumed and calculate the total electricity bill. Sample Input 250
2. Student Grade Calculator Write a program to accept the marks obtained by a student and display the corresponding grade based on the following criteria.
Marks Grade
90–100 A
80–89 B
70–79 C
60–69 D
Below 60 F
Sample Input 86
3. ATM Withdrawal System An account has an available balance of ₹20,. Write a program to accept the withdrawal amount from the user and perform the following tasks: ● If sufficient balance is available, display the withdrawal amount and the remaining balance. ● Otherwise, display "Insufficient Balance." Sample Input 3500 4. Museum Ticket Counter The ticket price depends on the visitor's age.
Age Ticket Price
Below 5 years Free
5–17 years ₹
18–59 years ₹
60 years and above ₹
Write a program to determine the ticket price for a visitor. Sample Input 65
5. Login Authentication The valid login credentials are: ● Username: admin ● Password: python Write a program to accept the username and password from the user and validate the login credentials. Display an appropriate message for successful and unsuccessful login attempts. 6. Shopping Discount Calculator A shopping mall offers a 10% discount for purchases above ₹. Write a program to calculate the discount amount and the final bill payable by the customer. Sample Input 6500 7. Second Largest Number Write a program to accept three distinct integers and determine the second largest number among them.
13. Multiplication Table Write a program to accept a number and display its multiplication table up to 15. 14. Sum of Natural Numbers Write a program to accept a positive integer N and calculate the sum of the first N natural numbers. 15. Even Numbers Within a Range Write a program to accept two integers and display all the even numbers between them. Sample Input 10 30 16. Odd Numbers Within a Range Write a program to display all the odd numbers between 50 and 100. 17. Factorial of a Number Write a program to accept a positive integer and calculate its factorial. Sample Input 6 18. Prime Number Checker Write a program to determine whether a given integer is a prime number. Sample Input 29 19. Palindrome Number Write a program to determine whether a given integer is a palindrome. Sample Input 1221 20. Armstrong Number Write a program to determine whether a given three-digit integer is an Armstrong number. Sample Input 153 21. Number Guessing Game The computer stores the number 25. Write a program that repeatedly accepts the user's guess until the correct number is entered. Display the total number of attempts taken to guess the correct number.
22. Demonstration of break Statement Write a program to display numbers from 1 to 20 and terminate the loop immediately when the value becomes 12 using the break statement. 23. Demonstration of continue Statement Write a program to display numbers from 1 to 20 while skipping all multiples of 4 using the continue statement. 24. List Statistics Write a program to create a list containing 10 integer values and display the following: ● Original List ● Largest Value ● Smallest Value ● Sum of Elements ● Average of the Elements 25. Student Marks Analysis Write a program to create a list containing the marks of five students and display: ● Highest Mark ● Lowest Mark ● Average Mark ● Number of students who scored **75 marks or above