CC8 ASSIGNMENT - Merged
CC8 ASSIGNMENT - Merged
PAGE 1-
<!DOCTYPE html>
<html>
<head>
<title>College Website</title>
</head>
<body>
<header class="header">
<div style="text-align:center"><img align="center" ;
style="width:15%"src="abc.jpg" alt="College Logo"></div>
<h1 style="font-size:60px;text-align:center">ABC
COLLEGE</h1>
</header>
<hr>
<nav>
<ul>
<div style="text-align:left"><li><a style="font-
size:30px;background-color:magenta;padding: 15px 35px;margin: 5px
0;display: inline-block;" href="index.html">Home</a></li>
<li><a style="font-size:30px;background-color:magenta;padding: 15px
35px;margin: 5px 0;display: inline-block;"
href="academics.html">Academics</a></li>
<li><a style="font-size:30px;background-color:magenta;padding: 15px
35px;margin: 5px 0;display: inline-block;"
href="admission.html">Admission</a></li>
<li><a style="font-size:30px;background-color:magenta;padding: 15px
35px;margin: 5px 0;display: inline-block;"
href="gallery.html">Gallery</a></li>
</div></ul>
</nav>
<main>
<hr>
<h2 style="font-size:40px;text-align:center;background-
color:blue">ABOUT US</h2>
PAGE 2-
<!DOCTYPE html>
<html>
<head>
<title>College Website</title>
</head>
<body>
<header class="header">
<div style="text-align:center;margin-top:30px" >
<img style="width:15%"src="abc.jpg" alt="College Logo">
</div>
<h1 style="font-size:60px;text-align:center">ABC
COLLEGE</h1>
</header>
</nav>
<main>
<hr>
<h2 style="font-size:40px;text-align:center;background-
color:grey">ABOUT US</h2>
<p>Welcome to ABCCollege
Founded in [year], XYZ College stands as a beacon of academic excellence and
holistic development. Located in the heart of [City], our institution is dedicated
to providing a nurturing environment where students can excel academically,
grow personally, and contribute to society meaningfully.</p>
<p>XYZ College has a strong alumni network, with graduates who have
excelled in various fields, including academia, industry, public service, and the
arts. Our alumni continue to contribute to the college community, offering
mentorship and career guidance to current students.</p>
<p>We invite you to explore our website to learn more about our programs,
faculty, and campus life. Discover how XYZ College can be the catalyst for
your academic and personal growth. Join us in our mission to create a brighter,
more inclusive future.</p>
</main>
</body>
</html>
OUTPUT-
PAGE 3-
<!DOCTYPE html>
<html lang="en">
<head>
<title>Academic Programs</title>
<link rel="stylesheet" href="styles.css">
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f4;
}
header {
text-align: center;
padding: 20px;
background-color: #333;
color: #fff;
}
.course-section {
display: flex;
justify-content: space-around;
margin: 20px;
}
.course-category {
flex: 1;
margin: 10px;
padding: 20px;
border-radius: 8px;
}
.course-category h3 {
text-align: center;
}
.course-category ul {
list-style: none;
padding: 0;
}
.course-category li {
margin: 10px 0;
font-size: 1.2em;
}
.course-category a {
text-decoration: none;
color: #fff;
display: block;
padding: 10px;
border-radius: 4px;
transition: background-color 0.3s ease;
}
.arts {
background-color: #FF5733;
font-family: 'Times New Roman', Times, serif;
}
.arts a:hover {
background-color: #E14D2A;
}
.commerce {
background-color: #28A745;
font-family: 'Courier New', Courier, monospace;
}
.commerce a:hover {
background-color: #218838;
}
.science {
background-color: #007BFF;
font-family: 'Verdana', Geneva, sans-serif;
}
.science a:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<header>
<h1>Available Courses</h1>
</header>
<main class="course-section">
<div class="course-category arts">
<h3>Arts</h3>
<ul>
<li><a href="courses.html">Polytechnics</a></li>
<li><a href="courses.html">Journalism</a></li>
<li><a href="courses.html">Economics</a></li>
<li><a href="courses.html">English</a></li>
</ul>
</div>
<div class="course-category commerce">
<h3>Commerce</h3>
<ul>
<li><a href="courses.html">Business Administration</a></li>
<li><a href="courses.html">Marketing</a></li>
<li><a href="courses.html">Accounting</a></li>
<li><a href="courses.html">Finance</a></li>
</ul>
</div>
<div class="course-category science">
<h3>Science</h3>
<ul>
<li><a href="coursesCOMP.html">Computer Science</a></li>
<li><a href="courses.html">Mathematics</a></li>
<li><a href="courses.html">Physics</a></li>
<li><a href="courses.html">Chemistry</a></li>
</ul>
</div>
</main>
</body>
</html>
OUTPUT-
PAGE 4-
<!DOCTYPE html>
<html lang="en">
<head>
<title>Course - Arts - 1</title>
<style>
*{
margin: 0;
padding: 0;
font-family: 'Montserrat', sans-serif;
color: #333;
}
body {
width: 80%;
margin: auto;
text-align: center;
justify-content: center;
background-color: #f9f9f9;
}
h2 {
padding: 30px;
font-size: 36px;
color: #2d2d2d;
}
p{
font-size: 18px;
margin-bottom: 20px;
}
a{
text-decoration: none;
color: #337ab7;
}
img {
width: 25%;
border-radius: 50%;
border: solid #ddd;
cursor: pointer;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}
h1 {
margin: 20px 0;
color: #444;
}
table {
width: 80%;
border-collapse: collapse;
margin: 0px auto 50px auto;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}
thead {
background-color: #337ab7;
color: white;
}
thead th {
padding: 15px;
text-align: center;
}
tbody tr:hover {
background-color: #f5f5f5;
}
tbody td {
padding: 15px;
text-align: center;
border: 1px solid #ddd;
}
.border {
border: solid #ccc;
border-width: 5px;
padding: 30px;
margin-bottom: 20px;
background-color: #fff;
}
.name h3 {
font-size: 22px;
color: #333;
padding: 5px;
}
.name h4 {
font-size: 18px;
padding: 5px;
}
.links a {
color: #337ab7;
padding: 5px;
}
.short-bio {
padding: 5px;
}
.arts {
font-family: 'Times New Roman', Times, serif;
background-color: #FF5733;
}
.commerce {
font-family: 'Courier New', Courier, monospace;
background-color: #28A745;
}
.science {
font-family: 'Verdana', Geneva, sans-serif;
background-color: #007BFF;
}
</style>
</head>
<body>
<section class="course-description">
<h2>Course Description</h2>
<p>
"Explore the fascinating world of Computer Science and discover the
fundamentals of programming, algorithms, and computer systems. This
comprehensive course covers the basics of software development, data
structures, computer architecture, and software engineering. Through hands-on
coding exercises and real-world projects, you'll learn to analyze problems,
design solutions, and develop cutting-edge software applications. Whether
you're a beginner or an experienced programmer, this course will help you build
a strong foundation in computer science and prepare you for a career in this
exciting and rapidly evolving field."
</p>
</section>
<section class="teacher-info">
<h2>Teachers</h2>
and conferences, and has contributed to several book chapters in the areas of
Computer Science and Engineering. He is also a regular reviewer for several
high-impact journals and conferences, and has received multiple awards for his
contributions to the field."
</p>
</div>
</div>
<section class="time-table">
<h1>College Department Timetable</h1>
<table>
<thead>
<tr>
<th>Time</th>
<th>10:00 - 11:00 AM</th>
<th>11:00 - 12:00 AM</th>
<th>12:00 - 1:00 AM</th>
<th>1:00 - 2:00 PM</th>
<th>2:30 - 3:30 PM</th>
</tr>
</thead>
<tbody>
<tr>
<td>Monday</td>
<td>Data Structures</td>
<td>Networking</td>
<td>Microprocessor</td>
<td>Java</td>
<td>General</td>
</tr>
<tr>
<td>Tuesday</td>
<td>Java</td>
<td>Algorithms</td>
<td>Info. Security</td>
<td>Data Structures</td>
<td>General</td>
</tr>
<tr>
<td>Wednesday</td>
<td>Algorithms</td>
<td>Graphics</td>
<td>C++</td>
<td>Microprocessor</td>
<td>General</td>
</tr>
<tr>
<td>Thursday</td>
<td>Networking</td>
<td>Info. Security</td>
<td>Algorithms</td>
<td>Electronics</td>
<td>General</td>
</tr>
<tr>
<td>Friday</td>
<td>Data Structures</td>
<td>Java</td>
<td>Graphics</td>
<td>C++</td>
<td>General</td>
</tr>
</tbody>
</table>
</section>
</body>
</html>
OUTPUT-
PAGE 5-
<!DOCTYPE html>
<html lang="en">
<head>
<title>Admission Form</title>
<style>
body {
background-color: #f7f7f7;
font-family: 'Arial', sans-serif;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
main {
background-color: #fff;
border-radius: 8px;
box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
width: 80%;
max-width: 700px;
padding: 20px;
}
h2 {
text-align: center;
color: #333;
}
form {
display: flex;
flex-direction: column;
}
fieldset {
border: none;
margin-bottom: 20px;
}
legend {
font-size: 1.2em;
margin-bottom: 10px;
color: #444;
}
label {
display: block;
margin-bottom: 5px;
font-weight: bold;
color: #555;
}
input, select, textarea {
width: 100%;
padding: 10px;
margin-bottom: 15px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 1em;
color: #333;
}
button {
width: 100%;
padding: 15px;
background-color: #337ab7;
color: #fff;
border: none;
border-radius: 4px;
font-size: 1.2em;
cursor: pointer;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #285e8e;
}
</style>
</head>
<body>
<main>
<h2>Admission Form</h2>
<form action="submit_admission.php" method="POST">
<!-- Personal Information -->
<fieldset>
<legend>Personal Information</legend>
<label for="first-name">First Name:</label>
<input type="text" id="first-name" name="first_name" required>
<label for="last-name">Last Name:</label>
<input type="text" id="last-name" name="last_name" required>
<label for="gender">Gender:</label>
<select id="gender" name="gender" required>
<option value="male">Male</option>
<option value="female">Female</option>
<option value="other">Other</option>
</select>
<label for="email">Email:</label>
<input type="email" id="email" name="email" required>
<label for="state">State:</label>
<input type="text" id="state" name="state" required>
<label for="department">Department:</label>
<select id="department" name="department" required>
<option value="arts">Arts</option>
<option value="science">Science</option>
<option value="commerce">Commerce</option>
</select>
<label for="course">Course:</label>
<input type="text" id="course" name="course" required>
</fieldset>
OUTPUT-
PAGE 6-
<!DOCTYPE html>
<html>
<head>
<title>College Gallery</title>
<style>
body {
background-color: #f9f9f9;
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
.header {
text-align: center;
margin: 20px 0;
}
.header img {
width: 100px;
border-radius: 50%;
}
.header h1 {
font-size: 50px;
color: #333;
}
h2 {
font-size: 40px;
text-align: center;
color: #555;
margin-bottom: 30px;
}
.gallery {
width: 80%;
margin: 0 auto;
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 20px;
}
.gallery img {
width: 30%;
padding: 10px;
border: 1px solid #ddd;
box-shadow: 0px 0px 10px rgba(0,0,0,0.1);
transition: transform 0.3s, box-shadow 0.3s;
}
.gallery img:hover {
transform: scale(1.1);
box-shadow: 0px 0px 15px rgba(0,0,0,0.3);
}
</style>
</head>
<body>
<header class="header">
<img src="abc.jpg" alt="College Logo">
<h1>ABC COLLEGE</h1>
</header>
<h2>College Gallery</h2>
<div class="gallery">
<img src="college1.jpg" alt="College 1">
<img src="college2.jpg" alt="College 2">
<img src="college3.jpg" alt="College 3">
<img src="college4.jpg" alt="College 4">
<img src="college5.jpg" alt="College 5">
</div>
</body>
</html>
OUTPUT-
ASSIGNMENTS CC-8
ASSIGNMENT 2: Print the squares of the numbers 1 20. Each number should be on a
separate line, next to it the number 2 superscripted, an equal sign and the result. (Example:
102
= 100)
SOURCE CODE-
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Assignment 2</title>
<style>
*{
font-family: Arial, sans-serif;
font-size: 25px;
margin: 0;
padding: 0;
}
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f0f0f0;
}
.container {
display: flex;
justify-content: center;
align-items: center;
width: 300px;
height: 90vh;
background: linear-gradient(to bottom, #ffc300, #000000);
box-shadow: 0 0 15px #000000;
border-radius: 15px;
color: #ffffff;
padding: 20px;
text-align: center;
}
.numbers {
width: 100%;
}
</style>
</head>
<body>
<div class="container">
<div class="numbers">
<?php
for ($i = 1; $i <= 20; $i++) {
echo $i . "<sup>2</sup> = " . ($i * $i) . "<br>";
}
?>
</div>
</div>
</body>
</html>
OUTPUT-
ASSIGNMENT 3:
Write a script to store the above data into an array. Now display the content of that array.
Sort the list by the capital of the country
SOURCE CODE-
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Assignment 3</title>
<style>
*{
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
}
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f0f0f0;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 60vh;
height: 60vh;
background: linear-gradient(45deg, #34abcc, #000000);
border-radius: 15px;
box-shadow: 0 0 15px #000000;
color: #ffffff;
padding: 20px;
}
table {
width: 100%;
border-collapse: collapse;
text-align: left;
}
th, td {
padding: 10px;
}
th {
border-bottom: 2px solid #ffffff;
}
</style>
</head>
<body>
<div class="container">
<?php
$arr = array(
'Italy' => 'Rome',
'Belgium' => 'Brussels',
'Denmark' => 'Copenhagen',
'Finland' => 'Helsinki',
'France' => 'Paris',
'Germany' => 'Berlin',
'Greece' => 'Athens',
'Netherlands' => 'Amsterdam',
'Portugal' => 'Lisbon',
'Spain' => 'Madrid'
);
asort($arr);
?>
<table>
<tr>
<th>Country</th>
<th>Capital</th>
</tr>
<?php
foreach ($arr as $country => $capital) {
echo "<tr>";
echo "<td>$country</td>";
echo "<td>$capital</td>";
echo "</tr>";
}
?>
</table>
</div>
</body>
</html>
OUTPUT-
ASSIGNMENT 4:
Write a script to store the elements given above into an array. Perform the following
operations:
• Get the first element of the above array.
• Insert a new item in any position.
• Delete last item.
SOURCE CODE-
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Assignment 4</title>
<style>
*{
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
}
body {
display: flex;
justify-content: space-around;
align-items: center;
width: 100%;
height: 100vh;
background-color: #f0f0f0;
}
.box {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 200px;
height: 90vh;
background: linear-gradient(#ff6a00, #ffffff, #039d41);
box-shadow: 0 0 15px #000000;
border-radius: 15px;
padding: 10px;
color: #2d2d2d;
text-align: center;
}
.array {
margin-bottom: 20px;
}
.form {
display: flex;
flex-direction: column;
align-items: center;
}
.form input[type="number"],
.form input[type="text"] {
margin-bottom: 10px;
padding: 5px;
width: 80%;
border-radius: 5px;
border: 1px solid #000000;
}
.form input[type="submit"] {
padding: 5px 10px;
border-radius: 5px;
border: none;
background-color: #039d41;
cursor: pointer;
}
</style>
</head>
<body>
<div class="box array">
<?php
$arr = array('5' => 'yellow', '14' => 'blue', '3' => 'green', '22' => 'white');
foreach ($arr as $key => $value) {
echo "$key => $value<br>";
}
?>
</div>
<div class="box first">
<?php
echo "The first element of the above array:<br>";
foreach ($arr as $key => $value) {
echo "$key => $value<br>";
break;
}
?>
</div>
<div class="box second">
<form class="form" action="" method="post">
<label for="a">Enter the position:</label>
<input type="number" id="a" name="pos" required>
<label for="b">Enter the key:</label>
<input type="number" id="b" name="key" required>
<label for="c">Enter the value:</label>
<input type="text" id="c" name="value" required>
<input type="submit" value="Submit">
</form>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$pos = $_POST['pos'];
$key = $_POST['key'];
$value = $_POST['value'];
OUTPUT-
A.
B.
C.
D.
ASSIGNMENT 5: Create a login form using HTML. On clicking submit the login page will
redirected to another page that will check if the user is valid or not. If valid then print a
welcome message
and current date.
SOURCE CODE-
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Assignment 5</title>
<style>
*{
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
color: #2c2c2c;
}
body {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100vh;
background-color: #f0f0f0;
}
.container {
width: 360px;
height: 300px;
background: linear-gradient(#ff6a00, #ffffff, #039d41);
font-size: 24px;
padding: 20px;
box-shadow: 0 0 30px #000000;
border-radius: 15px;
}
h2 {
text-align: center;
margin-bottom: 20px;
color: #ffffff;
}
.form-group {
margin-bottom: 20px;
text-align: center;
}
.form-group label {
display: inline-block;
width: 100px;
}
.form-group input {
padding: 5px;
border-radius: 5px;
border: 1px solid #2c2c2c;
width: 200px;
}
.form-group input:hover {
background-color: #dddddd;
transition: 0.3s;
}
.button {
text-align: center;
}
.button input {
padding: 10px 20px;
margin-top: 20px;
background: #ffffff;
border: solid #2c2c2c;
cursor: pointer;
}
.button input:hover {
background-color: #dddddd;
transition: 0.3s;
}
</style>
</head>
<body>
<div class="container">
<h2>Login</h2>
<form action="ass5.php" method="post">
<div class="form-group">
<label for="name">Name:</label>
<input type="text" id="name" name="name" required>
</div>
<div class="form-group">
<label for="pass">Password:</label>
<input type="password" id="pass" name="pass" required>
</div>
<div class="button">
<input type="submit" value="Submit">
</div>
</form>
</div>
</body>
</html>
<?php
$user=$_POST["name"];
$password = $_POST["pass"];
if($user == "Abhay" && $password == "123"){
valid($user,$password);
}
else{
echo "Invalid Username or Password";
}
function valid($user,$password){
OUTPUT-
A.
B.