1. Identification and solving of simple real life or scientific or technical problems, and developing flow charts for the same. Write a program to calculate the electricity bill, we must understand electricity charges and rates. /* 1 - 100 unit - 1.5/= 101-200 unit - 2.5/= 201-300 unit - 4/= 300 - 350 unit - 5/= above 300 - fixed charge 1500/= for example */ This program can explain as follows Declare total unit consumed by the customer using the variable unit. If the unit consumed less or equal to 100 units, calculates the total amount of consumed =units*1.5 If the unit consumed between 100 to 200 units, calculates the total amount of consumed=(100*1.5)+(unit-100)*2.5) If unit consumed between 200 to 300 units ,calculates total amount of consumed=(100*1.5)+(200-100)*2.5+(units-200)*4 If unit consumed between 300-350 units ,calculates total amount of consumed=(100*1.5)+(200-100)*2.5+(300-200)*4+(units-350)*5 If...
12. Developing a game activity using Pygame like bouncing ball, car race etc. SIMULATE BOUNCING BALL USING PYGAME To write a python program to simulate bouncing ball using pygame. PROGRAM/SOURCE CODE : import sys, pygame pygame.init() size = width, height = 800, 600 speed = [1, 1] background = 255, 255, 255 screen = pygame.display.set_mode(size) pygame.display.set_caption("Bouncing ball") ball = pygame.image.load("ball.png") ballrect = ball.get_rect() while 1: for event in pygame.event.get(): if event.type == pygame.QUIT: sys.exit() ballrect = ballrect.move(speed) if ballrect.left < 0 or ballrect.right > width: ...
Problem Solving and Python Programming (2021 Regulations Anna University,Chennai) LIST OF EXPERIMENTS: 1. Identification and solving of simple real life or scientific or technical problems, and developing flow charts for the same. (Electricity Billing, Retail shop billing, Sin series, weight of a motorbike, Weight of a steel bar, compute Electrical Current in Three Phase AC Circuit, etc.) 2. Python programming using simple statements and expressions (exchange the values of two variables, circulate the values of n variables, distance between two points). 3. Scientific problems using Conditionals and Iterative loops. (Number series, Number Patterns, pyramid pattern) 4. Implementing real-time/technical applications using Lists, Tuples. (Items present in library/ Components of a car/ Materials required for construction of a building –operations of list & tuples) 5. Implementing real-time/technical applications using Sets, Dictionaries. (Language, components o...
Comments
Post a Comment