0% found this document useful (0 votes)
0 views1 page

Lab Assignment1 G3

The document outlines a series of programming tasks that involve basic mathematical calculations. These tasks include calculating the area of a circle, sum of natural numbers, perimeter and area of a rectangle, compound interest, BMI, sum of an arithmetic progression, temperature conversion, profit/loss percentage, selling price calculation, and profit/loss after discount. Each task specifies the required inputs and the formulas to be used.
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)
0 views1 page

Lab Assignment1 G3

The document outlines a series of programming tasks that involve basic mathematical calculations. These tasks include calculating the area of a circle, sum of natural numbers, perimeter and area of a rectangle, compound interest, BMI, sum of an arithmetic progression, temperature conversion, profit/loss percentage, selling price calculation, and profit/loss after discount. Each task specifies the required inputs and the formulas to be used.
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/ 1

1.​ Write a program to calculate the area of a circle.

Take the radius as input and use the


formula:

Area = π × r2

2.​ Write a program that takes an input N and calculates the sum of the first N natural
numbers using the formula:

Sum = N × (N+1) / 2​

3.​ Take the length and width of a rectangle as input from the user and calculate its
perimeter using the formula:

Perimeter = 2 × (Length+Width)
Area = Length x Width

4.​ Write a program to calculate compound interest using the formula:

Compound Interest=P×(1+R/100)^T

Take principal P, rate R, and time T as input from the user.

5.​ Write a program to calculate the Body Mass Index (BMI). Take the weight (in kilograms)
and height (in meters) as input, and calculate BMI using the formula:

BMI=Weight / Height^2​

6.​ Write a Python program to calculate the sum of an arithmetic progression. Take the first
term a, common difference d, and the number of terms n as input. Use the formula:

Sum = n/2 (2a+(n−1)×d)

7.​ Write a program to convert a temperature from Fahrenheit to Celsius. Take the
Fahrenheit value as input and use the formula:

Celsius = 5/9 (Fahrenheit−32)

8.​ Write a program to calculate and display the percentage of profit or loss based on the
cost price and selling price.

9.​ Write a program to input the cost price and desired profit percentage, then calculate the
selling price required to achieve that profit.

10.​Write a program to calculate the profit or loss after applying a discount to the marked
price. Inputs: cost price, marked price, and discount percentage.

You might also like