User interface design or user interface engineering is the design of user interfaces for machines and software, such as computers, home appliances, mobile devices, and other electronic devices, with the focus on maximizing usability and the user experience.
Benifits of User Interface Design :-
1. Increase customer acquisition and loyalty :-
2. Maximize revenue generation opportunities :-
3.Optimize resources, development time and costs :-
4. Get more insights from user engagement :-
5. Reduce troubleshooting and associated costs :-
Input Specification:
output Specification :
Example 1:
Explanation:
Integers 1 and 3 are co-prime to 4, but 2 is not.
Example 2:
Explanation:
Integers 1,3,5,7,9,11,13 and 15are co-prime to 16.
Answer are :
x = int(input(""));
count1=int(1);
res =1;
count2=count1;
while count1!=x:
res = count1 % 2;
if res!=0:
count2=count2+1;
count1=count1+1
print(count2-1)
1. SURVEYING:
It is the art of determining the relative position of points on the earth’s surface by measuring
the horizontal between them. Levelling is the process of determining the position of points in
a vertical plane
Surveying are of two types
1) Geodetic survey: the survey in which the shape of the earth is taken in to account is called
geodetic surveying
2) Plane survey: the survey in which the shape (or) curvature of earth is not taken in to account
is called plane surveying
The scope of surveying and levelling are:
a) To prepare plan and map which help in project implementation (setting out the alignment
for a road or railway track or canal, deciding the location for a dam or airport or harbour)
b) To determine the dimensions and contours of any part of the earth surface
c) To establish boundaries of land
d) To measure the areas and volume of land
e) To select suitable site for an engineering project
f) To conduct engineering survey, topographical survey, military survey, mine survey,
geological survey, archaeological survey, hydro graphic survey, environmental survey etc..
The Knowledge of surveying is essential in many phases for every engineering project such as
buildings, roadways, railways, dams, bridges, tunnels, harbours, mines, water supply and
sanitation, pipe line laying, airports etc..
2. BUILDING MATERIALS:
Any engineering structure requires a wide range of materials known as building materials. The
building materials chosen should have such properties that are safe, economical, eco-friendly
and serviceable for the purpose for which they are used
The building materials can be broadly divided into following categories
a. Traditional materials: stones, timber, bricks, lime, cement, tar, bitumen, mortar, ferrous
and non-ferrous metals etc
b. Alternative building materials: mud blocks, concrete blocks, glass, aluminium, paint,
flyash etc.
c. Composite materials: RCC, fibre reinforced concrete, ferro-cement, composite laminated
doors, asbestos sheets, fibre reinforced glass etc.
3. CONSTRUCTION TECHNOLOGY:
As land cost is going up there is a demand for tall structures in urban areas, while in rural areas
need for low cost construction, one has to develop technology using locally available materials
Construction technology comprises of different techniques of construction for different
materials under site different condition. The study of construction machinery comes under its
purview. The management or organization of men (labour), material, method in relation to site,
money and time is the backbone of construction management. It involves almost every branch
of engineering, commerce and economics, for; its ultimate aim is to ‘achieve the desired
construction in the most economical way. A clear knowledge of following points is necessary
for reliable construction and its management.
a) Money, Materials, Machines, Manpower, Methodologies,
b) Maintenance, Modernization, Monitoring, Motivations,
c) Managements of all types.
4. GEO-TECHNICALENGINEERING (Soil Mechanics):
The load from the structure is to be safely transferred to soil, for this safe bearing capacity of
soil is to be properly assessed. This branch of study in civil engineering is called geotechnical
engineering, which deals with the study of the properties , behaviour and use of earth materials
(soil and rocks) in engineering works
Geotechnical engineering has much wider scope that:
a) It is concerned with the properties of earth materials
b) To investigate the soil and bed rocks below the structure and study the soil structure
interaction
c) To select the type of foundation earth works for particular structure
d) To design foundation of building, dams, retaining walls, bridges, road pavement, railway
lines etc.
e) To design foundation for underground structure like tunnels, power houses etc.
f) To design foundation for machines such as turbines, compressors etc. to transmit vibrations
to foundation soil
g) To study the effect of soil as a medium for blasts during mining, earthquake, landslides and
nuclear explosionsh) They include various types of foundations like shallow foundation, deep foundations. Pile
foundation, well foundation etc.
5. STRUCTURAL ENGINEERING :
A building or a bridge or a dam consists of various elements like foundations, columns, beams,
slabs etc. These components are always subjected to forces. Depending upon the materials
available the components of the building should be safely and economically designed. A
structural engineer is involved in such a designing activity
Scope of structural engineering:
a) The structural engineering plays a vital role in planning, designing and building the structure
b) The structural analysis and structural design are the components of structural engineering
c) The structural engineering should take the responsibility about the safety and serviceability
of the structure for its life time
d) The structural engineer should be prepared for to accept the natural calamities like
earthquake, wind, landslide etc. and provide remedial measures
6. HYDRAULICS ENGINEERING :
Water is an important need for all living beings, study of mechanics of water and its flow
characteristics is another important field in civil engineering and its known as hydraulics
Hydraulics mainly deals with the practical problems of flow of water. The concept of fluid
pressure, fluid statics, and flow pattern helps in engineering to design the structures like dams,
reservoirs, bridges, culverts, sewage system etc. this concept is also used for flow through
pipes, pumps, turbines, hydraulic machines etc. Hydroelectric power generation facilities are
also included under this aspect.
7. WATER RESOURCES AND IRRIGATION ENGINEERING :
Water is to be supplied to agricultural fields and for drinking purposes, hence suitable water
resources are to be identified and water is to be stored. Identifying, planning and building water
retaining structures like tanks and dams and carrying stored water to agricultural fields through
irrigation channels is known as water resources and irrigation engineering
Scope of water resources and irrigation engineering:
a) It facilitates to control, regulate and utilize water to serve wide variety of purposes
b) It gives scope for utilization of water in beneficial purpose by providing water supply,
irrigation, hydroelectric power development and navigational improvement
c) Water quality management
d) Scope for recreational use of water resourcese) To protect fish and wild life
f) India being an agricultural country, irrigation will definitely help in the overall development
of our country, citizen and improve the civilization
8. TRANSPORTATION ENGINEERING:
Transportation means the movement of the men and goods from one point to another. It is as
old as civilization
The Transportation system includes road ways, railways, airways and water ways, design,
construction and maintenance of railway lines, signal system are part of the transportation
engineering.
Scope of water resources and transportation engineering:
a) It contributes to the economic, industrial. Social and cultural development of any country
b) To optimise the transportation cost, maintenance and administrative overheads
c) Planning the transport process with respect to survey and analysis of existing condition and
forecasting the future condition
d) It involves accident study for safe and comfort transport system
e) For traffic performance and control
9. ENVIRONMENTAL ENGINEERING :
People in every village, town & city need potable water. The water available (surface water &
ground water) may not be fit for direct consumption. In such cases, the water should be purified
and then supplied to the public. For water purification, sedimentation tanks, filter beds, etc.
should be designed. If the treatment plants are for away from the town or city, suitable pipelines
for conveying water & distributing it should also be designed.
In a town or city, a part of the water supplied returns as sewage. This sewage should be
systematically collected and then disposed into the natural environment after providing suitable
treatment. The solid waste that is generated in a town or locality should be systematically
collected and disposed of suitably. Before disposal, segregation of materials should be done so
that any material can be recycled & we can conserve our natural resources.
Scope of environmental engineering:
a) The study of importance of protection and conservation of our environment
b) The proper distribution of water supply with water treatment facility
c) Solution of problems of environment sanitation with waste water treatmentd) The proper disposal of / recycle of waste water and solid waste
e) Adequate drainage of urban, rural and recreational areas
f) Control of air pollution and provide healthy environment to public
► We generate displays of filled convex polygons in four steps:
1. Define a fill pattern.
2. Invoke the polygon-fill routine.
3. Activate the polygon-fill feature of OpenGL.
4. Describe the polygons to be filled.
► A polygon fill pattern is displayed up to and including the polygon edges. Thus, there are no boundary lines around the fill region unless we specifically add them to the display.
➢ To fill the polygon with a pattern in OpenGL, we use a 32 × 32 bit mask.
➢ A value of 1 in the mask indicates that the corresponding pixel is to be set to the current color, and a 0 leaves the value of that frame-buffer position unchanged.
➢ The fill pattern is specified in unsigned bytes using the OpenGL data type Glubyte
→ GLubyte fillPattern [ ] = { 0xff, 0x00, 0xff, 0x00, ... };
➢ The bits must be specified starting with the bottom row of the pattern, and continuing up to the topmost row (32) of the pattern.
➢ This pattern is replicated across the entire area of the display window, starting at the lower-left window corner, and specified polygons are filled where the pattern overlaps those polygons
➢ Once we have set a mask, we can establish it as the current fill pattern with the function
glPolygonStipple (fillPattern);
➢ We need to enable the fill routines before we specify the vertices for the polygons that are to be filled with the current pattern
glEnable (GL_POLYGON_STIPPLE);
➢ Similarly, we turn off pattern filling with
glDisable (GL_POLYGON_STIPPLE);
Two commonly used algorithm :-
1> Odd - Even rule
2>The non - zero winding - number rule.
►1. Odd - Even rule :-
→Also called as odd parity rule or the even-odd rule.
→Draw a line from any position P to a distant point outside the coordinator extents of the closed polyline.
→Then we count the number of line- segments crossing along this line
→If the number of segments crossed by this line is odd, then P is considered to be an interior point, otherwise P is an exterior point.
→We can use this procedure , for example , to fill the interior region between 2 concentric circles or two concentric polygons with a specified colour.
►2. Non Zero Winding - Number rule :-
→This counts the number of times that boundary of an object "winds" around a particular point in the counter clockwise direction termed as winding number.
→Initialize the winding number to 0 and again imagining a line draw from any position P to a distant point beyond the co-ordinate extent of objects.
→The line we choose must not pass through any end point coordinates.
→As we Move along the line from positions P to the distant point, we count the number of object line segments that cross the reference line in each direction.
→We add 1 to the winding number Every time we interact a segment that crosses the line in the direction from right to left and we subtract 1 very time we interact segment that crosses from left to right.
→If the winding number is non - zero. P is considered to be an interior point, otherwise P is an exterior point.
► Reads characters in the source program and groups them into meaningful sequences called lexemes.
► Produces as output a token of the form <token_name, attribute_value> and passes it to the next phase syntax analysis.
► Token class - The symbol for this token to be used during syntax analysis.
► Attribute points to symbol table entry for this token.
► Role of lexical analyzer
-Remove comments & white spaces
-Macros expansion
-Read input characters from source program & group them into lexemes.
-Produce as output a source of tokens, interact with symbol table.
A generated analyzer is a software tool that automatically constructs a lexical analyzer from a program in the lex language.
The lex compiler generates a transition table for a finite automaton from the regular expressions in the lex specification.
The lexical analyzer consists of finite automaton simulator that uses the transition table to look for the regular expression patterns in the input buffer.
There are two ways, you can handle reserved words that look like identifiers:
► Put the reserved words in a symbol table initially, with a field indicating that they’re not ordinary identifiers, and tells what tokens do they represent.
When we find an identifier, a call to installID() places it in the symbol table if it’s not already there, and returns a pointer to the symbol table entry for the lexeme found. Any identifier not in the table is recognized as an 'id’.
► Create separate transition diagrams for each keyword, consisting of states representing the situation the keyword is to be detected.
The diagram consists of states representing each letter in the keyword, and check if the identifier has ended, with proper suffix detection. For e.g. 'then' should not be matched in 'thenextstep'.
Transition diagrams depict the actions that take place when a lexical analyzer is called by the parser to get the next token.
We can use a transition diagram to keep track of information about the characters that are seen as the forward pointer scans the input. We do so by moving position to position in the diagrams as the characters are read.

We often have to look one or more characters beyond the next lexeme, before we can be sure that we have the right lexeme.
For example, the symbols '<' or '=' could be the beginning of '<<', '<=', ==', etc.
Hence we need two buffer schemes to handle the large lookahead safely. The buffer pairs consist of a lexeme begin pointer (lbp) and a forward pointer (fp).
The lexeme begin pointer marks the beginning of the current lexeme, and the forward pointer scans ahead until a pattern match is found.
This concept is called Input Buffering.
When using a single buffer scheme, if the end of the current file/block is reached before the expression ends, the lexical analyzer might return an unexpected token.
For example, for input string E = M * C ** 2
... | ... | E | = | M | * | C | * | EOF | ... | ... |
lbp ↑ | fp ↑ |
When EOF is reached in the middle of the expression, the lexical analyzer emits '*' as a token; reloads the input buffer, emits the next '*' as another token.
Two '*'s are returned instead of '**', hence invalidating the expression.
This drawback is overcome by using two buffer schemes.
... | E | = | M | * | C | * | EOF | ... |
lbp ↑ |
... | * | 2 | EOF | ... |
fp ↑ |
When we use two buffers, when the input ends prematurely, the other buffer is loaded with the next file’s contents. Hence, the forward pointer moves to the next file to process the continuing input. The lexical analyzer hence emits '**' as the token.
Jump to Page : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53