NEWBIG (1)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 34

INDUSTRIAL TRAINING REPORT

ON
Web-Devlopment
AT
UNISOFT TECHNOLOGIES
Submitted in partial fulfilment of the requirements
for the award of degree of
Diploma
In
Computer Engineering
Submitted To Submitted By
Mrs. S. A. Wanjari Mr. Vaibhav Pachkore
(2201070041)

GH RAISONI COLLEGE OF ENGINEERING


AND MANAGEMENT
B-37-39/1, Shraddha Park, Hingna-Wadi Link Road, Nagpur-28
DECLARATION

I, VAIBHAV PACHKORE, Student of DIPLOMA(CO) declare that the project titled


“WORD GUESSING GAME ” which is submitted by me to Department of
computer science and engineering, G.H RAISONI COLLEGE OF ENGINEERING
AND MANAGMENT

Date: 15TH JULY 2024


VAIBHAV PACHKORE
ACKNOWLEDGEMENT

The successful completion of this project mark the beginning of an ever - going
learning experience of converting ideas and concepts into real life, practical
system. This project was a quite a learning experience for me at each and every
step. At the same time it has given me confidence to work in professional setup.
I feel the experience gained during the project will lead me to gain the bright
prospect in the future.With the deep sense of gratitude, I express my sincere thanks to
Mr. Arnab Banerjee, for his active support and continuous guidance without which
it would have been difficult for me to complete this project. I will also like to
the other working staff teachers at UNISOFT TECHNOLOGIES for taking keen
interest in my project and giving valuable suggestions and helping me directly or
indirectly to complete this project.

VAIBHAV
PACHKORE
02413302713
Diploma(CO)
CERTIFICATE
CONTENTS

DECLARATION 2
ACKNOWLEDGEMENT 3
CERTIFICATE 4
ABSTRACT 5
CONTENTS 6

1. INTRODUCTION

a. Organization Profile ....................................................................................................8


b. Introduction of Project ............................................................................................... 11
c. Problem Specification ................................................................................................. 12
d. Problem Definition ...................................................................................................... 12
e. Limitation of Existing System .................................................................................... 12
f. Objective of Project… .................................................................................................. 13

2. SYSTEM ANALYSIS

a. Feasible study… ........................................................................................................... 14


b. Introduction… .............................................................................................................. 14
c. Summary and Constraint… ........................................................................................ 14
d. Types of Feasible Study................................................................................................ 15
e. Hardware and Software Requirements… .................................................................. 17

3. DEVELPOMENT ENVIRONMENT

a. Introduction to Oracle Database…............................................................................. 18


b. Introduction to Java… ................................................................................................. 23
c. Introduction to NetBeans Ide 8.1 ................................................................................27

4. SYSTEM DESIGN

a. Modular Description… ............................................................................................... 31


5. IMPLEMENTATION AND TESTING

a. Testing… ...................................................................................................................... 33
b. Implementation and Screenshots… ............................................................................37

6. CONCLUSION… ................................................................................................................ 44

7. BIBLIOGRAPHY… ............................................................................................................ 45
INTRODUCTION

ORGANISATION PROFILE:

Unisoft education ventured in certification lead IT training since it’s inception on 14th
September 2000. Based out of Nagpur, during the initial years we were known as HAT
sellers (only of RED color) and a misplaced high end IT training institute. People found us
ahead of times and out of world.In last 23 years we have produced more than 40000 highly
successful IT professionals working with best known IT companies across the globe.

Research based innovation, consistent industry interaction helps in developing training


program which deliver the high level of customer satisfaction. Our alliance with global
major like Oracle, Redhat, Pearson, Prometric, ETS help our students in getting the world’s
latest curriculum. Armed with latest certification and supported by our HR practices (mock
interviews, aptitude training, Job fest, alumni references) most of our candidates get the best
available jobs.

IT industry which is most employing industry till has distinct attribute of creating equal
number of semi skilled unemployable human resource. The people who are partially trained,
are the big market opportunity, to cater these people Unisoft’s career programs like ADNSM,
ADHNT, UltraMCA are industry acclaimed and hugely successful individual IT training
solutions.Unisoft touches 10000+ life's every year and help each of them in achieving next
level of the career journey. For us each student is just like a new wave on seashore giving
meaning to sea’s existence Our business verticals are:

• Recruitment & Staffing


• Software Development and Testing Services
• Digital Marketing
• Enterprise Mobility
• Certifications & Trainings for Career Management
• Software solutions

UNISOFT TEAM has expertise ranging from design to development, training to


placements and solutions to implementaion. We combine this knowledge with proactive
thinking and strategic planning to approach new challenges with your overall business
objectives in mind. UNISOFT's management team brings together a wealth of
experience in both technological and organizational development that is critical in
helping our customers achieve their goals
ACTIVITIES

UNISOFT offers out of the box solutions customized for various segments.Our
expertise lies in designing, realizing and deploying customized solutions that integrate
multi-vendor Commercial Off The Shelf Solutions, custom device designincluding
software and hardware design.

The system engineering process involves:

• Identifying products and accessories


• Design procure and realize software sub-systems
• Developing system software
• Module integration

➢ UNISOFT LABS helps customers and developers save valuable time as it


could be a single source of hardware and software solutions. We provide
expert design support and development services.

➢ Design Realization

UNISOFT offers product realization services from idea-to-solution, concept-to


deployment covering various aspects of conceptualization, architecture, device design,
planning implementation, development, application development, porting and
enhancement.
INTRODUCTION OF PROJECT

INTRODUCTION

Creating a word guessing game using HTML, CSS, and JavaScript is a fun way to practice
your web development skills. Here's an introduction to help you get started.

1. Project Overview

The goal of the game is to guess a hidden word by selecting letters. The player has a limited
number of attempts to guess the word. If they guess correctly, the letter appears in the word;
if they guess incorrectly, they lose an attempt. The game ends when the player either guesses
the word or runs out of attempts

This project include:

Word Categories: Allowing the player to choose from different word categories.
Hint System: Implementing a hint feature that gives the player a clue about the word.
Score Tracking: Keeping track of the player's score across multiple rounds or games.
Local Storage: Saving the game state or score so that it persists across sessions
LIMITATION OF EXISTING SYSTEM:

1. Data redundancy:

It means that same data fields appear in many different files and often in
different formats. In Manual system it poses quite a big problem because the
data has to be maintained in large Volumes, but in our system, this problem can
be overcome by providing the condition that if The data entered is duplicate, it
will not be entered otherwise updating will take place.

2. Difficulty in accessing the data:

In manual system, searching information is time consuming but in our system,


any information Can be accessed by providing the primary key.

3. Unsatisfactory security measures:


In manual system, no security measures were provided but in this system,
Password security Has been provided. The person can access the system by
providing the correct password Otherwise he is denied the access.
Objective of the Word Guessing Game

The primary objective of the word guessing game is to guess the hidden word by selecting
letters within a limited number of attempts. The player must use logic and deductive
reasoning to uncover the word before running out of guesses.

Detailed Objectives:

1. Guess the Word:


o The player is presented with a word hidden behind underscores (e.g., _ _ _ _ _). Each
underscore represents a letter in the word.
o The player's goal is to reveal the correct letters and ultimately guess the entire word.
2. Limited Attempts:
o The player has a set number of incorrect attempts (e.g., 6 attempts) to guess the
word.
o Each incorrect guess reduces the number of remaining attempts.
3. Letter Selection:
o The player can select letters from a virtual on-screen keyboard.
o If the selected letter is part of the word, it will be revealed in its correct position(s).
o If the letter is not in the word, the player loses one attempt.
4. Winning the Game:
o The player wins the game by correctly guessing all the letters in the word before
running out of attempts.
o A congratulatory message is displayed when the player successfully guesses the
word.
5. Losing the Game:
o The player loses the game if they use up all their attempts without guessing the word.
o The game reveals the correct word and displays a message indicating that the game
is over.

This game is designed to be both fun and challenging, encouraging players to think carefully
about each guess while providing a simple and engaging experience.
FEASIBILITY STUDY

An initial investigation in a proposal that determines whether an alternative


system is feasible. A proposal summarizing the thinking of the analyst is
presented to the user for review. When approved, the proposal initiates feasibility
study that describes and evaluates candidate systems and provides for the
selection of best system that meets system performance requirements.
To do a feasibility study, we need to consider the economic, technical factors in
system development. First a project team is formed. The team develops system
flowcharts that identify the characteristics of candidate systems, evaluate the
performance of each system, weigh system performance and cost data and select
the best candidate system for the job. The study culminates in a final report to
the management.

INTRODUCTION:

1. Describe and identify characteristics of candidate systems.


2. Determine and evaluate performance and cost effectiveness of each
candidate system.
3. Weigh system performance and cost data.
4. Select the best candidate system.

SUMMARY:

1. A feasibility study is conducted to select the best system that meets


performance requirements. This entails an identification description, an
evaluation of candidate systems, and the selection of the best system for
the job.
2. A statement of constraints, the identification of specific system objectives
and a description of outputs define a system’s required performance. The
analyst is then ready to evaluate the feasibility of candidate systems to
produce these outputs.
3. Three key considerations are involved in feasibility analysis: economic,
technical and behavioural.
a. STATEMENT OF CONSTRAINTS: - Constraints are factors that
limit the solution of a problem. Some constraints are identified during the
initial investigation
b. IDENTIFICATION OF SPECIFIC SYSTEM OBJECTIVES:
- Once the constraints are spelled out, the analyst proceeds to identify the
system’s specific performance objectives. They are derived from the
general objectives specified in the project directive at the end of the
initial investigation. The steps are to state the system’s benefits and then
translate them into measurable objectives.

c. DESCRIPTION OF OUTPUTS: - A final step in system


performance definition is describing the output required by the user. An
actual sketch of the format and contents of the reports as well as a
specification of the media used, their frequency, size and numbers of
copies required are prepared at this point

TYPES OF FEASIBLE STUDY :-

i. Legal Feasibility: - Determines whether the proposed system


conflicts with legal requirements, e.g. a data processing system
must comply with the local Data Protection Acts.
ii. Operational Feasibility: -Operational feasibility is a measure
of how well a proposed system solves the problems, and takes
advantage of the opportunities identified during scope definition
and how it satisfies the requirements identified in the
requirements analysis phase of system development.
The operational feasibility assessment focuses on the degree to
which the proposed development projects fits in with the existing
business environment and objectives with regard to development
schedule, delivery date, corporate culture, and existing business
processes.
To ensure success, desired operational outcomes must be imparted
during design and development. These include such design-
dependent parameters such as reliability, maintainability,
supportability, usability, predictability, disposability, sustainability,
affordability and others. These parameters are required to be
considered at the early stages of design if desired operational
behaviors are to be realized. A system design and development
requires appropriate and timely application of engineering and
management efforts to meet the previously mentioned parameters.
A system may serve its intended purpose most effectively when
its technical and operating characteristics are engineered into the
design. Therefore operational feasibility is a critical aspect of
systems engineering that needs to be an integral part of the early
design phases
iii. Economic Feasibility: -The purpose of the economic
feasibility assessment is to determine the positive economic
benefits to the organization that the proposed system will
provide. It includes quantification and identification of all the
benefits expected. This assessment typically involves a cost/
benefits analysis.

iv. Technical Feasibility: -The technical feasibility assessment is


focused on gaining an understanding of the present technical
resources of the organization and their applicability to the
expected needs of the proposed system. It is an evaluation of the
hardware and software and how it meets the need of the
proposed system.
HARDWARE AND SOFTWARE REQUIREMENTS

1. HARDWARE REQUIREMENT:-

• PROCESSOR : Pentium IV processor or Greater


• RAM : 128 Mega Byte (MB) or Greater
• HARDDISK : 1.2 Giga Byte (GB) or Greater
• Keyboard & Mouse
• MONITOR : Colour (For Best Result)
• Printer

2. SOFTWARE REQUIREMENTS:-

• Operating System : Windows 2000/ XP /7/8


• Front-End : vs-code
DEVELOPMENT ENVIRONMENT

1. INTRODUCTION TO VS CODE :-

An Oracle database is a collection of data treated as a unit. The purpose


of a database is to store and retrieve related information. A database
server is the key to solving the problems of information management. In
general, a server reliably manages a large amount of data in a multiuser
environment so that many users can concurrently access the same data.
All this is accomplished while delivering high performance. A database
server also prevents unauthorized access and provides efficient solutions
for failure recovery.

Oracle Database is the first database designed for enterprise grid


computing, the most flexible and cost effective way to manage information
and applications. Enterprise grid computing creates large pools of industry-
standard, modular storage and servers. With this architecture, each new
system can be rapidly provisioned from the pool of components. There is
no need for peak workloads, because capacity can be easily added or
reallocated from the resource pools as needed.

The database has logical structures and physical structures. Because the
physical and logical structures are separate, the physical storage of data
can be managed without affecting the access to logical storage structures.
2.INTRODUCTION TO WEB-DEVLOPMENT

Web development is the process of building and maintaining websites or web applications
that run on browsers. It involves a combination of front-end (client-side) and back-end
(server-side) development, each with its own set of technologies and tools. Web
development is a vast field, requiring knowledge of programming, design, databases, and
sometimes even content management.

1.Understanding the Basics of Web Development

a. The Structure of a Web Application


• Client-Side (Front-End): This is the part of the application that users interact with directly
in their web browsers. It includes everything the user experiences visually: layouts, text,
images, buttons, forms, and other elements of the user interface (UI).
• Server-Side (Back-End): This is the part that runs on the server and handles business logic,
databases, and application performance. It processes requests from the front-end, retrieves
information from the database, and sends it back to the user’s browser.
• Database: Stores data that the back-end processes and retrieves to serve the front-end.
Common databases include MySQL, PostgreSQL, MongoDB, and more.

b. Key Concepts

• HTTP/HTTPS: The protocols used to transfer data over the web. HTTP stands for Hypertext
Transfer Protocol, while HTTPS adds a layer of security with SSL/TLS encryption.
• URL: Uniform Resource Locator, the address used to access resources on the web.
• Client-Server Model: A model in which the client (browser) requests services or resources,
and the server provides them.

2. Front-End Development

Front-end development is focused on the visual and interactive aspects of a web application.
It’s where design meets code.

a. Core Technologies
• HTML (Hypertext Markup Language): The standard language used to create the structure
of web pages. It defines elements like headings, paragraphs, links, images, and more.
• CSS (Cascading Style Sheets): Used to style HTML elements, making the web pages look
attractive. CSS controls layout, colors, fonts, and responsiveness (how a site looks on
different devices).
• JavaScript: A programming language that brings interactivity to the web. JavaScript can be
used to create dynamic content, handle user inputs, and interact with back-end services
without reloading the page.

b . Front-End Frameworks and Libraries


• React.js: A JavaScript library for building user interfaces, particularly single-page
applications (SPAs).
• Angular: A front-end framework developed by Google for building SPAs using TypeScript.
• Vue.js: A progressive JavaScript framework for building UIs and SPAs.
• Bootstrap: A CSS framework that simplifies the design and layout of web pages with pre-
built components and responsive grids.

c. Responsive Design

• Ensures that web pages look and function well on a variety of devices (desktops, tablets,
smartphones). CSS media queries and frameworks like Bootstrap are commonly used to
achieve responsiveness.

3. Back-End Development

Back-end development focuses on the server-side logic, databases, and the core application
functionality.

a. Server-Side Languages

• JavaScript (Node.js): Enables server-side scripting using JavaScript, allowing developers to


use a single language for both front-end and back-end.
• Python: Known for its readability and simplicity, often used with frameworks like Django or
Flask.
• Ruby: A dynamic language often used with the Ruby on Rails framework for building web
applications.
• PHP: A widely-used server-side scripting language particularly suited for web development.

b. Databases

• SQL Databases: Structured databases that use SQL (Structured Query Language) for data
management. Examples include MySQL, PostgreSQL, and Microsoft SQL Server.
• NoSQL Databases: Non-relational databases that store data in formats other than tables.
Examples include MongoDB, Cassandra, and Redis.

c. APIs (Application Programming Interfaces)

• Allow different software systems to communicate with each other. In web development,
RESTful APIs and GraphQL are commonly used to enable front-end and back-end
interactions.
d. Server and Hosting

• Web Servers: Handle client requests and deliver the requested resources. Common web
servers include Apache, Nginx, and IIS.
• Hosting: Web applications need to be hosted on servers to be accessible online. Hosting
providers include AWS, Heroku, DigitalOcean, and others.

4. Full-Stack Development

A full-stack developer works on both the front-end and back-end of a web application. This
requires proficiency in multiple technologies, including front-end frameworks, server-side
languages, databases, and DevOps (deployment and server management).

a. MEAN/MERN Stack

• MEAN: MongoDB, Express.js, Angular, and Node.js.


• MERN: MongoDB, Express.js, React.js, and Node.js.

b. LAMP Stack

• LAMP: Linux, Apache, MySQL, and PHP/Python/Perl.

c. JAMstack

• A modern architecture for building fast and secure websites using JavaScript, APIs, and
Markup.

5 . Web Development Tools


a. Version Control

• Git: A version control system that allows developers to track changes, collaborate, and
manage code across different versions.

b. Code Editors

• Visual Studio Code, Sublime Text, and Atom are popular editors with features like syntax
highlighting, debugging, and extensions.

c. Package Managers

• npm (Node Package Manager) and Yarn: Manage dependencies for JavaScript projects.
6 .Web Development Best Practices

a. Responsive and Adaptive Design

• Ensure that web applications are accessible and functional on all devices and screen sizes.

b. Performance Optimization

• Techniques like lazy loading, code splitting, and image optimization to improve load times
and user experience.

c. Security

• Implementing security measures like HTTPS, input validation, and secure authentication to
protect against common web vulnerabilities like SQL injection and cross-site scripting (XSS).

d. Accessibility

• Ensuring web applications are usable by people with disabilities by adhering to standards
like WCAG (Web Content Accessibility Guidelines).

6. Future Trends in Web Development

a. Progressive Web Apps (PWAs)

• Web applications that provide a native app-like experience with features like offline access
and push notifications.

b. Single-Page Applications (SPAs)

• Applications that load a single HTML page and dynamically update content as the user
interacts with the app, without requiring full page reloads.

c. Serverless Architecture

• Building and running applications without managing servers. Cloud providers handle the
infrastructure, allowing developers to focus solely on code.
d. Artificial Intelligence and Machine Learning

• Integrating AI and ML into web applications for features like chatbots, personalization, and
predictive analytics.

Conclusion

Web development is a dynamic and evolving field that blends creativity with technical skills.
Whether you're interested in crafting beautiful user interfaces or developing robust server-
side logic, web development offers a broad range of opportunities.

TESTING AND IMPLEMENTATION

TESTING:-

Testing is the process of exercising software with the intent of finding errors and
ultimately correcting them. The following testing techniques have been used to
make this project free of errors.

Content Review

The whole content of the project has been reviewed thoroughly to uncover
typographical errors, grammatical error and ambiguous sentences.

Navigation Errors

Different users were allowed to navigate through the project to uncover the
navigation errors. The views of the user regarding the navigation flexibility and
user friendliness were taken into account and implemented in the project.

Unit Testing

Focuses on individual software units, groups of related units.


• Unit – smallest testable piece of software.
• A unit can be compiled /assembled / linked/loaded; and put under a test
harness.
• Unit testing done to show that the unit does not satisfy the application and
/or its implemented software does not match the intended designed structure.
Integration Testing

Focuses on combining units to evaluate the interaction among them


• Integration is the process of aggregating components to create larger
components.
• Integration testing done to show that even though components were
individually satisfactory, the combination is incorrect and inconsistent.

System testing

Focuses on a complete integrated system to evaluate compliance with specified


requirements (test characteristics that are only present when entire system is run)
Concern: issues, behaviors that can only be exposed by testing the entire integrated

Regression Testing

Each time a new form is added to the project the whole project is tested
thoroughly to rectify any side effects. That might have occurred due to the
addition of the new form. Thus regression testing has been performed.

White-Box testing

White-box testing (also known as clear box testing, glass box testing, transparent
box testing and structural testing) tests internal structures or workings of a
program, as opposed to the functionality exposed to the end-user. In white-box
testing an internal perspective of the system, as well as programming skills, are
used to design test cases. The tester chooses inputs to exercise paths through the
code and determine the appropriate outputs.

This is analogous to testing nodes in a circuit, e.g. in-circuit testing (ICT).

While white-box testing can be applied at the unit, integration and system levels
of the software testing process, it is usually done at the unit level. It can test
paths within a unit, paths between units during integration, and between
subsystems during a system–level test. Though this method of test design can
uncover many errors or problems, it might not detect unimplemented parts of the
specification or missing requirements.

Techniques used in white-box testing include:

API testing (application programming interface) – testing of the application using


public and private APIs
Code coverage – creating tests to satisfy some criteria of code coverage (e.g.,
the test designer can create tests to cause all statements in the program to be
executed at least once)

Fault injection methods – intentionally introducing faults to gauge the efficacy


of testing Code coverage tools can evaluate the completeness of a test suite that
wascreated with any method, including black-box testing. This allows the
software team to examine parts of a system that are rarely tested and ensures that
the most important function points have been tested. Code coverage as a software
metric can be reported as a percentage for:Function coverage, which reports on
functions executedStatement coverage, which reports on the number of lines
executed to complete the test 100% statement coverage ensures that all code paths,
or branches (in terms of control flow) are executed at least once. This is helpful
in ensuring correctfunctionality, but not sufficient since the same code may process
different inputs correctly or incorrectly.

Black-box testing

Black-box testing treats the software as a "black box", examining functionality


without any knowledge of internal implementation. The tester is only aware of
what the software is supposed to do, not how it does it. Black-box testing
methods include: equivalence partitioning, boundary value analysis, all-pairs
testing, state transition tables, decision table testing, fuzz testing, model-based
testing, use case testing, exploratory testing and specification-based testing.
Specification-based testing aims to test the functionality of software according to
the applicable requirements. This level of testing usually requires thorough test
cases to be provided to the tester, who then can simply verify that for a given
input, the output value (or behaviour), either "is" or "is not" the same as the
expected value specified in the test case. Test cases are built around
specifications and requirements, i.e., what the application is supposed to do. It
uses external descriptions of the software, including specifications, requirements,
and designs to derive test cases. These tests can be functional or non-functional,
though usually functional.

Specification-based testing may be necessary to assure correct functionality, but it


is insufficient to guard against complex or high-risk situations.
One advantage of the black box technique is that no programming knowledge is
required. Whatever biases the programmers may have had, the tester likely has a
different set and may emphasize different areas of functionality. On the other
hand, black-box testing has been said to be "like a walk in a dark labyrinth
without a flashlight." Because they do not examine the source code, there are
situations when a tester writes many test cases to check something that could
have been tested by only one test case, or leaves some parts of the program
untested
Alpha Testing

Alpha testing is simulated or actual operational testing by potential


users/customers or an independent test team at the developers' site. Alpha testing
is often employed for off-the-shelf software as a form of internal acceptance testing,
before the software goes to beta testing.

Beta Testing

Beta testing comes after alpha testing and can be considered a form of external
user acceptance testing. Versions of the software, known as beta versions, are
released to a limited audience outside of the programming team. The software is
released to groups of people so that further testing can ensure the product hasfew
faults or bugs. Sometimes, beta versions are made available to the open public to
increase the feedback field to a maximal number of future users.
IMPLEMENTATION:-

CODE:

▪ HTML CODE

<!DOCTYPE html>
<html>

<head>
<title>Word Guessing Game</title>
<link rel="stylesheet"
href="style.css" />
<script src="./script.js"></script>
</head>

<body>
<div class="card">
<h1>Guess the word</h1>
<p>
<b>Hint:</b> A programming language
</p>
<p id="displayWord"></p>
<p>Guess one letter:

<input type="text"
maxlength="1"
id="letter-input">
</p>
<button onclick="guessLetter()">
Submit
</button>
</div>
</body>

</html>
▪ CSS CODE

h1 {
background-color: rgb(231, 231, 231);
color: green;
font-size: xx-large;
padding: 2%;
/* width: 70vh; */
}

/* Style for the card and border */


.card {
min-width: 30%;
width: 50vh;
min-height: 30vh;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
transition: 0.3s;
border-radius: 5px;
margin: auto;
padding: 2%;
}

/* Font and display style for complete body */


body {
display: flex;
text-align: center;
font-family: "Gill Sans",
"Gill Sans MT",
Calibri, "Trebuchet MS",
sans-serif;
}

/* Adding style for input box */


input {
width: 30px;
padding: 1%;
font-size: larger;
text-align: center;
margin-left: 2%;
}

/* Adding style for display word*/


#displayWord {
font-size: xx-large;
}
▪ JAVASCRIPT

// Array of words to choose from


const words = [
"java",
"javascript",
"python",
"pascal",
"ruby",
"perl",
"swift",
"kotlin",
];

// Geting random word from the list


let randomIndex = Math.floor(Math.random() * words.length);
let selectedWord = words[randomIndex];
console.log(selectedWord);

// To store the already guessed letters


let guessedlist = [];

// For initial display Word


let displayWord = "";
for (let i = 0; i < selectedWord.length; i++) {
displayWord += "_ ";
}
document.getElementById("displayWord").textContent = displayWord;

// Function to check Guessed letter


function guessLetter() {
let inputElement =
document.getElementById("letter-input");

// To check empty input


if (!inputElement.value) {
alert("Empty Input box. Please add input letter");
return;
}

let letter = inputElement.value.toLowerCase();

// Clear the input field


inputElement.value = "";

// Check if the letter has already been guessed


if (guessedlist.includes(letter)) {
alert("You have already guessed that letter!");
return;
}

// Add the letter to the guessed letters array


guessedlist.push(letter);

// Update the word display based on the guessed letters


let updatedDisplay = "";
let allLettersGuessed = true;
for (let i = 0; i < selectedWord.length; i++) {
if (guessedlist.includes(selectedWord[i])) {
updatedDisplay += selectedWord[i] + " ";
} else {
updatedDisplay += "_ ";
allLettersGuessed = false;
}
}
document.getElementById("displayWord")
.textContent = updatedDisplay;

// Check if all letters have been guessed


if (allLettersGuessed) {
alert("Congratulations! You guessed the word correctly!");
}
}
SCREENSHOTS:-

BEFORE INPUT INTERFACE:

AFTER INPUTS INTERFACE:


▪ FINAL OUTPUT
CONCLUTION:-
The project “ word guessing game” aims to simplify the process of word guessing
the student’s performance by computerizing it and making it user friendly.
This project makes the whole process automated as user just need to enter few details
in this to get started and then he can choose the subject of his choice on whichhe want
to take quiz so as to evaluate and enhance his performance. Result is generated
automatically in the end enabling student to improve his performance.
This project cover very much every function needed by user in supermarketmanagement
system.

REFERENCES
1. www.javatpoint.com/java

2. www.google.co.in

3. https://chatgpt.com/

4. https://www.w3schools.com/

You might also like