Sublime Science College
Assignment No 1.
1. What is the correct variable type for storing the following data:
 The number of pages in your text book
 The cost of this book
 The age of a person
 The number of people in the world
2. Write a program that calculates and prints sum, difference and product of two numbers. Also,
use this program to calculate remainder and quotient in division of these numbers. Display the
output on the screen.
3. One large chemical company pays its salesperson on a commission basis. The company pays
salesman $200 per week plus 9 percent of his gross sale of that week.
For example, a salesperson sales $5000 worth of chemicals in a week, so company pays him
$200 + 9% of $5000 = $650.
Write a program for the company which will take the value from the user of total worth in
dollars sailed by the salesperson in one week and calculate his total earning of that week.
4. Write a program that input a character and display its ASCII code. & Vice Versa.
5. Write a program that find out the area of triangle when three sides a,b and c of the triangle are
given.
 Hint: √𝒔(𝒔 − 𝒂)(𝒔 − 𝒃)(𝒔 − 𝒄) where c=a+b+c/2
6. Write a program that input total pages of a book, number of pages a person read in one day and
number of days a person has read the book. It displays number of pages that have been read
and number of pages remaining.
7. Write a program which accepts amount as integer and display total number of Notes of Rs. 500,
100, 50, 20, 10, 5 and 1. For example, when user enter a number 575
the results would be like this...
500: 1
100: 0
50: 1
20: 1
10: 0
5: 1
1: 0
8. Write a program for the calculation of the roots of Quadratic Equation. The program should be
designed in such a way that user should be able to enter the values of a, b, & c. And the formula
to calculate the roots of Quadratic Equation.
9. Write a program to separate the integral and fractional parts of given real number and print the
result on the screen.
10. Write a program that swap two entered values without using third variable.
Mail:- sk_ahsan38@yahoo.com
WhatsApp:- +92 300 5020927

Lecture#2

  • 1.
    Sublime Science College AssignmentNo 1. 1. What is the correct variable type for storing the following data:  The number of pages in your text book  The cost of this book  The age of a person  The number of people in the world 2. Write a program that calculates and prints sum, difference and product of two numbers. Also, use this program to calculate remainder and quotient in division of these numbers. Display the output on the screen. 3. One large chemical company pays its salesperson on a commission basis. The company pays salesman $200 per week plus 9 percent of his gross sale of that week. For example, a salesperson sales $5000 worth of chemicals in a week, so company pays him $200 + 9% of $5000 = $650. Write a program for the company which will take the value from the user of total worth in dollars sailed by the salesperson in one week and calculate his total earning of that week. 4. Write a program that input a character and display its ASCII code. & Vice Versa. 5. Write a program that find out the area of triangle when three sides a,b and c of the triangle are given.  Hint: √𝒔(𝒔 − 𝒂)(𝒔 − 𝒃)(𝒔 − 𝒄) where c=a+b+c/2 6. Write a program that input total pages of a book, number of pages a person read in one day and number of days a person has read the book. It displays number of pages that have been read and number of pages remaining. 7. Write a program which accepts amount as integer and display total number of Notes of Rs. 500, 100, 50, 20, 10, 5 and 1. For example, when user enter a number 575 the results would be like this... 500: 1 100: 0 50: 1 20: 1 10: 0 5: 1 1: 0 8. Write a program for the calculation of the roots of Quadratic Equation. The program should be designed in such a way that user should be able to enter the values of a, b, & c. And the formula to calculate the roots of Quadratic Equation. 9. Write a program to separate the integral and fractional parts of given real number and print the result on the screen. 10. Write a program that swap two entered values without using third variable. Mail:- sk_ahsan38@yahoo.com WhatsApp:- +92 300 5020927