Introduction To Programming (Unit-1 Long Answers)
Introduction To Programming (Unit-1 Long Answers)
Step 1: Identify and Define Problem Explain your problem clearly as possible as you can.
• List out all the solution that you find. Do not focus on the quality of the solution
• Generate the maximum number of solutions as you can without considering the quality of the
solution
Step 3: Evaluate Alternatives After generating the maximum solution, Remove the undesired
solutions.
Step 4: Decide a Solution After filtering all the solution, you have the best solution only. Then
choose one of the best solution and make a decision to make it as a perfect solution.
Step 5: Implement a Solution: After getting the best solution, implement that solution to solve a
problem.
Step 6: Evaluate the result after implementing a best solution, evaluate how much you solution
solve the problem. If your solution will not solve the problem then you can again start with Step2.
• Analysis and Specification Understand (define) the problem and what the solution must do
Implementation Phase
• Program Testing Test program for syntactical and logical errors. Fix the errors.
Maintenance Phase
1|Page
3. Explain problem solving strategies.
Ans :) 1. Identify the problem: The first step is to know which problem you need to solve. Then, you
need to find the root cause of the problem. The best course of action is to gather as much data as
possible, speak to the people involved, and separate facts from opinions. Once this is done, formulate a
statement that describes the problem. Use rational persuasion to make sure your team agrees.
2. Break the problem down: Identifying the problem allows you to see which steps need to be taken to
solve it. First, break the problem down into achievable blocks. Then, use strategic planning to set a time
frame in which to solve the problem and establish a timeline for the completion of each stage.
3. Generate potential solutions: At this stage, the aim isn’t to evaluate possible solutions but to
generate as many ideas as possible. Encourage your team to use creative thinking and be patient — the
best solution may not be the first or most obvious one. Use one or more of the different strategies in
the following section to help come up with solutions — the more creative, the better.
4. Evaluate the possible solutions: Once you’ve generated potential solutions, narrow them down to a
shortlist. Then, evaluate the options on your shortlist.
5. Implement and monitor the solutions: Once you’ve identified your solution and got buy-in from your
team, it’s time to implement it. But the work doesn’t stop there. You need to monitor your solution to
see whether it actually solves your problem. Request regular feedback from the team members involved
and have a monitoring and evaluation plan in place to measure progress. If the solution doesn’t achieve
your desired results, start this step-by-step process again
Ans :) Top-Down Approach is an approach to design algorithms in which a bigger problem is broken
down into smaller parts. Thus, it uses the decomposition approach. This approach is generally used by
structured programming languages such as C, COBOL and FORTRAN.
In this approach we look at the overall requirement and start coding. We build the main function first,
then add calls to various functions like add, subtract etc... And then display the output. After doing all
these we code the individual functions for addition, subtraction etc.
2|Page
5. Explain the importance of algorithm designing.
Ans :) Algorithm design affects how well your solution works, how fast it runs, how much memory it
uses and how easy it is to understand and modify. Choosing best right algorithm can make a big
difference in the quality and efficiency of your solution. Designing algorithms requires a set of principles
and techniques. To begin, you must define the problem clearly and precisely including the inputs and
outputs, assumptions and goals of the solution breaking down the problem into smaller and simpler
Ans :) Verification is the process of checking that software achieves its goal without any bugs.it is the
process to ensure whether the product that is developed is right or not. It verifies whether the
developed product fulfils the requirements that we have. The commonly used validation activities in
software testing are usability testing, performance testing, system testing, security testing, and
functionality testing. A few verification methods are inspection, code review, disk checking and
walkthroughs.
Ans :) One of the best ways to improve your algorithm efficiency and correctness is to use pseudo
code and diagrams to plan and visualize your algorithm before you write any code. Pseudo code is a
simplified and informal way of describing the steps and logic of your algorithm, using natural language
and basic symbols. The most efficient algorithm is one that takes the least amount of execution time and
3|Page
8. Explain algorithm analysis and notations.
Ans :) Algorithm analysis is an important part of computational complexity theory, which provides
theoretical estimation for the required resources of an algorithm to solve a specific computational
problem. Analysis of algorithm is the determination of the amount of time and space resources required
to execute it Notations: Asymptotic Notations is used to describe the running time of an algorithm how
There are three different notations: big O, big Theta, and big Omega.
Ans :) ALGORITHM:
Step 1: Start
Step 2: Read F
Step 3: Find C= (F-32)*(5/9)
Step 4: Print C
Step 5: Find F= (9/5)*C+32
Step 6: Print F
Step 7: Stop
10. Draw a flowchart to find greatest of two numbers.
4|Page
11. Write an algorithm to calculate simple interest.
Ans :) ALGORITHM:
Step 1: Read p, t, r
Step 4: Print si
Step 5: Stop
12. Draw a flowchart to check whether the given year is leap year or not.
Ans :)
5|Page
13. Write an algorithm to find the area of a triangle using heron’s formulae.
Ans :) ALGORITHM:
Step-4: Calculate the area using Heron's formula i.e area = sqrt(s * (s - side1) * (s - side2) * (s- side3));
Ans :)
6|Page
15. Write an algorithm to find roots of quadratic equation.
Ans :) ALGORITHM:
Step 1. Start
Step 2. Read the coefficients of the equation, a, b and c from the user.
Step 6. Else:
Step 7. Stop
7|Page
16. Draw a flowchart to find average of 10 numbers entered by the user.
Ans :)
8|Page