0% found this document useful (0 votes)
2 views4 pages

Grade 8 Practical Programming Tasks

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

Grade 8 Practical Programming Tasks

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

Grade 8

Practical Programs
Note: Prepare these practical programs for Final Term Practical
Exam
1. Write an HTML code to create a Registration Form.
<Html>
<head>
<title>
Registration Page
</title>
</head>
<body bgcolor="Lightskyblue">
<br>
<br>
<form>

<label> Firstname </label>


<input type="text" name="firstname" size="15"/> <br> <br>
<label> Middlename: </label>
<input type="text" name="middlename" size="15"/> <br> <br>
<label> Lastname: </label>
<input type="text" name="lastname" size="15"/> <br> <br>

<label>
Course :
</label>
<select>
<option value="Course">Course</option>
<option value="BCA">BCA</option>
<option value="BBA">BBA</option>
<option value="[Link]">[Link]</option>
<option value="MBA">MBA</option>
<option value="MCA">MCA</option>
<option value="[Link]">[Link]</option>
</select>

<br>
<br>
<label>
Gender :
</label><br>
<input type="radio" name="male"/> Male <br>
<input type="radio" name="female"/> Female <br>
<input type="radio" name="other"/> Other
<br>
<br>

<label>
Phone :
</label>
<input type="text" name="country code" value="+91" size="2"/>
<input type="text" name="phone" size="10"/> <br> <br>
Address
<br>
<textarea cols="80" rows="5" value="address">
</textarea>
<br> <br>
Email:
<input type="email" id="email" name="email"/> <br>
<br> <br>
Password:
<input type="Password" id="pass" name="pass"> <br>
<br> <br>
Re-type password:
<input type="Password" id="repass" name="repass"> <br> <br>
<input type="button" value="Submit"/>
</form>
</body>
</html>

2. Write a program to illustrate the use of include function.


3. Write a program to perform a connection to MySQL.

4. Write the sql queries:


 Create database school;
 Use school;
 Create table student(Rollno int(10) auto_increment,name
varchar(20),marks int(10), primary key(Rollno));
 Insert into student values(12,”harsh”,72);
 Insert into student(name,marks) values(“Ravi”,82);
 Select * from student;
 Update student set marks=63 where rollno=12;
 Delete from student where marks<70;
 Select name from student;

Common questions

Powered by AI

'auto_increment' is significant in SQL as it automatically generates a unique value for a column, typically used for primary key fields. In a student records table, it ensures each 'Rollno' is unique and sequential without manual input, facilitating data integrity and simplification of data entry processes .

A textarea element in an HTML form allows users to input multi-line text, which is often needed for inputs like addresses where single-line text inputs are insufficient. Its inclusion enhances the form's usability as it captures more detailed user information, aligning with user experience best practices .

Essential tags for aesthetic alignment include <label> and form field tags wrapped in <div> or <fieldset> for layout, styled with CSS. For accessibility, using 'for' attributes in <label> tags to connect labels with inputs, employing <legend> for fieldsets, and including 'aria' attributes enhance both aesthetic and accessibility standards .

A programmatic connection to a MySQL database can be established using connection strings in programming languages like PHP or Java, often requiring host, database, username, and password information. This connectivity is crucial for dynamic web applications that rely on database operations for data persistence, retrieval, and manipulation .

Radio buttons are employed when selecting a single option from a list, such as specifying gender. Implementing them requires grouping by the same 'name' attribute to ensure only one can be selected. They enhance user experience by providing clear options and simplifying data entry while ensuring precise data capture for categorical fields .

HTML input types like 'email' and 'password' inherently perform basic validation and data formatting checks, improving form accuracy. 'Email' ensures a valid format, while 'password' masks input, reducing exposure of sensitive data. These choices enhance security, though they should be complemented by server-side validations for comprehensive security .

The SQL 'UPDATE' statement modifies existing records within a table by setting new values for specified columns, based on a condition defined in a 'WHERE' clause. It is useful for maintaining and adjusting database records as it allows for granular changes without affecting unconditioned data .

Using 'DELETE' with a condition, such as deleting students with marks below 70, removes specific records based on criteria. Its implication is data integrity control, as it helps maintain a dataset's quality by excluding outliers or irrelevant records while permanently removing such data, which is irreversible .

Validating user input in an HTML registration form ensures data entered by users meets required formats and constraints, improving data integrity and user experience. Neglecting validation can lead to malformed data entry, security vulnerabilities such as SQL injection, and a poor user interaction experience .

HTML allows the creation of structured forms through the use of various tags and attributes that define the form fields and layout. An example is the registration form which uses <form> tags to encompass all elements, <label> tags to describe fields, and input fields for text, email, and password entries. Dropdown menus and radio buttons are facilitated by <select> and <input type='radio'> tags, providing structured user interaction elements .

You might also like