Top-Rated Free Essay
Preview

Assignment No1

Powerful Essays
2011 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Assignment No1
Assignment No. 1:FLOW CHART
Subject: Design and Analysis of Algorithm
Assigned: September 11, 2015
Assignment Marks: --
Instructor: Tanveer Ahmed Siddiqui
Due Date: September 17, 2015
Attached Files: Non
Objective:
The objective of this assignment is to give you some practice regarding
Flow chart
Characteristics of an algorithm
Fundamentals of Algorithmic Problem Solving
Instructions:
Please read the following instructions before attempting to solve this assignment
1. This is an individual assignment. You will submit your work individually through your logins (course portal) and also submit hard copy.
2. Try to get the concepts, consolidate your concepts and ideas from these questions
3. You should concern recommended books for clarify your concepts as handouts are not sufficient.
4. Try to make solution by yourself and protect your work from other students. If I found the solution files of some students are same then I will reward zero marks to all those students.
5. Deadline for this assignment is September 17, 2015. This deadline will not be extended.
Question # 1
For EVEN Roll Number Group
Q1. What is flowchart?
Q2 Draw a flowchart of the logical steps needed to print the name and age of the oldest and the youngest student in a class. The input records contain the name and age of the students. Assume a sentinel value of 99 for the age field of the trailer record.
Q3. Input Data regarding the information of employees of a company has been supplied. The first field of each input record contains the employee number (EmployeeNo). Assume that the input data of all the employees is terminated by a trailer record having a sentinel value of 99999 for EmployeeNo. Draw a flowchart for the logic to count and print the total number of input records, that is, the total number of employees.
Q4. A population survey has been carried out in a given city, and the information received from the survey has been stored in computer, one record per citizen. That is, each record contains the name, address, sex, age, profession, etc… of one citizen. We want to print the details of all the adults (aged 18 years or more) Finally we also want to print the total number of adults. Assume a suitable sentinel value for any field in the trailer record, and draw a flow chart for the algorithm to do this task.
Q5. Each paper in a set of examination papers includes a grade of A, B, C, D or E. A count is to be made of how many papers have the grade of A, and how many have the grade E. The total count of both types have to be printed at the end. Prepare a flowchart to perform this task. Assume a suitable sentinel value for the trailer record.
Q6. An employer plans to pay bonus to each employee. Those earning Rs. 2000 or above are to be paid 10 percent of their salary and those earning less than Rs. 2000 are to be paid Rs.200. The input records contain the employee number, name, and salary of the employees. The output to be printed should contain the employee number, name and the amount of bonus to be paid to each employee. Draw a flowchart for the algorithm to do this job. Assume a suitable sentinel value for any of the fields of the trailer record.
Q7. A data file contains a set of examination scores and is followed by a trailer record with a value of -1. Draw a flowchart for the logic to calculate and print the average of the scores.
Q8. Five numbers denoted by the variables A, B, C, D and E are supplied as input. Draw a flowchart for the logic to print these numbers in descending order of magnitude.
Q9. Draw a flowchart for the logic to find out whether a given triangle ABC is isosceles. Assume that the angles of the triangle are supplied as input. Print the answer as yes or no.
Q10. Draw a flow chart for the logic to find out whether a given quadrilateral ABCD is a rectangle. Assume that all the four angles and four sides of the quadrilateral are supplied as input data. Print the answer as yes or no.
Q11. Draw a flow chart for the logic to convert a number to decimal from another base.

For ODD Roll Number Group
Q1. How does a flowchart help a programmer in a program development?
Q2. Draw a flowchart of the logical steps needed to produce a printed listing of all students over the age of 20 in a class. The input records contain the name and age of the students. Assume a sentinel value of 99 for the age field of the trailer record.
Q3. The first 20 records in a data set are to be read and printed. Draw a flowchart for the algorithm to do this job. Make sure that the processing stops after the twentieth record.
Q4. For the employees problem of Question 40 ( even group Q3), we want to count and print the number of only male employees in the age group of 25 to 30. Assume that the input records contain SexCode and Age fields to provide this information. Draw a flowchart for the algorithm to perform this job.
Q5. A set of examination papers, which have been graded with scores form 0 to 100 is to be searched to find how many of them are above 90. The total has to be printed. Prepare a flowchart to do this job. Assume a suitable sentinel value for the trailer record.
Q6. A shopkeeper wants to have a general program for his personal computer, which will prepare bills for each customer as and when he sells goods to them. His idea is that as soon as the customer purchases some goods from his shop, he will supply the description, unit price, and the quantity purchased for each item. as input to the computer. He wants that with this information, the computer should print each item along with its unit price, quantity purchased and the total price. Finally the computer should also print the total cost of all the items purchased by the customer. Assuming a sentinel value of zero for the quantity purchased field in the trailer record, draw a flowchart for the logic to do this job.
Q7. Each employee pay record includes the hours worked and the pay rate. The gross pay is to be determined as hours worked times pay rate, and is to be printed for each employee. For all hours worked in excess of 40, the overtime rate, which is 1.5 times the regular rate, is to be paid. Draw a flowchart for the problem logic to do this. Assume a suitable sentinel value for any of the input fields of the trailer record.
Q8. The data file of Question 48 (even group Q7) is expanded to include several sets of data, each requiring calculation of its average. Each data set is followed by a trailer record with a value of -1; however the last data is followed by a trailer record with a value of -2. Draw a flowchart for the logic to perform this task.
Q9. Draw a flow chart to add up all the even numbers between 0 and 100. Before ending, print the result of calculation.
Q10. Draw a flowchart for the logic to find out whether a given triangle ABC is a right angled triangle. Assume that the sides are supplied as input and data. Print the answer as yes or no.
Q11. Draw a flowchart for the logic to convert a number from base 10 to new base using division remainder technique.
Question # 2 (For all students)
a) Determine which characteristics of an algorithm the following procedures have and which they lack.
Procedure 1 double(n:positive integer)
// The purpose of this procedure is to double a positive integer while n > =0 do n 2n
Procedure 2 choose(a, b: integers)
// The purpose of this procedure is to choose a number from two positive numbers x either a or b

Procedure 3 sum(n:positive integer)
// The purpose of this procedure is to find the sum of first 9 digits.

sum = 0 while i < 10 do sum sum + i
1. Procedure 4 divide(n:positive integer) // The purpose of this procedure is to find the reciprocal of a positive integer n till 1.

while n>= 0 do m 1/n n n-1
b) Modify above procedure so that they satisfies all the properties
Question # 3 (For all students)
a) Find gcd(31415, 14142) by applying Euclid’s algorithm.
b) Estimate how many times faster it will be to find gcd(31415, 14142) by Euclid’s algorithm compared with the algorithm based on checking consecutive integers from min{m, n} down to gcd(m, n).[no formal analysis required e.g. big Oh]
Question # 5 (For all students)
a) What is the smallest number of divisions made by Euclid’s algorithm among all inputs 1 ≤ m, n ≤ 10?
b) What is the largest number of divisions made by Euclid’s algorithm among all inputs 1 ≤ m, n ≤ 10?
Question # 6 (For all students)
Euclid’s algorithm, as presented in Euclid’s treatise, uses subtractions rather than integer divisions. Write a pseudocode for this version of Euclid’s algorithm.
Question # 7 (For all students)
Write a pseudocode for an algorithm for finding real roots of equation ax2 + bx + c = 0 for arbitrary real coefficients a, b, and c. [You may assume the availability of the square root function sqrt(x).]

A Word to the Student

Tell me and I will forget.
Show me and I will remember.
Involve me and I will understand
Confucius
A few suggestions for learning “Design and Analysis of Algorithm.

Read a few sections before each class (course outline is uploaded; you can see the section that is to be taught in class). You might not fully understand the material, but you’ll follow it far better when your instructor discusses it in class. In addition, you will be able to ask more questions in class and answer more questions.
Whenever you study the book, make sure you have a pencil and enough paper to write down definitions, theorems, and proofs, and to do the exercises.
Return to review the material taught in class later in the same day. Read actively; do not just read as if it was a novel or a newspaper. Write down the definitions, theorems, and properties in your own words, without looking in your notes or the book. Good note taking and writing aid retention. Re-write the examples, proofs, and exercise done in class, all in your own words. If you find them to challenging, study them again and try again; continue until you succeed.
Always study the relevant section in the text and do the examples there; then do the exercise at the end of the section. Don’t skip steps or write over previous step; this way you will progress logically, and you can locate and correct your errors. If you can’t solve a problem because it involves a new term, formula, or some property, then re study the relevant portion of the section and try again. Don’t assume that you will be able to do every problem the first time you try it. Remember, practice is the only way to success.
A Final Word Algorithm is no more difficult than any other subject. If you have the motivation ( for motivation we will see how algorithm solve our daily life problems), and patience to learn and do the work, then you will enjoy the beauty and power of algorithm; you will see that designing an algorithm is really fun.
Keep in mind that learning algorithm is a step by step process. Practice regularly and systematically; review earlier chapter/topics every week, since things must be fresh in your mind to apply and build on them. In this way, you will enjoy the subject, feel confident, and to explore more. The name of the game is practice, so practice, practice, practice.

*************************GOOD LUCK *************************

You May Also Find These Documents Helpful

  • Good Essays

    Week 1 Lab_ CIS_115

    • 439 Words
    • 2 Pages

    Use MS Visio to create a flowchart. Paste the flowchart here, or attach it as a separate document. Use the same valid variable names you used in Step 1.…

    • 439 Words
    • 2 Pages
    Good Essays
  • Good Essays

    CIS115 W2 Exercise

    • 757 Words
    • 10 Pages

    5) Use MS Visio to create a flowchart. Paste the flowchart here or attach it as a separate document. Use the same valid variable names you used in Step 1.…

    • 757 Words
    • 10 Pages
    Good Essays
  • Satisfactory Essays

    Write a 700- to 1,400-word paper in which you describe at least three problem analysis tools that you applied to develop the process flowchart.…

    • 367 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Write a 700- to 1,400-word paper in which you describe at least three problem analysis tools that you applied to develop the process flowchart.…

    • 445 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    Assignment 1

    • 872 Words
    • 4 Pages

    The IP addresses defined in a DHCP scope must be contiguous and are associated with a subnet mask. If the addresses you want to assign are not contiguous, you must create a scope encompassing all the addresses you want to assign and then exclude specific addresses or address ranges from the scope. So just be sure to check how you have your DHCP…

    • 872 Words
    • 4 Pages
    Good Essays
  • Better Essays

    Assignment 1

    • 6548 Words
    • 27 Pages

    You will notice that you need to look in different course books for some of the information and not all unit evidence correspond to the matching unit number…

    • 6548 Words
    • 27 Pages
    Better Essays
  • Satisfactory Essays

    Assignment 1

    • 352 Words
    • 3 Pages

    2. Use the table below to describe some of the different types and styles of documents that are produced in a business environment, and then explain when these different options may be used.…

    • 352 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    Assignment 1

    • 883 Words
    • 4 Pages

    Up to the age of 3 months a baby will only be able to lie on its back. At around 3 months baby will start lifting their head and kicking their legs vigorously, they will also recognise the face of their main carer as well as bright lights and loud noises. As time passes they will be able to hold objects and transfer them from hand to hand, they will also attempt to put things in their mouth. Mobility usually sets in around 9-12 months. They will be able to sit unaided and will get around by either rolling, crawling, shuffling or possibly walking unaided. They will also have learnt how to throw objects. At 1 year although mobile they will still find balancing difficult but most children of this age will be able to kneel without support and climb stairs with supervision. At 2 years children will be able to walk, run and kick and throw a ball although they may not be confident at catching.…

    • 883 Words
    • 4 Pages
    Good Essays
  • Powerful Essays

    Assignment 1

    • 1144 Words
    • 5 Pages

    This assignment is based on personality and communication. This assignment discusses my personality type through self reflection and working style. I also will be discussing key communication techniques I use throughout my life. As well as my communication style. This is a summary of who I am and how I communicate with the world around me on a daily basis.…

    • 1144 Words
    • 5 Pages
    Powerful Essays
  • Powerful Essays

    assignment 1

    • 1442 Words
    • 6 Pages

    1. Describe two examples of important things that financial planning skills can help you do, and explain why these things are important to you personally. (4-6 sentences. 2.0 points)…

    • 1442 Words
    • 6 Pages
    Powerful Essays
  • Better Essays

    Assignment 1

    • 1535 Words
    • 7 Pages

    Despite the fact that United States is the most affluent country in the world, a significant portion of its citizens have inadequate access to medical care. The barriers to obtaining health care are numerous; perhaps the most difficult hurdle to overcome is the lack of financial resources to pay for it. But the problem of lack of access to health cares for large segments of the population. The largest barrier to obtaining needed care is the lack of financial means to obtain it. The uninsured the underinsured cannot be stereotyped for they include many people who are employed, the elderly, children, minorities, person with handicaps, pregnant women, and other vulnerable populations. A lack of insurance does not translate in some cases to a lack of access to medical care, but it does have a clear impact upon access of health care.…

    • 1535 Words
    • 7 Pages
    Better Essays
  • Powerful Essays

    finance paper

    • 2682 Words
    • 10 Pages

    A Flow chart is created to analyze the situation and then the data of arrival time of patients is plotted in a graph…

    • 2682 Words
    • 10 Pages
    Powerful Essays
  • Good Essays

    The last couple of years I have had the task making sure my children are dressed and on time for school. This task is a process performed weekdays during the school year. This task can be time-consuming if the appropriate processes are not performed. Using a flowchart design, I will be able to analyze daily task of making sure my children are dressed and on time for school. By creating a flowchart for this process, it will increase the awareness and reveal issues that can improve the time spent performing the task. This analysis will reveal what needs to be overcome or changed to improve the performance of the task. According to Wiesenfelder (2009) “A standard activity flowchart will provide information about potential bottlenecks, delays, and other common sources of inefficiency and error” (para. 5). This flowchart design will help make this process more efficient where time can be saved.…

    • 558 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    FINITENESS  If we trace out the instructions of an algorithm, then for all cases, the algorithm terminates after a finite number of steps.…

    • 738 Words
    • 3 Pages
    Satisfactory Essays
  • Best Essays

    In this moment we would like to thank Mrs. Hemalatha A/P Ramalingam as our lecturer, for all her time, guidance and invaluable advice. Her patience, understanding and insight were a great source of inspiration to us. Her interactive, interesting and novel methods of teaching were helpful and encouraged us to think differently and creatively. We would also like to thank our parents for their guidance, motivation and assistance given throughout this assignment.…

    • 2168 Words
    • 9 Pages
    Best Essays

Related Topics