0% found this document useful (0 votes)
6 views6 pages

CS Holiday Homework

The document outlines a series of programming exercises aimed at beginners, each with a specific aim and coding example. Programs include displaying welcome messages, finding larger numbers, calculating squares and cubes, EMI calculation, GST computation, and calculating the area of a circle. Each program is designed to enhance understanding of basic programming concepts and user input handling.

Uploaded by

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

CS Holiday Homework

The document outlines a series of programming exercises aimed at beginners, each with a specific aim and coding example. Programs include displaying welcome messages, finding larger numbers, calculating squares and cubes, EMI calculation, GST computation, and calculating the area of a circle. Each program is designed to enhance understanding of basic programming concepts and user input handling.

Uploaded by

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

CS Holiday Homework

Program-1
Aim: To display welcome message
Coding:
# Program1
Message= (input ("Enter a welcome message:"))
print (Message)
Output:

Program-2
Aim: To display the lager number/ smaller number between two numbers
Coding:
#Program2
n1=int(input("Enter first number:"))
n2=int(input("Enter second number:"))

if n1>n2:
print("Larger number is:",n1)
elif n2>n1:
print("Larger number is:",n2)
else:
print("Choose two different numbers")
Output:

Program-3
Aim: To display larger number between three numbers
Coding:
#Program3
n1=int(input("Enter first number:"))
n2=int(input("Enter second number:"))
n3=int(input("Enter third number:"))

if n1>n2 and n3:


print("Larger number is:",n1)
elif n2>n1 and n3:
print("Larger number is:",n2)
elif n3>n1 and n2:
print("Larger number is:",n3)
else:
print("Choose three different numbers")
Output:
Program-5
Aim: To enter a number from the user and display its square and cube
Coding:
#Program5
n=float(input("Enter a number:"))
print("Square is:", n**2)
print("Cube is", n**3)
Output:

Program-6
Aim: To calculate EMI of given amount, time period, rate
Coding:
#Program6 EMI Calculator
P=int(input("Enter the amount:"))
T=int(input("Enter time period:"))
R=int(input("Enter rate:"))
r= R/100
print("EMI:",P*r*(1+r)**T/(1+r)**T-1)
Output:

Program-7
Aim: To enter the price and GST rate of the product and print its market price
Coding:
#WAP to calculate GST/Income tax
Product=str(input("Enter product name:"))
SP=float(input("Enter the selling price of the product:"))
GST=float(input("Enter GST rate%="))

CGST=SP*((GST/2)/100)
SGST=CGST
A=SP+CGST+SGST

print(" CGST(@",(GST/2),"%)",(CGST))
print("SGST(@",(GST/2),"%):",(SGST))
print("Amount payble:",(A))
Output:
Program-8
Aim: To input three numbers from the user and print the largest number
Coding:
Program9
n1=int(input("Enter first number:"))
n2=int(input("Enter second number:"))
n3=int(input("Enter third number:"))

if (n1>=n2) and (n1>=n3):


print("Largest number is:",n1)
elif (n2>=n3) and (n2>=n1):
print("Largest number is:",n2)
elif (n3>=n1) and (n3>=n2):
print("Largest number is:",n3)
else:
print("Choose three different numbers")
Output:

Program-9
Aim: To input the name and age of the user and display a welcome message
Coding:
#Program9
Name=input("Enter your name:")
Age=int(input("Enter your age:"))
print("Welcome",Name,",your age is",Age,".")
Output:

Program10
Aim: To accepts radius of a circle from user and display it’s area
Coding:
#Program10
r=float(input("Enter radius of the circle:"))
import math
print("Area of the circle is",math.pi*r**2)
Output:

You might also like