Professional Documents
Culture Documents
Ex 2
Ex 2
● You will be able to apply computational thinking to devise solutions to the given
problems.
● You will be able to identify the type of statements (sequential, alternative and iterative)
required to solve problems.
● You code simple python programs to prompt the user input, to use variables and to
evaluate expressions.
Assignment :
Solve the following problems using Python (CO1, K3, 1.3.1, 13.3.1)
1. A bookstore needs to buy 60 copies of a book from a publisher. Suppose the cover price of
a book is ₹X, but bookstores get a discount of Y%. Shipping costs incurs ₹ Z for the first
copy and ₹ P for each additional copy. What is the total wholesale cost for 60 copies to be
paid by the bookstore to the publisher?
a. Identify the inputs required to solve the problem.
b. Identify the type of statements required.
c. Devise a solution and represent the same using flowchart and pseudocode.
d. Develop a program to print the wholesale cost of a single book and the wholesale
cost of 60 copies.
2. Assume the population of a city consists of X persons of different age groups. X includes
both male and female. Public welfare department wants to find the average age of male and
female. The department can obtain peoples date of birth from the corporation from which
the age can be calculated. (Note: Use only sequential statements to solve the problem.
Consider X to be less than or equal to 6)
a. Identify the inputs required to solve the problem.
b. Devise a solution and represent the same using flowchart and pseudocode.
c. Develop a program to compute the average age of male and female.
Additional problems using sequential statements for practice: