Thursday, June 28, 2018

Laws of Boolean

Truth Tables for the Laws of Boolean

Boolean
Expression
DescriptionEquivalent
Switching Circuit
Boolean Algebra
Law or Rule
A + 1 = 1A in parallel with
closed = "CLOSED"
universal parallel circuitAnnulment
A + 0 = AA in parallel with
open = "A"
universal parallelIdentity
A . 1 = AA in series with
closed = "A"
universal series circuitIdentity
A . 0 = 0A in series with
open = "OPEN"
universal seriesAnnulment
A + A = AA in parallel with
A = "A"
idempotent parallel circuitIdempotent
A . A = AA in series with
A = "A"
idempotent series circuitIdempotent
NOT A = ANOT NOT A
(double negative) = "A"
 Double Negation
A + A = 1A in parallel with
NOT A = "CLOSED"
complement parallel circuitComplement
A . A = 0A in series with
NOT A = "OPEN"
complement series circuitComplement
A+B = B+AA in parallel with B =
B in parallel with A
absorption parallel circuitCommutative
A.B = B.AA in series with B =
B in series with A
absorption series circuitCommutative
A+B = A.Binvert and replace OR with AND de Morgan’s Theorem
A.B = A+Binvert and replace AND with OR de Morgan’s Theorem

Sunday, June 24, 2018

OOP MCQ


1. Which of the following is the functionality of ‘Data Abstraction’?
a) Reduce Complexity
b) Binds together code and data
c) Parallelism
d) None of the mentioned
View Answer

Answer: a
Explanation: An essential element of Object Oriented Programming is ‘Data Abstraction’ which means hiding things. Complexity is managed through abstraction.
2. Which of the following mechanisms is/are provided by Object Oriented Language to implement Object Oriented Model?
a) Encapsulation
b) Inheritance
c) Polymorphism
d) All of the mentioned
View Answer

Answer: d
Explanation: None.
3. Which of the these is the functionality of ‘Encapsulation’?
a) Binds together code and data
b) Using single interface for general class of actions.
c) Reduce Complexity
d) All of the mentioned
View Answer

Answer: a
Explanation: ‘Encapsulation’ acts as protective wrapper that prevents code and data from being accessed by other code defined outside the wrapper.
4. What is ‘Basis of Encapsulation’?
a) object
b) class
c) method
d) all of the mentioned
View Answer

Answer: d
Explanation: Encapsulation is the mechanism that binds together code and data it manipulates, and keeps both safe from outside interface and misuse. Class, which contains data members and methods is used to implement Encapsulation.
5. How will a class protect the code inside it?
a) Using Access specifiers
b) Abstraction
c) Use of Inheritance
d) All of the mentioned
View Answer

Answer: a
Explanation: Each method or variable in a class may be marked ‘public’ or ‘private’. They are called Access Specifiers.
6. What is the output of this program?

 class Test {
     int a;
     public int b;
     private int c;
 }
 class AcessTest {
     public static void main(String args[])
     {
         Test ob = new Test();
         ob.a = 10;
         ob.b = 20;
         ob.c = 30;
         System.out.println(" Output :a, b, and c" + ob.a + " " + ob.b + " " + ob.c);
     }
}
a) Compilation error
b) Run time error
c) Output : a, b and c 10 20 30
d) None of the mentioned
View Answer

Answer: a
Explanation: Private members of a class cannot be accessed directly. In the above program, the variable c is a private member of class ‘Test’ and can only be accessed through its methods.
7. Which of the following is a mechanism by which object acquires the properties of another object?
a) Encapsulation
b) Abstraction
c) Inheritance
d) Polymorphism
View Answer

Answer: c
Explanation: ‘Inheritance’ is the mechanism provided by Object Oriented Language, which helps an object to acquire the properties of another object usually child object from parent object.
8. Which of the following supports the concept of hierarchical classification?
a) Polymorphism
b) Encapsulation
c) Abstraction
d) Inheritance
View Answer

Answer: d
Explanation: Use of Hierarchical classification avoids defining the properities of object explicitly at each level which have acquired their properties from higher levels.
9. Which Keyword from the following is used to inherit properties from one class into another?
a) extends
b) subclasses
c) native
d) all of the mentioned
View Answer

Answer: a
Explanation: None.
10. Which of the following concept is often expressed by the phrase, ‘One interface, multiple methods’?
a) Abstraction
b) Polymorphism
c) Inheritance
d) Encapsulation
View Answer

Answer: b
Explanation: None.

-----------------------------------------------------------------------------------------------------------------------

1. Which of these is a valid keyword in Java?
a) interface
b) string
c) float
d) unsigned
View Answer

Answer: a
Explanation: “String” and “Float” are class types in Java. “unsigned” is a keyword used in C/C++ but not in Java.
2. Which of these is a reserved word in Java Programming Language?
a) method
b) native
c) subclasses
d) reference
View Answer

Answer: b
Explanation: “native” is a valid keyword used to modify method declaration. The valid keyword used in Java language for subclassing is “extends” not subclasses.
3. How many reserved keywords are there in Java language?
a) 50
b) 52
c) 49
d) 45
View Answer

Answer: a
Explanation: As of Java 1.5 there are 50 keywords out of which 48 are used(const and goto keywords are unusable keywords).
4. Which of the following is a Literal Representation?
a) 100
b) ‘100’
c) Sample
d) None of the mentioned
View Answer

Answer: a
Explanation: A constant value in Java is created by using a ‘Literal Representation’ of it. Integer Literals are not enclosed in quotes where as String Literals are enclosed in quotes.
5. What are the types of comments defined by Java?
a) Single-line comment
b) Multi-line comment
c) Documentation comment
d) All of the mentioned
View Answer

Answer: d
Explanation: None.
6. Which of the following is readable by both Computer and Human?
a) Single-line comment
b) Multi-line comment
c) Documentation comment
d) All of the mentioned
View Answer

Answer: c
Explanation: Documentation comment is used to produce an HTML file that documents the given program.
7. Which of the following ‘Seperator’ is most commonly used in Java program?
a) Parenthesis
b) Braces
c) Comma
d) Semicolon
View Answer

Answer: d
Explanation: Semicolon is most commonly used in Java program, which terminates statements.
8. Which of the following is used to name class, method and variables?
a) Identifiers
b) Keywords
c) Both
d) None of the mentioned
View Answer

Answer: a
Explanation: Identifiers are used to name classes, methods and variables.
9. ‘Whitespace’ in Java language may be?
a) A space
b) A new line
c) A tab
d) All of the mentioned
View Answer

Answer: d
Explanation: None.
10. Which of the following is the output of the program?

class Test {
    public static void main(String args[])
    {
        int num = 10;
        System.out.println("The value of num is" +NUM);
    }
}
a) Compilation error
b) Run time error
c) Exception
d) The value of num is 10
View Answer

Answer: a
Explanation: Java is case-sensitive. Identifier which is used to name variable and print are different.

---------------------------------------------------------------------------------------------------------------------------

Monday, June 18, 2018

All Country and Capital


List of Countries, Capitals, Currencies, & Languages


Country
Capital(s)
Currency
Primary Language(s)
Afghanistan
Kabul
Afghani
Dari Persian; Pashto
Albania
Tirane
Lek
Albanian
Algeria
Algiers
Algerian Dinar
Arabic; Tamazight; French
Andorra
Andorra la Vella
Euro
Catalan
Angola
Luanda
Kwanza
Portuguese
Antigua & Barbuda
Saint John's
East Caribbean Dollar
English
Argentina
Buenos Aires
Argentine Peso
Spanish
Armenia
Yerevan
Dram
Armenian
Australia
Canberra
Australian Dollar
English
Austria
Vienna
Euro
German
Azerbaijan
Baku
Manat
Azerbaijani
The Bahamas
Nassau
Bahamian Dollar
English
Bahrain
Manama
Bahraini Dinar
Arabic
Bangladesh
Dhaka
Taka
Bangla
Barbados
Bridgetown
Barbadian Dollar
English
Belarus
Minsk
Belarusian Ruble
Belarusian; Russian
Belgium
Brussels
Euro
Dutch; French; German
Belize
Belmopan
Belize Dollar
English
Benin
Porto-Novo
West African CFA Franc
French
Bhutan
Thimphu
Ngultrum
Dzongkha
Bolivia
La Paz; Sucre
Boliviano
Spanish; Quechua; Aymara
Bosnia and Herzegovina
Sarajevo
Convertible Mark
Bosnian; Croatian; Serbian
Botswana
Gaborone
Pula
English; Tswana
Brazil
Brasilia
Real
Portuguese
Brunei
Bandar Seri Begawan
Brunei Dollar
Malay
Bulgaria
Sofia
Lev
Bulgarian
Burkina Faso
Ouagadougou
West African CFA Franc
French
Burundi
Bujumbura
Burundi Franc
Kirundi; French
Cambodia
Phnom Penh
Riel
Khmer
Cameroon
Yaounde
Central African CFA Franc
French; English
Canada
Ottawa
Canadian Dollar
English; French
Cape Verde
Praia
Cape Verdean Escudo
Portuguese
Central African Republic
Bangui
Central African CFA Franc

Sango; French
Chad
N'Djamena
Central African CFA Franc
French; Arabic
Chile
Santiago
Chilean Peso
Spanish
China
Beijing
Chinese Yuan
Mandarin
Colombia
Bogota
Colombian Peso
Spanish
Comoros
Moron
Comorian Franc
Comorian; Arabic; French
Democratic Republic
Of the Congo
Kinshasa
Congolese Franc
French
Republic of the Congo
Brazzaville
Central African CFA Franc
French
Costa Rica
San Jose
Colon
Spanish
Cote d'Ivoire (Ivory Coast)
Yamoussoukro; Abidjan
West African CFA Franc
French
Croatia
Zagreb
Croatian
Kuna
Cuba
Havana

Cuban Peso
Spanish
Cyprus
Nicosia
Euro
Greek; Turkish
Czechia
Prague
Czech Koruna

Czech; Slovak
Denmark
Copenhagen
Danish Krone
Danish
Djibouti
Djibouti
Djiboutian Franc
Arabic; French
Dominica
Rosesau
East Caribbean Dollar
English; French;
Antillean Creole
Dominican Republic

Santo Domingo
Dominican Peso
Spanish
East Timor (Timor-Leste)
Dilli
United States Dollar
Tetum; Portuguese;
Iindonesian
Ecuador
Quito
United States Dollar
Spanish
Egypt
Cairo
Egyptian Pound
Arabic
El Salvador
San Salvador
United States Dollar
Spanish
Equitorial Guinea
Malabo
Central African CFA Franc
Spanish; French; Portuguese
Eritrea
Asmara
Nakfa
Arabic; Tigrinya; English
Estonia
Tallinn
Estonian Kroon; Euro
Estonian
Ethiopia
Addis Ababa
Birr
Amharic
Fiji
Suva
Fijian Dollar
English; Bau Fijian; Hindi
Finland
Helsinki
Euro
Finnish; Swedish
France
Paris
Euro; CFP Franc
French
Gabon
Libreville
Central African CFA Franc
French
The Gambia
Banjul
Dalasi
English
Georgia
Tbilisi
Lari
Georgian
Germany
Berlin
Euro
German
Ghana
Accra
Ghanaian Cedi
English
Greece
Athens
Euro
Greek
Grenada
St. George's
East Caribbean Dollar
English; Patois
Guatemala
Guatemala City
Quetzal
Spanish
Guinea
Conakry
Guinean Franc
French
Guinea-Bissau
Bissau
West African CFA Franc
Portuguese
Guyana
Georgetown
Guyanese Dollar
English
Haiti
Port-au-Prince
Gourde
Haitian Creole; French
Honduras
Tegucigalpa
Lempira
Spanish
Hungary
Budapest
Forint
Hungarian
Iceland
Reykjavik
Icelandic Krona
Icelandic
India
New Delhi
Indian Rupee
Hindi; English
Indonesia
Jakarta
Rupiah
Indonesian
Iran
Tehran
Rial
Persian
Iraq
Baghdad
Iraqi Dinar
Arabic; Kurdish
Republic of Ireland
Dublin
Euro
English; Irish
Israel
Jerusalem
Shekel
Hebrew; Arabic
Italy
Rome
Euro
Italian
Jamaica
Kingston
Jamaican Dollar
English
Japan
Tokyo
Yen
Japanese
Jordan
Amman
Jordanian Dinar
Arabic
Kazakhstan
Astana
Tenge
Kazakh; Russian
Kenya
Nairobi
Kenyan Shilling
Swahili; English
Kiribati
Tarawa Atoll
Kiribati Dollar
English; Gilbertese
North Korea
Pyongyang
North Korean Won
Korean
South Korea
Seoul
South Korean Won
Korean
Kosovo
Pristina
Euro
Albanian; Serbian
Kuwait
Kuwait City
Kuwaiti Dollar
Arabic; English
Kyrgyzstan
Bishkek
Som
Kyrgyz; Russian
Laos
Vientiane
Kip
Lao (Laotian)
Latvia
Riga
Lats
Latvian
Lebanon
Beirut
Lebanese Pound
Arabic; French
Lesotho
Maseru
Loti
Sesotho; English
Liberia
Monrovia
Liberian Dollar
English
Libya
Tripoli
Libyan Dinar
Arabic
Liechtenstein
Vaduz
Swiss Franc
German
Lithuania
Vilnius
Lithuanian Litas
Lithuanian
Luxembourg
Luxembourg
Euro
German; French;
Luxembourgish
Macedonia
Skopje
Macedonian Denar
Macedonian
Madagascar
Antananarivo
Malagasy Ariary
Malagasy; French; English
Malawi
Lilongwe
Malawi Kwacha
English
Malaysia
Kuala Lumpur
Ringgit
Malay
Maldives
Male
Maldivian Rufiyaa
Dhivehi
Mali
Bamako
West African CFA Franc
French
Malta
Valletta
Euro
Maltese; English
Marshall Islands
Majuro
United States Dollar
Marshallese; English
Mauritania
Nouakchott
Ouguiya
Arabic
Mauritius
Port Louis
Mauritian Rupee
English
Mexico
Mexico City
Mexican Peso
Spanish
Federal States of Micronesia
Palikir
United States Dollar
English
Moldova
Chisinau
Moldovan Leu
Moldovan (Romanian)
Monaco
Monaco
Euro
French; Italian; English
Mongolia
Ulaanbaatar
Togrog
Mongolian
Montenegro
Podgorica
Euro
Montenegrin
Morocco
Rabat
Moroccan Dirham
Arabic
Mozambique
Maputo

Mozambican Metical
Portuguese
Myanmar (Burma)
Nypyidaw
Kyat
Burmese
Namibia
Windhoek
Namibian Dollar
English; Afrikaans; German
Nauru
Yaren
Australian Dollar
English; Nauran
Nepal
Kathmandu
Nepalese Rupee
Nepali
Fr
New Zealand
Wellington
New Zealand Dollar
English
Nicaragua
Managua
Cordoba
Spanish
Niger
Niamey
West African CFA Franc
French
Nigeria
Abuja
Naira
English
Norway
Oslo
Norwegian Krone
Norwegian
Oman
Muscat
Omani Rial
Arabic
Pakistan
Islamabad
Pakistani Rupee
Urdu; English
Palau
Melekeok
United States Dollar
English; Palauan
Panama
Panama City
Balboa
Spanish
Papa New Guinea
Port Moresby Papa
Papa New Guinean Kina
English; Tok Pisin;
Hiri Motu
Paraguay
Asuncion
Guarani
Spanish; Guarani
Peru
Lima
Nuevo Sol
Spanish
Phillipines
Manila
Phillipine Peso
Filipino; English
Poland
Warsaw
Zloty
Polish
Portugal
Lisbon
Euro
Portuguese
Qatar
Doha
Qatari Riyal
Arabic
Romania
Bucharest
Romanian Rupee
Romanian
Romania
Bucharest
Romanian Rupee
Romanian
Russia
Moscow
Ruble
Russian
Rwanda
Kigali
Rwandan Franc
Kinyarwanda; French; English