Weather Prediction Model
Weather Prediction Model
INTRODUCTION .................................................................................................
SCOPE…….......................................................................................................... 4
LIMITATIONS ..................................................................................................... 5
SYSTEM REQUIREMENTS ................................................................................ 6
FUNCTIONAL REQUIREMENTS ..................................................................... 7-8
USE CASES ........................................................................................................ 9
SYSTEM DESIGN ..............................................................................................10
TECHNOLOGY STACK ..................................................................................... 11
CODE SNIPPETS.......................................................................................... 12-15
TESTING ....................................................................................................... 16-17
RESULT AND DISCUSSIONS ....................................................................... 18-19
CONCLUSION .................................................................................................... 20
REFRENCES ...................................................................................................... 21
Introduction
▪ The Weather Prediction Model is a fully functional web application designed to provide accurate, real-
time weather information for any location.
▪ In today's fast-paced world, quick access to reliable weather information is crucial for daily planning,
travel, and outdoor activities.
▪ This webpage provides quick access to current weather and next day forecasts for any location.
▪ This project simplifies weather retrieval through a user-friendly interface, allowing searches by city
name (e.g., "Mumbai," "Delhi").
Scope
This project covers the design, development, and
testing of a web-based weather forecast. Specifically, it
includes:
● Location search (via city name input).
● Display of current weather data (Temperature,
Humidity, Pressure, Condition).
● Presentation of a next day forecast (daily
temperature, pressure, humidity).
● A user-friendly and responsive web interface.
Technical Scope:
● Developed using C++ (OOPS concepts) alongside
HTML, CSS, and JavaScript for the frontend.
Platform Compatibility:
● Designed to work seamlessly on both mobile and desktop platforms.
Limitations
Software Requirements
● Operating System: Windows 7/10/11, Linux, or
macOS
● Compiler: C++ Compiler (e.g., GCC, Turbo C++ or
Code::Blocks IDE with C++ support)
● Web Browser: Any modern browser (Chrome,
Firefox, Edge)
Dependencies and Libraries
● Frontend:
o HTML5, CSS3, JavaScript
● Backend (if any):
o Basic C++ OOPS principles applied (no
mention of heavy back-end frameworks).
Use Cases
● Check Current Weather: A user wants to know the current weather in their city. They open the app, and the
current conditions are displayed.
● Plan a Trip: A user is planning a trip and wants to check the weather forecast for their destination. They
search for the city name and view the 5-day forecast.
● Decide on Outdoor Activities: A user wants to know if it's a good day for a walk. They check the app to see
the temperature, wind speed, and current weather condition.
Functional Requirements
1. Location Search: Users enter a city name (e.g., "Paris"). The app validates the input and handles cases
where the city is not found (displays an error message like "City not found").
2. Enter the data: Users enter the previous days temperature, humidity and pressure (Maximum = 7 Days
and Minimum= 3 Days) data.
o Temperature
o Humidity
o Wind Speed
● CSS 1 ● WeatherAPI).
● JavaScript 1
Code Snippets
1. HTML5 – (Structure of the page)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,
initial-scale=1.0"/>
<title>Weather Form Visualizer</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></
script>
<link href="https://fonts.googleapis.com/css2?
family=Roboto&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="form-container">
<h2> Weather Forecast Form</h2>
<form id="weatherForm"
onsubmit="handleSubmit(event)">
<label for="locationName">Location Name:</label>
<input type="text" id="locationName"
placeholder="e.g., Mumbai" required />
<script src="script.js"></script>
</body>
</html>
2. CSS (Styling the webpage)
body {
font-family: 'Roboto', sans-serif;
background: #e3f2fd;
margin: 0;
padding: 0;
}
.form-container {
max-width: 600px;
margin: 40px auto;
background: #fff;
padding: 30px;
border-radius: 12px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}
h2 {
text-align: center;
margin-bottom: 25px;
color: #1565c0;
}
label {
display: block;
margin-bottom: 6px;
font-weight: bold;
color: #0d47a1;
}
input, textarea {
width: 100%;
padding: 10px;
margin-bottom: 20px;
border: 1px solid #ccc;
border-radius: 6px;
font-size: 15px;
}
button {
background-color: #1976d2;
color: white;
padding: 12px;
border: none;
width: 100%;
font-size: 16px;
border-radius: 6px;
cursor: pointer;
transition: 0.3s;
}
button:hover {
background-color: #1565c0;
}
.results {
margin-top: 30px;
padding: 20px;
border: 2px solid #bbdefb;
background: #e3f2fd;
border-radius: 10px;
}
.condition-tag {
display: inline-block;
padding: 4px 10px;
margin-left: 10px;
border-radius: 12px;
font-size: 0.9em;
color: white;
}
canvas {
margin-top: 30px;
}
ul {
padding-left: 18px;
}
3. JavaScript
function parseWeatherData(raw) {
const lines = raw.trim().split('\n');
const temps = [], hums = [], press = [], days = [];
function handleSubmit(event) {
event.preventDefault();
if (temps.length < 3) {
alert("Please enter at least 3 valid days of data.");
return;
}
Results
● Developed a working weather prediction web app using HTML, CSS, JavaScript, and C++ logic.
● Displays real-time input-based predictions for temperature, humidity, and pressure.
● Shows next-day forecast and trends using charts.
● The UI is responsive and adapts well to different screen sizes.
● Challenges encountered during development included handling API errors and asynchronous data
fetching.
Discussion
● Useful for small-scale applications like trip planning and farming.
● Can be improved with live API integration or machine learning in the future.
Conclusion
● A simple and interactive weather prediction model was successfully developed.
● Utilizes C++ (OOPS concepts) along with HTML, CSS, and JavaScript for implementation.
● Predicts weather conditions based on user input of temperature, humidity, and pressure.
● Displays forecasts clearly with visual charts and categorized weather conditions.
● Useful for small-scale applications like trip planning and farming decisions.
● Can be enhanced further with real-time API data and advanced prediction algorithms.
References
1. HTML5 Documentation:
2. CSS3 Documentation: