Sunday 3 May 2020

ASSIGNMENT-1 DATA REPRESENTATION





MAXFORT SCHOOL-ROHINI
CLASS-XI
SUBJECT: COMPUTER SCIENCE
ASSIGNMENT-1 DATA REPRESENTATION

Question 1:
Do as directed :
a)    Convert (259)10 to binary form.
b)    Convert (17.35)10 to binary form
c)    Convert (39286)10 to octal form.
d)    Convert (0.2)10 to the binary form.
e)    Convert (423.03125)10 to octal form.
f)     Convert Octal number 321.7 into its Binary equivalent.
Question 2:
Do as directed :
a)    Covert the Hexadecimal number 3BC into its Binary equivalent.
b)    Convert the Binary number 10011010.010101 to its Hexadecimal equivalent.
c)    Convert the Decimal number 345 into Octal number.

Question 3:
Do as directed

a)    Convert the Decimal number 736 into Hexadecimal number.
b)     Convert the Octal number 246.45 into Hexadecimal number.
c)     Convert the Hexadecimal number ABF.C into Octal number.
d)     Covert the Octal number 576 to Decimal.
e)     Convert the Hexadecimal number A5C1 to Decimal,


Wednesday 22 April 2020

ASSIGNMENT ON SQL CLASS-12 CS



 
SQL COMMANDS
ASSIGNMENTS
1. What is MySQL?
2. How is a database related to a table ?
3. Write MySql command that will be used to open an already existing database “CONTACTS”.
4. Write a SQL command to view the constraints of EMP table.
5. Mentioned two categories in which MySQL commands are broadly classified?
6. Is NULL value the same as 0 (zero)? Write the reason for your answer.
7. Write the UPDATE command to increase the commission (column name :COMM) by 500 of all the salesman who have achieved sales (Column name : SALES) more than 200000. The table’s name is COMPANY.
8. Write one similarity and one difference between CHAR and VARCHAR data types.
9. In a hospital, the patients are allocated to wards. A database named ‘Hospital’ is created. One table in this database is: WARD with WardId, WardName, NumOfBeds as columns and WardId as the primary key. Write another suitable table you could expect to see in the ‘Hospital’  database, with 3 suitable columns identifying Primary key and Foreign key in the table that you expect.
10. Which clause should be used to arrange records in a specific order?

ASSIGNMENT ON NETWORKING CLASS-12 IP




     
Assignment-1 networking
Class-12

       1.     What is the difference between E-mail and Chat?                                     
      2.      What is VOIP?                                                                                
      3.     Write two characteristics of Wi-Fi.                                                           
    4.     Write one advantages of Bus Topology of network. Also, illustrate how 4 computers can be connected with each other using star topology of network.
     5.     Give one suitable example of each URL and Domain Name.           
     6.     What is Cyber Crime?
      7.     What is WEB2.0?
      8.      Differentiate between hacking and cracking.
       9.     What are cookies?

10.                        Define web browser and web server.

     11.                        How FTP is different from HTTP?
     12.                         What is TCP/IP?
     13.                        What is protocol? Name some commonly used protocols.
     14.                        Briefly explain file transfer protocol.
     15.                        What factors should be taken into consideration while opting for a particular topology?

Thursday 9 April 2020

File Attributes and Stream In File Handling (Python)




FILE I/O ATTRIBUTES

Various attributes are related to file when it is opened or closed.
Those attributes are explained in the table:

Attribute
Description
name
Returns the name of the file (Including path)
mode
Returns mode of the file. (r or w etc.)
encoding
Returns the encoding format of the file
closed
Returns True if the file closed else returns False

For Example:
f = open("D:\\story.txt", "r")
print("Name of the File: ", f.name)
print("\n File-Mode : ", f.mode)
print("File encoding format : ", f.encoding)
print("Is File closed? ", f.closed)
f.close()
print("Is File closed? ", f.closed)
OUTPUT:
Name of the File: D:\story.txt
File-Mode : r
File encoding format : cp1252
Is File closed? False
Is File closed? True


Relative and Absolute Paths :
We all know that the files are kept in directory which are also known as folders.
 Every running program has a current directory. Which is generally a default directory and python always see the default directory first.
The absolute paths are from the topmost level of the directory structure. The relative paths are relative to the current working directory denoted as a dot(.) while its parent directory is denoted with two dots(..).
OS module provides many such functions which can be used to work with files and directories. OS means Operating System.
Function used to find the current directory
getcwd( ) is a function which can be used to identify the current working directory.

For this : You have to import os module
For example,
>>> import os         # importing os module
>>> cwd=os.getcwd()       # getcwd function will return the path and store in cwd variable
>>> print(cwd)       # printing current path
OUTPUT
C:\Users\dell\AppData\Local\Programs\Python\Python37-32

STANDARD FILE STREAMS :
Standard file streams are realted to standard input and output device. Keyboard is a standard input device. Monitor/screen is a standard ouput device. Similarly, any error occurs is also displayed on a screen. So the monitor is also standard error device. That is,
Standard input device(stdin)    -           reads from keyboard
Standard output device(stdout)          -           prints on screen
Standard error device(stderr)  -           prints error on screen
In python. These devices are implemented as files known as standard streams.

To read data from the keyboard and to write data on a screen, we have to import module sys such as:
import sys
for reading, use function: sys.stdin.read()
for writing, use function: sys.stdout.write()
for writing error, use function : sys.stderr.write()
For example,
Reading and writing using stdin and stdout
import sys
f=open("book1.txt","r+")
ch=sys.stdin.read(3)         #whatever is read from the keyboard, return 3                         
                                              # characters from keyboard file and store in variable ch
print(ch)
sys.stdout.write(ch)
sys.stdin.read(5)
sys.stderr.write("\nNo errors occured\n")

import sys
f=open("book1.txt")
line1=f.readline()
line2=f.readline()
line3=f.readline()
sys.stdout.write(line1)
sys.stdout.write(line2)
sys.stdout.write(line3)
sys.stderr.write("\nNo errors occured\n")
f.close()

OUTPUT
welcome to python.          # written by keyboard
wel                                         # read 3 characters from stdin
No errors occurred                        # printing message
delhi is a capital of India.
delhi is a vast city
delhi has more than 1 crore population
No errors occured

Friday 3 April 2020

ASSIGNMENT ON SQL QUERIES





SUBJECT: INFORMATICS PRACTICES
ASSIGNMENT-1
TOPIC: SQL QUERIES

Q1. Consider the table Hospital given below and write commands in SQL for (i) to (xii)
 Hospital
No
Name
Age
DEPARTMENT
DateOfAdm
Charges
Sex
1
Sandeep
64
Surgery
23/02/98
300
M
2
Ravina
24
Orthopedic
20/01/98
200
F
3
Karan
45
Orthopedic
10/02/98
200
M
4
Tarun
12
Surgery
01/01/98
300
F
5
Zubin
36
ENT
12/01/98
250
M
6
Ketaki
16
ENT
12/02/98
300
F
7
Ankita
29
Cardiology
20/02/98
800
F
8
Zareen
45
Gynecology
22/02/98
Null
F
9
Kush
19
Cardiology
13/01/98
800
M
10
Shailya
31
Medicine
19/02/97
400
F

(i)    To show all information about the patients of cardiology department.
(ii)    To list the names of female patients who are in orthopaedic department.
(iii)   To display Patient’s name, charges, Age for  male and female patients.
(iv)  To count the number of patients with Age > 30.
(v)    Increase the charges of male patient in ENT department by 3%.
  (vi) Add another column email_id with suitable data type.
  (vii) Delete the records of all female patients in Surgery department.
  (viii)Display a report listing name, age, charges and amount of charges including VAT as 2%  on charges name the column as total charges and keep the data in ascending order of name.
  (ix)To display the difference of highest and lowest charges of each department having maximum charges more than 300.
  (x) Find out the details of patients whose age  is same or more than that of patient whose hospital charges are maximum.
 (xi)Display the details of all the patients who are hospitalised in 1998.
 (xii)Display the charges of various departments .A charge amount should appear only once.  
Find out the  output for SQL commands (xiii) to (xvi).
  (xiii)SELECT COUNT(DISTINCT  Department) FROM HOSPITAL ;
  (xiv)SELECT MAX(Age) FROM HOSPITAL  WHERE SEX=’M’;
  (xv)SELECT AVG(Charges) FROM HOSPITAL  WHERE SEX=’F’;
  (xvi)SELECT SUM(Charges) FROM HOSPITAL  WHERE DATEOFadm < ’12/08/98’ ;
Q2.
(a)
Write an SQL command for creating a table student whose structure is given below:
FIELD NAME
DATATYPE
SIZE
CONSTRAINT
Rno
Number
3
Part of Primary Key
Class
Varchar
5
Part of Primary Key
Percentage
Number
5,2
>0 and <=100
Projno
Number
6
FK –Project(pno)
Address
Varchar
30
Default Hyderabad
            


(b) The Title and Price columns of table “Library” are given below:
TITLE                      PRICE
Mastering C++     295
Guide Network   300
Mastering SQL     450
Dos GUIDE            400
Basic for beginners  299
Mastering Window  Null
Based on this information ,find the output of the following queries:
(a)    SELECT MIN(Price)from library;
(b)   SELECT COUNT(Title) from library WHERE Price < 150;
(c)    Select  AVG(price) from library WHERE title like ‘%e%’;
(d)   Select title from library where price = (select max(price) from library);  
                                                                                         

(c)    A table ACCOUNT in a database has 3 columns and 30 rows. The DBA has added 3 more columns and 50 more rows to the table. But the table has about 15 records where balance is null. What is the degree and cardinality of this table now ?