0% found this document useful (0 votes)
7 views3 pages

PSSP Assignment Wednesday 14-08-24

Uploaded by

shitendu.some
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)
7 views3 pages

PSSP Assignment Wednesday 14-08-24

Uploaded by

shitendu.some
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

SRUNIVERSITY

SCHOOL OF CS & AI

Course- B. Tech Type- Programming Elective


Course Code- 24CS203ES102 Course Name- PSPP
Year-2024-2025 Semester- Odd
Date–14stAugust2024 Batch- B1- B25

1. Scenario : Exploring Python's type() and id() Functions


Dhruva is on a journey to explore Python's built-in functions and their uses. To gain a deeper
understanding of the type() and id() functions, Dhruva has decided to create a program that
demonstrates how these functions work on different types of data.
Program Requirements:
a) Create variables of different types: integer, float
b) Display the type and memory address (identity) of each variable using the type() and id()
functions.
Output:
Data Types and Identifiers
-----------------------------------
Integer:
Data Type: <class 'int'>
ID: 140708062926920
Float:
Data Type: <class 'float'>
ID: 1524940599696

2. Priya was given to do the following task using python . Help her to design a Python program
to implement this scenario.
1. Calculate the value of the expression: (10 + 5) * (12 - 8) / 2 ** 2
2. Swap two numbers using temporary variable.
3. Swap two numbers without using temporary variable (using Operators).

3. Scenario: Online Shopping Cart Bill Calculation


Develop a simple program that calculates the total cost of items in an online shopping cart. The
program will take the prices of individual items as input and apply various mathematical operations
to determine the final cost.
Requirements:
1. Prompt the user to enter the prices of three items in the shopping cart.
2. Calculate the subtotal by summing up the prices of the items.
3. Calculate the tax amount by applying a fixed GST rate (e.g., 15%) on the subtotal.
4. Calculate the final total by adding the subtotal and tax amount.
5. Display the calculated subtotal, tax amount, and final total.
Output:
Enter the price of item 1: 45
Enter the price of item 2: 55
Enter the price of item 3: 65
Subtotal: 165.0
Gst Tax : 24.75
Final Total: 189.75

4. As part of the Chandrayaan-3 mission, a rover is exploring the lunar surface. The rover
moves at a constant speed of 0.5 meters per second. calculate the distance it travels in a 10
minutes time.
Create a variable speed_of_rover and assign it a value of 0.5 m/s.
Create a variable time_in_seconds and assign it a value of 600 seconds (10 minutes).
Calculate the distance traveled by the rover using the formula distance = peed_of_rover *
time_in_seconds.
Display the calculated distance.

5. Given 3 sides, check whether these 3 sides form a triangle. (sum of 2 sides greater than the
remaining sides). Also for a triangle confirmation found, check if the triangle is isosceles.

Input:
1
2
3

Output:
Not a triangle.

6. Build a program that allows users to create their personal profiles by providing various details. The
program should prompt users to input their name, age, achievements, address, and a few additional
parameters. Once the user provides all the required information, the program should display the
complete personal profile. Design a Python program to implement this scenario. Program
Requirements:
a) Prompt the user to input their name.
b) Ask the user to enter their age.
c) Collect information about the user's educational background
d) Collect information about the user's hobbies
e) Collect information about the user's achievements
f) Collect information about the user's email
g) Collect information about the user's phone number
h) Collect information about the user's address as input.
i) Display the complete personal profile, including all the gathered information in below
format.
Personal Profile
----------------------------------------------------------------------------
Name: SR University
Age: 20
Educational Background: University
Hobbies: Social Service
Achievements: NRIF 98 Rank
Email: sru@[Link]
Phone Number: +91 9999999999
Address: Ananthasagar

You might also like