0% found this document useful (0 votes)
4 views7 pages

Software Construction Assignment Guide

This document is an assignment for a Software Construction module at the Bachelor degree level, submitted by student H.B.C. Virajini. It includes instructions for completion, a declaration of originality, and answers to four questions covering topics such as programming languages, concurrency, and parsing techniques. References are provided from various reliable sources, including educational institutions and online platforms.

Uploaded by

chamovo99
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views7 pages

Software Construction Assignment Guide

This document is an assignment for a Software Construction module at the Bachelor degree level, submitted by student H.B.C. Virajini. It includes instructions for completion, a declaration of originality, and answers to four questions covering topics such as programming languages, concurrency, and parsing techniques. References are provided from various reliable sources, including educational institutions and online platforms.

Uploaded by

chamovo99
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

ASSIGNMENT

MODULE NAME : SOFTWARE CONSTRUCTION

LEVEL : BACHELOR DEGREE

STUDENT’S NAME : [Link]

EXAMINATION NO. : 53399

PROGRAMME : BICT

LEARNING CENTRE : BMI Campus , Kandy , Sri Lanka

INSTRUCTIONS TO STUDENT

1) Please answer ALL questions.


2) Plagiarism in all forms is forbidden. Students who submit plagiarised assignment will be
penalised.
3) References MUST be included and taken from reliable sources. Please use the
APA Referencing Style and cite your work appropriately.
4) Repeat fee per module Rs. 2,000/-

THERE ARE Type Page Numbers PAGES, EXCLUDING THIS PAGE.

DECLARATION BY STUDENT

I certify that this assignment is my own work and is in my own words. All sources have been
acknowledged and the content has not been previously submitted for assessment to Asia e University
or elsewhere. I also confirm that I have kept a copy of this assignment.

Signed: chamodra
Page |1

Contents

Question 1......................................................................................................................................2

Question 2......................................................................................................................................3

Question 3......................................................................................................................................4

Question 4......................................................................................................................................5

References......................................................................................................................................6
Page |2

Question 1
a)

i. System programming
ii. Application development

b)

If I as an IT manager I would like to propose to the CEO JavaScript. Because it’s well suited for
web based development and it has a strong community support. And also I would like to
propose CEO that using the java script for the development for the e-learning system.

Here is the reason I recommended JavaScript for developing the e-learning system.
The JavaScript is a famous programming language between developers. This language is widely
used for front end web development.
JavaScript has a robust set of libraries, much more user friendly than other languages and also
frameworks. It is such as angular and react and easy to build complex web application.
The JavaScript is also supported by modern technology and browsers.

Here are some more specific uses of JavaScript in web development

 Browser games
 Web applications
 Front end interactivity
 Back end web development

Finally think that JavaScript would be suitable for developing a web based e-learning system.
Page |3

Question 2

“Concurrency is the tendency for things to happen at the same time in a system. Concurrency is
a natural phenomenon, of course. In the real world, at any given time, many things are
happening simultaneously. When we design software to monitor and control real world systems,
we must deal with this natural concurrency. ”

There are several mechanisms that can be used to support concurrency in a system.

Here are three common ones with expiation.

 Threads
a thread is lightweight process that share the same memory space as its parent process. Also
multiple threads can run concurrently with a process and each with own thread of control.
The threads are also can communicate with in the parent process using IPC mechanisms.

 Process
The process is an instance of a [Link] has own memory and own thread of control multiple
processes can also run concurrently on the system and own resources and own memory space.
Literally processes can communicate with other using inter process communication mechanisms
such as socket, pipes and maybe shared memory.

 Synchronization primitives

Multiple threads may accesses shared resources such as memory or files in a concurrent system.
Such as prevent data races or other synchronization issues, primitives can be use monitors,
semaphores or lock. These are only one process or thread access to share resource at a time,
ensuring data integrity and preventing conflicts.

.
Page |4

Question 3

c) The “isKeyword() ” method take a string as checks if the string is a C keyword or not. It
does comparing the input string with the pre-defined list of C keywords. If the input
string matches with any of the keywords, it returns1, else it returns 0.

b) Output of the program when syntax in the file named “ [Link]”

The program will read the file character by character and identifies the identifiers, keywords
and also operators present in the file. In this case, the program will identify keywords,
identifiers and operators like this.

keywords identifiers operators


void Main (
x )
int y {
z }
char g ,
‘A’ ;
=
Page |5

Question 4
a)

T E’

T
F +

id T’

F *

id F

id

b)

($ is represents the end of the input string.)

FIRST FLLOW
(E) = {(,id} (E) = {$,)}
(E) = {+, } (E) = {$,}
(T) = {(,id} (T) = {+,$,)}
(T) = {*,} (T) = {+,$,)}
(T) = {(,id} (T) = {*,+,$,)}
Page |6

References

1. BMI campus, sri lanka, software construction , kandy sri lanka (2023)

2. Geeksforgeeks
[Link]

3. Javapoint
[Link]

4. Massachusetts institute of technology


[Link]

5. Engineering libre text


[Link]

6. Courser
[Link]

Common questions

Powered by AI

JavaScript is well-suited for web-based development due to its widespread use and strong community support. It is widely used for front-end development and has a robust set of libraries and frameworks such as Angular and React, making it user-friendly for building complex web applications. Additionally, JavaScript is compatible with modern technologies and browsers, allowing for diverse applications including browser games, web applications, front-end interactivity, and back-end web development. This versatility makes it a suitable choice for developing a web-based e-learning system .

Reading a file character by character for identifying code syntax is crucial in programming language analysis as it allows precise control over the parsing process. This method helps in accurately distinguishing between various syntax elements like keywords, operators, and identifiers, by examining their sequential arrangement in the source code. It ensures that even minor variations in syntax, which might affect program execution or interpretation, are correctly identified and categorized. Such detailed analysis is essential for developing compilers or interpreters where syntax precision is critical .

Managing concurrency presents challenges such as data races, deadlocks, and resource contention. Data races occur when multiple threads access shared data simultaneously without proper synchronization, leading to inconsistent data. Deadlocks happen when processes are stuck waiting for resources held by each other, preventing further progress. These challenges can be mitigated through careful use of synchronization primitives like locks, semaphores, and monitors, which manage resource access and ensure exclusive data handling. Properly designing processes and threads to minimize dependencies also helps in overcoming these issues .

Concurrency in software systems is supported through several mechanisms. Threads are lightweight processes that share memory with their parent process and can run concurrently while communicating via inter-process communication (IPC) mechanisms. Processes are program instances with their own memory and control thread, capable of running concurrently while communicating with each other through methods like sockets, pipes, and shared memory. Synchronization primitives like monitors, semaphores, or locks are used to control access to shared resources, ensuring data integrity and preventing race conditions by allowing only one thread or process to access a resource at a time .

An application can determine if a string is a C language keyword by implementing a method like "isKeyword()". This method compares the input string with a predefined list of C keywords. If the input string matches any of these keywords, the method returns a value of 1, indicating that it is a keyword. If there is no match, it returns 0, signifying that the string is not a C keyword .

The construction of a predictive parser involves using two key sets known as FIRST and FOLLOW. The FIRST set determines what terminal symbols can begin strings derived from a non-terminal, while the FOLLOW set indicates what terminal symbols can appear immediately to the right of a non-terminal in some sentential form. These sets are fundamental in the design of parsers to predict which production rule to use. The rows in the document show these sets for various non-terminals such as E and T, defining parsing choices in a grammar where parentheses and operator precedence must be respected .

The software program described reads the file character by character to identify different components such as keywords, identifiers, and operators. It performs syntax analysis to categorize each element it encounters in the file. For example, it recognizes keywords like 'void' or 'int', identifies identifiers such as variables or function names, and detects operators like '=', ';' among others. The output will specifically list these components as they are found within the file, allowing for further processing or analysis .

The document outlines strategies to promote original work including enforcing strict penalties for plagiarism, requiring students to declare the originality of their assignments, and mandating the use of APA Referencing Style for citing sources. These measures encourage students to engage with materials critically and ethically, fostering a culture of integrity and responsibility in their academic pursuits. By demanding proper citation and self-certification of originality, students are prompted to develop their own insights and avoid depending on deceitful practices .

The instructions to students strongly emphasize the prohibition of plagiarism in all forms, detailing that any assignments found to be plagiarized will result in penalties. Students are required to certify that their submissions are their own work and to include references from reliable sources using the APA Referencing Style. This not only prevents academic dishonesty but also ensures that students are properly crediting sourced information .

Concurrent programming facilitates simultaneous task execution by using constructs like threads and processes. A thread, sharing memory space with its parent, can run concurrently and communicate via IPC mechanisms. Multiple processes, each with its own resources and memory, also run concurrently and interact through IPC mechanisms like sockets and shared memory. Synchronization primitives such as monitors and locks manage access to shared resources, ensuring tasks execute without conflicts, providing efficiency and responsiveness in software applications .

You might also like