Monday, September 6, 2010

IGNOU BCA CS-63 Assignment 2010

Course Code : CS-63

Course Title : Introduction to System Software

Assignment Number : BCA(3)-63/Assignment/2010

Maximum Marks : 25

Last Date of Submission : 30th April, 2010 (For January Session)

30th October, 2010 (For July Session)

There are six questions in this Assignment. Answer all the questions. You may use illustrations and diagrams to enhance explanation.

IGNOU BCA CS-63 Assignment 2010

( Solution below )

Question 1: Find out the reasons those have made the UNIX an amazingly successful operating system. What are the Features on existing UNIX based operating systems like Linux Red Hat, Fedora and Ubantu Operating system. Also, compare them with Windows Vista. (6 Marks)

Question 2: Write a shell program to generate the first hundred numbers in the Fibonacci series (4 Marks)

Question 3: Design an algorithm that accepts an input a decimal number and converts it into BCD (Binary Coded Decimal) representation. Also, draw its Flow Chart.

(4 Marks)

Question 4: Consider the following set of processes that arrive in the ready queue at the same time:

Process CPU time

P1 2

P2 1

P3 4

P4 3

P5 1

P6 2

Consider the following scheduling algorithms: FCFS, SJF and Round Robin (quantum = 1)

What is turnaround time of each process for each of the above scheduling algorithms?

What is the waiting time of each process for each of the above algorithms? (3 Marks)

Question 5: Write a shell program to find the Greatest Common Divisor among the two positive non-zero integers given. (4 Marks)

Question 6: List the UNIX commands for the following: To search files for lines that match a particular string pattern given. To print the list of the currently logged-in users. To sort alphabetically, a list of numbers stored in a file. To count, number of words in a given text file. (4 Marks)

IGNOU BCA CS-63 Solved Assignment 2010

Answer 1 .#include

main()

{

int num,no_bits;

clrscr();

printf("enter a number");

scanf("%d",&num);

no_bits=count_bits(num);

printf("number of bits %d\t",no_bits);

bin_print(num,no_bits);

}

count_bits(int n) /* function to count number of bits */

{

int i=0;

for (;n!=0;n=n>>1)

i++;

return(i);

}

bin_print(int x, int n_bits)

/* function to print decimal numbers in binary format */

{

int j;

printf("no. %d in binary \t",x);

for(j=n_bits-1; j>=0;j--)

printf("%i",(x>>j) & 01);

}

Answer 2. In formal language theory, a context-free grammar (CFG) is a grammar in which every

production rule is of the form

V w

where V is a single nonterminal symbol, and w is a string of terminals and/or nonterminals

(possibly empty).

Thus, the difference with arbitrary grammars is that the left hand side of a production rule is

always a single nonterminal symbol rather than a string of terminal and/or nonterminal symbols.

The term "context-free" expresses the fact that nonterminals are rewritten without regard to the

context in which they occur.

A formal language is context-free if some context-free grammar generates it. These languages

are exactly all languages that can be recognized by a non-deterministic pushdown automaton.

Context-free grammars play a central role in the description and design of programming

languages and compilers. They are also used for analyzing the syntax of natural languages.

Example 1

S › a

S › a S

S › b S

The terminals here are a and b, while the only non-terminal is S. The language described is all

nonempty strings of as and bs that end in a.

This grammar is regular: no rule has more than one nonterminal in its right-hand side, and each

of these nonterminals is at the same end of the right-hand side.

Every regular grammar corresponds directly to a nondeterministic finite automaton, so we know

that this is a regular language.

It is common to list all right-hand sides for the same left-hand side on the same line, using | to

separate them, like this:

S › a | aS | bS

Technically, this is the same grammar as above.

Example 2

In a context-free grammar, we can pair up characters the way we do with brackets. The simplest

example:

S › a S b

S › a b

This grammar generates the language , which is not regular.

The special character å stands for the empty string. By changing the above grammar to

S › aSb | å

we obtain a grammar generating the language instead. This differs only in

that it contains the empty string while the original grammar did not.

Example 3

Here is a context-free grammar for syntactically correct infix algebraic expressions in the

variables x, y and z:

S › x | y | z | S + S | S - S | S * S | S/S | (S)

This grammar can, for example, generate the string "( x + y ) * x - z * y / ( x + x )" as follows:

"S" is the initial string. "S - S" is the result of applying the fifth transformation [S › S - S] to the

nonterminal S. "S * S - S / S" is the result of applying the sixth transform to the first S and the

seventh one to the second S. "( S ) * S - S / ( S )" is the result of applying the final transform to

certain of the nonterminals. "( S + S ) * S - S * S / ( S + S )" is the result of the fourth and fifth

transforms to certain nonterminals. "( x + y ) * x - z * y / ( x + x )" is the final result, obtained by

using the first three transformations to turn the S non terminals into the terminals x, y, and z.

This grammar is ambiguous, meaning that one can generate the same string with more than one

parse tree. For example, "x + y * z" might have either the + or the * parsed first; presumably

these will produce different results. However, the language being described is not itself

ambiguous: a different, unambiguous grammar can be written for it.

Answer 3. Windows Vista is a line of operating systems developed by Microsoft for use on personal

computers, including home and business desktops, laptops, tablet PCs, and media center PCs.

Prior to its announcement on July 22, 2005, Windows Vista was known by its codename

"Longhorn." Development was completed on November 8, 2006; over the following three

months it was released in stages to computer hardware and software manufacturers, business

customers, and retail channels. On January 30, 2007, it was released worldwide, and was made

available for purchase and download from Microsoft's website. The release of Windows Vista

came more than five years after the introduction of its predecessor, Windows XP, the longest

time span between successive releases of Microsoft Windows desktop operating systems. It was

succeeded by Windows 7 which was released to manufacturing on July 22, 2009 and is

scheduled for general availability on October 22, 2009.

Windows Vista contains many changes and new features, including an updated graphical user

interface and visual style dubbed Windows Aero, a redesigned search function, multimedia

tools including Windows DVD Maker, and redesigned networking, audio, print, and display

sub-systems. Vista aims to increase the level of communication between machines on a home

network, using peer-to-peer technology to simplify sharing files and digital media between

computers and devices. Windows Vista includes version 3.0 of the .NET Framework, allowing

software developers to write applications without traditional Windows APIs.

Microsoft's primary stated objective with Windows Vista has been to improve the state of

security in the Windows operating system. One common criticism of Windows XP and its

predecessors is their commonly exploited security vulnerabilities and overall susceptibility to

malware, viruses and buffer overflows. In light of this, Microsoft chairman Bill Gates

announced in early 2002 a company-wide " Trustworthy Computing initiative" which aims to

incorporate security work into every aspect of software development at the company. Microsoft

stated that it prioritized improving the security of Windows XP and Windows Server 2003

above finishing Windows Vista, thus delaying its completion.

While these new features and security improvements have garnered positive reviews, Vista has

also been the target of much criticism and negative press. Criticism of Windows Vista has

targeted its high system requirements, its more restrictive licensing terms, the inclusion of a

number of new digital rights management technologies aimed at restricting the copying of

protected digital media, lack of compatibility with some pre-Vista hardware and software, and

the number of authorization prompts for User Account Control. As a result of these and other

issues, Windows Vista had seen initial adoption and satisfaction rates lower than Windows XP.

However, with an estimated 330 million internet users as of January 2009, it has been announced

that Vista usage had surpassed Microsoft’s pre-launch two-year-out expectations of achieving

200 million users. As of the end of August 2009, Windows Vista (with approximately 380

million internet users) is the second most widely used operating system on the internet with an

approx. 23% market share, the most widely used being Windows XP with an approx. 69%

market share.

End-user

Windows Explorer in Windows Vista

Windows Aero: The new hardware-based graphical user interface is named Windows

Aero, which Jim Allchin stated is an acronym for Authentic, Energetic, Reflective, and

Open. The new interface is intended to be cleaner and more aesthetically pleasing than

those of previous Windows versions, including new transparencies, live thumbnails, live

icons, and animations, thus providing a new level of eye candy. Laptop users report,

however, that battery life is shortened with the feature enabled.

Windows Shell: The new Windows shell is significantly different from Windows XP,

offering a new range of organization, navigation, and search capabilities. Windows

Explorer's task pane has been removed, integrating the relevant task options into the

toolbar. A "Favorite links" pane has been added, enabling one-click access to common

directories. The address bar has been replaced with a breadcrumb navigation system. The

preview pane allows users to see thumbnails of various files and view the contents of

documents. The details pane shows information such as file size and type, and allows

viewing and editing of embedded tags in supported file formats. The Start menu has

changed as well; it no longer uses ever-expanding boxes when navigating through

Programs. The word "Start" itself has been removed in favor of a blue Windows Pearl.

Instant Search (also known as search as you type) : Windows Vista features a new way

of searching called Instant Search, which is significantly faster and more in-depth

(content-based) than the search features found in any of the previous versions of

Windows.

Windows Sidebar: A transparent panel anchored to the side of the screen where a user

can place Desktop Gadgets, which are small applets designed for a specialized purpose

(such as displaying the weather or sports scores). Gadgets can also be placed on other

parts of the desktop.

Windows Internet Explorer 7: New user interface, tabbed browsing, RSS, a search

box, improved printing, [21] Page Zoom, Quick Tabs (thumbnails of all open tabs), Anti-

Phishing filter, a number of new security protection features, Internationalized Domain

Name support (IDN), and improved web standards support. IE7 in Windows Vista runs in

isolation from other applications in the operating system (protected mode); exploits and

malicious software are restricted from writing to any location beyond Temporary Internet

Files without explicit user consent.

Windows Media Player 11, a major revamp of Microsoft's program for playing and

organizing music and video. New features in this version include word wheeling (or

"search as you type"), a new GUI for the media library, photo display and organization,

the ability to share music libraries over a network with other Windows Vista machines,

Xbox 360 integration, and support for other Media Center Extenders.

Backup and Restore Center: Includes a backup and restore application that gives users

the ability to schedule periodic backups of files on their computer, as well as recovery

from previous backups. Backups are incremental, storing only the changes each time,

minimizing disk usage. It also features Complete PC Backup (available only in Ultimate,

Business, and Enterprise versions) which backs up an entire computer as an image onto a

hard disk or DVD. Complete PC Backup can automatically recreate a machine setup onto

new hardware or hard disk in case of any hardware failures. Complete PC Restore can be

initiated from within Windows Vista or from the Windows Vista installation CD in the

event the PC is so corrupt that it cannot start up normally from the hard disk.

Windows Mail: A replacement for Outlook Express that includes a new mail store that

improves stability, and features integrated Instant Search. It has the Phishing Filter like

IE7 and Junk mail filtering that is enhanced through regular updates via Windows

Update.

Windows Calendar is a new calendar and task application.

Windows Photo Gallery, a photo and movie library management application. It can

import from digital cameras, tag and rate individual items, adjust colors and exposure,

create and display slideshows (with pan and fade effects) and burn slideshows to DVD.

Windows DVD Maker, a companion program to Windows Movie Maker that provides

the ability to create video DVDs based on a user's content. Users can design a DVD with

title, menu, video, soundtrack, pan and zoom motion effects on pictures or slides.

Windows Media Center, which was previously exclusively bundled in a separate

version of Windows XP, known as Windows XP Media Center Edition, has been

incorporated into the Home Premium and Ultimate editions of Windows Vista.

Games and Games Explorer: Games included with Windows have been modified to

showcase Vista's graphics capabilities. New games are Chess Titans, Mahjong Titans

and Purble Place. A new Games Explorer special folder contains shortcuts and

information to all games on the user's computer.

Answer 4. echo Enter a number

read no

i=1

ans=0

while [ $i -le 'expr $no / 2' ]

do

if [ 'expr $no % $i' -eq 0 ]

then

ans='expr $ans + $i'

fi

i='expr $i + 1'

done

if [ $no -eq $ans ]

then

echo $no is perfect

else

echo $no is NOT perfect

=======================================================================================================================================================================================================================================

AKHILESH

System Admin

1 comment:

  1. This is a very helpful post. I read this post and found it very interesting. I will definitely use this information. Thanks for sharing your blog with us. You have some wonderful stories. This is an profile about spacebar clicker. You can take the test without registering. It displays how many times you have clicked the spacebar in a given period. This helps you improve spacebar speed.

    ReplyDelete