Lesson-1

Algorithm

Use of algorithm in programming

Developing algorithm to solve particular problem

In mathematics and computer science, an algorithm is a step-by-step procedure for calculations. Algorithms are used for calculation, data processing, and automated reasoning. Algorithms resemble recipes. Recipes tell you how to accomplish a task by performing a number of steps.

For example, to bake a cake the steps are: preheat the oven; mix flour, sugar, and eggs thoroughly; pour into a baking pan; and so forth.

Goals of Algorithm Study

·  To develop framework for instructing computer to perform tasks

·  To introduce notion of algorithm as means of specifying how to solve a problem

·  To introduce and appreciate approaches for defining and solving very complex tasks in terms of simpler tasks;

Simple Questions based on Algorithm

Algorithm:Calling a friend on the telephone

Input:The telephone number of your friend.

Output:None

Steps:

1.  Pick up the phone and listen for a dial tone

2.  Press each digit of the phone number on the phone

3.  If busy, hang up phone, wait 5 minutes, jump to step 2

4.  If no one answers, leave a message then hang up

5.  If no answering machine, hang up and wait 2 hours, then jump to step 2

6.  Talk to friend

7.  Hang up phone

Algorithm to create Maggie noddle:

Step 1: Start

Step 2: Take pan with water

Step 3: Put pan on the burner

Step 4: Switch on the gas/burner

Step 5: Put magi and masala

Step 6: Give two minutes to boil

Step 7: Take off the pan

Step 8: Take out the magi with the help of fork/spoon

Step 9: Put the Maggi on the plate and serve it

Step 10: Stop.

Algorithm:To find (a + b)2=(a + b)* (a + b)

Input:Two numbers a and b.

Output:Result of (a + b)2

Steps:

1.  Take numbers a, b, c.

2.  Input the values of a and b

3.  C=a+b

4.  Print c*c

Algorithm:To find Perimeter of rectangle

Input:Two numbers l and b.

Output:Result l*b

Steps:

1.  Take numbers l, b, c, d.

2.  Input the values of l and b

3.  c=l*b

4.  d=2*c

5.  Print d

Conditions in Algorithm

Algorithm:To check whether a person can vote or not

Input:A number age.

Output:Yes or No

Steps:

1.  Take a number age.

2.  Input the age of the person

3.  If(age>=18) goto step 4

Else

Goto step 5

4.  Print “You can vote”

5.  Print “You can’t vote”

Algorithm:To give a bonus of Rs 1000 to those employees whose salary is more than Rs 5000

Input:Salary.

Output:New Salary

Steps:

1.  Take numbers salary and total.

2.  Input the salary of the person

3.  If(salary>=5000) goto step 4

Else

Goto step 5

4.  total=salary+1000

5.  total=salary+0

6.  Print total

SUMMARY

1.  An algorithm is a step-by-step procedure for calculations.

2.  To develop framework for instructing computer to perform tasks os one of the goal of

Algorithm.

EXERCISES

A.  Short Answer Question

1.  What is an algorithm?

2.  Write few goals of an algorithm.?

3.  Write an algorithm to find Area of square?

Lesson-2

Flow Char

About flow chart

A flowchart is a type of diagram that represents an algorithm or process, showing the steps as boxes of various kinds, and their order by connecting them with arrows. This diagrammatic representation illustrates a solution to a given problem.

Various types of box used in flow chart:

Question based on sequence, selection and iteration

Q 1. Draw a flowchart to find the sum of two numbers

Q 2. Draw a flowchart to find the simple interest.

Q 2. Draw a flowchart to find bigger number among two numbers (selective)

Q3. Draw a flow chart to find factorial of any number. (iteration)

SUMMARY

1.  A flowchart is a type of diagram that represents an algorithm or process, showing the

steps as boxes of various kinds, and their order by connecting them with arrows.

2.  Flowline symbol used to connect the symbols and indicate the flow of logic.

3.  Terminal symbol is used to represent the beginning (Start) or end (End) of task.

4.  Input/Output symbol used to represent reading or writing operations.

5.  Processing symbol used for arithmetic and data manipulation operations.

6.  Decision making symbol used to represent any logic and comparisons operations.

EXERCISES

1.  What is flowchart?

2.  What is the use of flowchart?

3.  Draw the flowchart for

a)  Find the addition of two number.

b)  Find whether a people eligible to give vote or not.

c)  Find given number even or odd.

d)  Find whether a people drive car or not.

Lesson-3

Photoshop Review

Review of Photoshop

An image editing software developed and manufactured by Adobe Systems Inc. Photoshop is considered one of the leaders in photo editing software. The software allows users to manipulate, crop, resize, and correct color on digital photos. The software is particularly popular amongst professional photographers and graphic designers.

Toolbox in detail

Marquee Tools: The Marquee tool selects a section of the document based on the shape of the chosen tool.

Move Tool: The Move tool moves items in the document, such as selections, layers, and guides.

Lasso Tools: The Lasso tools allow you to select a section of the document either by freehand, polygonal, or magnetic selections.

•  The Lasso tool will close the selection will close automatically when the mouse is unclicked.

•  The Polygonal Lasso tool and Magnetic Lasso tool need the ends of the selection to be joined for the section to become selected.

Magic Wand Tool: The Magic Wand tool selects areas of similar colors.

Crop Tool: The Crop tool trims images.

Healing Tools: The Healing tools fix up issues in the document such as blemishes and red eye.

•  The Spot Healing Brush removes blemishes and objects.

•  The Red Eye tool removes the red reflection caused by a flash.

Drawing Tools: The Drawing tools let you draw in your document.

•  The Brush tool paints brush strokes.

•  The Pencil tool paints hard-edged strokes.

•  The Color Replacement tool replaces a selected color with a new color.

Eraser Tools: The Eraser tools erases pixels in the document.

•  The Eraser tool will restore parts of an image to a

previously saved state or will display the background color.

•  The Background Eraser tool will turn the erased areas into a transparency.

•  The Magic Eraser tool will erase everything of the same color into a transparency.

Fill Tools: The Fill tools fill color into areas of the document.

•  The Paint Bucket tool fills in areas of similar color with the foreground color.

•  The Gradient Tool creates a smooth straight-line change from the foreground color to the background color.

Text Tools: The Type tools add text to a document.

•  The type tools create type on top of an image.

•  The type mask tools make a selection of the document in the shape of type.

Shape Tools: The Shape tools draw shapes and lines in a normal layer or a shape layer.

•  The Shape tools will create a solid color shape of their type.

•  The Line tool will create a solid color line.

•  The Custom Shape tool makes customized shapes selected from a custom shape list.

Color Picking and Measuring Tools: The Color Picking and Measuring tools do not actually change the document in any way.

•  The Eyedropper tool changes the foreground color to the color that is clicked on.

•  The Color Sampler tool is an advanced tool.

•  The Measure tool measures the distance, location, and angle between to points in the document.

Hand Tool: The Hand tool moves an image within its window.

Zoom Tool: The Zoom tool magnifies and reduces the view of an image.

SUMMARY

1.  Photoshop is considered one of the leaders in photo editing software.

2.  The Marquee tool selects a section of the document based on the shape of the chosen tool.

3.  The Move tool moves items in the document, such as selections, layers, and guides.

4.  The Magic Wand tool selects areas of similar colors.

5.  The Color Picking and Measuring tools do not actually change the document in any way.

6.  The Hand tool moves an image within its window.

7.  The Zoom tool magnifies and reduces the view of an image.

EXERCISES

A.  Fill in the blanks

i.  ______moves images within its window.

ii.  Shapes tool draw ______in a normal layer.

iii.  ______tool fill color into area.

iv.  ______lets you draw in your document.

B.  Find true or false

i.  Marquee tool moves item in the document.

ii.  The zoom tool magnifies and reduces the view of an image.

iii.  The color picking and measuring tools moves an image within its window.

iv.  Ms Paint is an example of Photoshop application.

C.  Short Answer Questions

i.  What is Photoshop?

ii.  Write the features of Photoshop.?

iii.  Write the use of

a)  Move tool.

b)  Drawing tool.

iv.  Write one advantage of zoom tool.

In the lab

1.  Crop image upto your suitable part of an image and save it.

2.  Insert text some quote on an image using Photoshop tools and save it.

3.  Cut some portion of image and use it in another image using Move tool.

Lesson-4

More on Photoshop

Drawing and type tools

The Drawing and Type tools create and alter vector objects. Drawing tools work on vector paths, which are vector-based outlines you can turn into selections. Using the Options bar, choose whether to draw paths or shape layers. Type is created in type layers that can be transformed, warped,

and even set along paths.

Pen(P)

·  Path Selection (A):Use this tool to move entire paths around the canvas as a single object. The path or shape layer retains its shape.

·  Direct Selection (A):Use this tool to select and move individual points and Bezier handles of a path or shape layer.

·  Pen (P):Create paths with the Pen tool (shown inSingle-click to create individual points to form the path. Click, hold, and drag to create a Bezier curve when drawing a path.

·  Freeform Pen (P):With this tool, click, hold, and draw a path. Points of the path are created automatically.

·  Add Anchor Point (P):Use this tool to click part of a path to add a point to the path. Adding an anchor point to your path or shape layer allows for more detail in the path or shape.

·  Delete Anchor Point (P):Use this tool to click a point of a path to remove that point from the path.

·  Convert Anchor Point (P):Single-click a point of a path to convert it to a corner point. Or click and drag to convert it to a curve point. Or Option-click (Mac users) or Alt-click (Windows users) and drag to convert it to a combination point.

Horizontal Type(T):

The Horizontal Type tool is the default Type tool. Click and drag to make a text box. Type your text with the keyboard to create text in the foreground color. Use the Options bar to set the font, size, and other text properties. Open the Character and or Paragraph palettes for more typography options.

·  Vertical Type (T):This tool is similar to the Horizontal Type tool except that the type stacks vertically, and the text direction goes from right to left for Asian languages.

·  Horizontal Type Mask (T):This tool is similar to the Horizontal Type tool, but a selection area is created rather than actual type. Although you can paint within the type selection area, adjusting the type options is not allowed after type is created.

·  Vertical Type Mask (T):This tool is similar to the Vertical Type tool, but a selection area is created rather than actual type. Although you can paint within the type selection area, adjusting the type options are not allowed after type is created.

Rectangle

There are quite a few predefined vector-based shapes in Adobe Photoshop, all of which can be easily added to graphics. There are 6 different kind ofShape Toolsin all.

·  Rectangle Tool –Creates a rectangle shape (or square if constraining proportions by holding shift).

·  Rounded Rectangle Tool– Creates a rectangle with rounded corners. The roundness of the corner can be controlled by setting a radius in the options bar.

·  Ellipse Tool- Creates an ellipse shape (or perfect circle if constraining proportions by holding shift).

·  Polygon Tool– Creates a polygon shape with a specified number of sides set in the options bar.

·  Line Tool– Creates a line shape.

·  Custom Shapes– Use predefined shapes (or user created ones) in your graphic.

To create a shape in your image, simply select the shape tool you want to use, adjust the settings for that tool in the options bar, and then drag our your shape in the active image area (in the same fashion you’d create a selection with one of the selection tools).

Working with Masks

Working with masks and channels

Photoshop masks isolate and protect parts of an image, just as masking tape protects window panes or trim from paint when a house is painted. When you create a mask based on a selection, the area you have not selected ismasked,or protected from editing. With masks, you can create and save time-consuming selections and then use them again. In addition, you can use masks for other complex editing tasks—for example, to apply color changes or filter effects to an image.

In Photoshop, you can make temporary masks, calledquick masks, or you can create permanent masks and store them as special grayscale channels calledalpha channels. Photoshop also uses channels to store an image’s color information. Unlike layers, channels do not print. You use the Channels panel to view and work with alpha channels.

Creating a quick mask

Quick Mask mode lets you edit any selection as a mask without using the Channels palette and while viewing your image. The advantage of editing your selection as a mask is that you can use almost any Photoshop tool or filter to modify the mask. For example, if you create a rectangular selection with the marquee tool, you can enter Quick Mask mode and use the paintbrush to extend or contract the selection.