Assignment 1: Introduction To Computing Fall 2016
Assignment 1: Introduction To Computing Fall 2016
Assignment 1: Introduction To Computing Fall 2016
Introduction to Computing
Fall 2016
Due Date: Before the start of the class (1st September, 2016)
Instructions:
Use proper assignment papers for solving your assignment questions. Assignment done on diary pages,
register pages, rough pages will not be credited.
Do not copy the work of your peers. In case cheating is detected, then your case will be referred to DC.
Question 1. A new mobile company has to start its services in a remote area. They plan to develop a computerized
system to handle all the calculations. They have designed following rules and the policies for the bill calculation:
1. For first 100 units the rate is Rs 2 per unit and tax is 10%
2. For next 100 the rate is Rs 3 per unit and tax is 20%.
3. For next 100 or more the rate is Rs 5 per unit and tax is 25%.
In order to handle all these calculations electronically you have to write a program that takes the number of units
and time of the call from the user and prints the bill.
Question 2. Sonia sells flower bouquets in a local shop at Mall of Lahore. She wants to keep record of her bouquets.
She has asked you to develop a simple program that inputs prices of different bougets sold per day and provide the
following outputs:
1.
2.
3.
4.
Note: The program should keep asking for input until she hits -1. You have to draw the flow chart and write pseudocode for the above problem.
Question 3. Input 4 integers from user. Determine if they are in sorted order. If not, then output them in sorted
order. Use minimum number of if conditions
Question 4. You task is to develop pseudo-code and flow chart for calculating Semester GPA of a student (as done
in Fast-NUCES). Your program should input the number of courses enrolled by the student in the semester, followed
by the marks of the student (from 0-100) and credit hours for each course and output SGPA.
Note: your algorithm should first convert marks to GPA and then calculate the SGPA.
Question 5. Sonia has developed an online website for selling her flower bouquets. She is keeping a record of
number of new users that registered on her website per month. She wants to know the longest period of time in
which the registered users increase. This can be determined by finding the period of time during which the number
of users increased continuously. Sara has the record of 30 months. Write a program to help Sara. The program
should input the number of new users one by one for each month. The program should then find the months
between which there is a continuous increase in the new users for longest period of time.
For example, for the following input the program should output that longest period of time in which food item sale
increases is between month number 9 and 17.
456111331234567892334561113311