Search This Blog

Monday 19 September 2022

Unit-1 - Contributions Of Notable Leaders - Text Book Exercise - Unit 1.2 - 1.6

Go To Index
Unit-1 - Contributions Of Notable Leaders
TEXT BOOK EXERCISE
UNIT 1.2 - 1.6

UNIT 1.2
ORAL COMMUNICATION

Express Agreement And Disagreement

Here are some possible words that can be used to express agreement and disagreement:
Words for expressing agreement Words for expressing disagreement
 I think I don't think
 I believe I can’t believe / I don’t believe
 I agree I can't agree / I don't agree
 makes sense this doesn't make sense
 that's right that’s not right

Exercise 1:

Three friends, Amina, Hina, and Mariam, were discussing the spread of diseases in their area and the problems that people were facing. A reporter was noting down the points but, except for the first point, all other points got mixed up. Work in groups of three, organise these points by assigning to the respective speakers, and write them in your notebooks.
Amina: It is a good idea to take medicines at home rather than go to the doctor.
Hina: Yes, I agree with you. The doctors charge you a lot of money.
Mariam: I don't think it is always a good idea to treat yourself.
Amina: Many illnesses can be managed at home without wasting time and money.
Hina: ________________________
Mariam: ______________________

The mixed up points are as follows:
  1. I believe that the medicines that my parents and grandparents give me are better than those given by doctors.
  2. Well, health is the most important thing in life so we should do all we can to protect it.
  3. Some people say that most illnesses go away after a while.
  4. This doesn't make sense to me, but I'll go with your idea.
  5. I don't agree. I think that the medicines that the doctors give us lead to other problems.
  6. Yes, that makes sense.
  7. I think we should see a doctor if we have any health problem for more than two or three days. 
  8. This doesn't make sense to me. Many diseases, if not treated properly and on time, can lead to bigger problems and more expenses.
Ans: Dialogues To Visit doctor
Amina: It is a good idea to take medicines at home rather than go to the doctor.
Hina: Yes, I agree with you. The doctors charge you a lot of money.
Mariam: I don't think it is always a good idea to treat yourself.
Amina: Many illnesses can be managed at home without wasting time and money.
Hina: I believe that the medicines that my parents and grandparents give me are better than those given by doctors.
Mariam: I think we should see a doctor if we have any health problem for more than two or three days.
Amina: Some people say that most illnesses go away after a while.
Hina: Yes, that makes sense.
Mariam: This doesn't make sense to me. Many diseases, if not treated properly and on time, can lead to bigger problems and more expenses.
Amina: I don't agree. I think that the medicines that the doctors give us lead to other problems.
Hina: This doesn't make sense to me, but I'll go with your idea.
Mariam: Well, health is the most important thing in life so we should do all we can to protect it.

Exercise 2:

After you have written the dialogues, each one of you should take on one role, i.e., one takes the role of Amina, one of Hina, and one of Mariam. Now, orally practise these dialogues following these sequence:
 Sequence 1:  student 1 Amina  |  student 2 Hina   |  student 3 Mariam
Sequence 2:  student 1 Mariam  |    student 2 Amina  |  student 3 Hina
Sequence 3:  student 1 Hina  |  student 2 Mariam  |  student 4 Amina

Ans: Students will learn learn above dialogues and will practice in group mention as sequence 1, sequence 2, sequence 3.

Exercise 3:

Working in the same groups of three, prepare a brief dialogue (two to three dialogues per person), on one of the following topics, as directed by the teacher. You will have to role play your dialogue in front of the class. Topics
1. All students should study up to the Masters' level.
2. All of us should grow our own vegetables.
3. All of us should stop eating meat.
4. All people working in offices should wear uniforms.
5. No animals should be allowed on the roads.

Ans:


By Mrs. Ayesha Arif
(Jauhar Progressive School)

UNIT 1.3
LANGUAGE PRACTISE

Revision: Capitalization and Punctuation

Exercise 1:

Rewrite the following sentences in your notebook by correcting the errors of capitalization.
1. the mausoleum of shah abdul latif bhittai is in sindh.
Ans: The mausoleum of Shah Abdul Latif Bhittai is in Sindh.

2. sameer and ali went to quetta last july.
Ans: Sameer and Ali went to Quetta last July.

3. the river indus flows from gilgit baltistan to the arabian sea.
Ans: The river Indus flows from Gilgit, Baltistan to the Arabian sea.

4. the liaquat national hospital is on stadium road in karachi.
Ans: The Liaquat National Hospital is on Stadium road in Karachi.

5. “are zahra and samina coming today?“ asked mrs afzal.
Are Zahra and Samina coming today?“ asked Mrs. Afzal.

6. the highest peak, mount everest, is in the himalayan ranges, in nepal.
Ans: The highest peak Mount Everest is in the Himalayan ranges in Nepal.

7. we are planning to go to islamabad in march to see the faisal mosque.
Ans: We are planning to go to Islamabad in March to see the Faisal Mosque.

8. he said, "my uncle’s name is asif sheikh and he lives in london.”
Ans: He said, "My uncle’s name is Asif Sheikh and he lives in London.”

Exercise 2:

Insert commas, full stops, question marks and exclamation marks in appropriate places. Write the corrected sentences in your notebook. After you have completed, compare your answers with your partner and make corrections where needed.

1. The helping group needs clothes food water blankets and shoes for the flood victims
Ans: The helping group needs clothes, food, water, blankets and shoes for the flood victims.

2. Hurrah Pakistan has won the world cup We must meet celebrate enjoy and have fun
Ans: Hurrah! Pakistan has won the world cup. We must meet, celebrate, enjoy and have fun.

3. Nevertheless some people are talking some are resting some are reading and some are having fun
Ans: Nevertheless, some people are talking, some are resting, some are reading and some are having fun.

4. “Have you finished your home work” his mother asked
Ans: “Have you finished your home work?” his mother asked.

5. Alas the old man is dead He suffered a lot
Ans: Alas! the old man is dead. He suffered a lot.

6. The teacher said ”Where is your bag ” “I don’t know” said Sabah “I just keep it here”
Ans: The teacher said, ”Where is your bag?” “I don’t know,” said Sabah. “I just keep it here.

7. Moreover I have seen his picture in magazines on television and in movies
Ans: Moreover, I have seen his picture in magazines, on television and in movies.

8. Chuck chuck chuck The train began moving out of station therefore the people started running
Ans: Chuck, chuck, chuck. The train began moving out of station, therefore, the people started running.

9. Wow This is a pleasant surprise Why didn’t you tell me you were coming
Ans: Wow! This is a pleasant surprise. Why didn’t you tell me you were coming?

10. “Your book has been lying on this table for ten days” said Mr Jawad ”When will you read it”
Ans: “Your book has been lying on this table for ten days," said Mr Jawad. ”When will you read it?

Exercise 3:

Insert apostrophes and quotation marks where needed. Write the corrected sentences in your notebook. After you have completed, compare your answers with your partner and make corrections where needed.
1. This book isn’t mine, said Abdul Karim. I dont know who put it here.
Ans: This book isn’t mine, said Abdul Karim. I dont know who put it here."

2. Can we go to sea side, father? the children asked. Its such a lovely day.
Ans: Can we go to sea side, father? The children asked. Its such a lovely day.”

3. The girls father said, Ill take you to school today. Its still early and well reach in time.
Ans: The girls father said, Ill take you to school today. Its still early and we’ll reach in time.

4. Mother said, Wholl help me clean the house? I cant said Laila Ive got to write an essay.
Ans: Mother said, Who 'll help me clean the house? I cant, said Laila. Ive got to write an essay.

5. Ive seen this movie before. Whats its name? said Fakhir. I don’t know, replied Asad.
Ans: Ive seen this movie before. What’s its name? said Fakhir. I dont know, replied Asad.

6. Sabiha, said Rana, arent we going to Hyderabad today? No, said Sabiha, im not feeling well.
Ans: Sabiha,” said Rana, Arent we going to Hyderabad today?” “No, said Sabiha, Im not feeling well.

7. This is Najmas house, said Nabila. Ive been here before. However, the gates colour has been changed.
Ans: This is Najmas house, said Nabila. " Ive been here before. However, the gates colour has been changed.

8. Hurry up, lets go, children, said grandfather. Put on your shoes. Were already late. I don’t want to miss the bus.
Ans: Hurry up, lets go, children," said grandfather. Put on your shoes. Were already late. I dont want to miss the bus.

Exercise 4:

Put in punctuation marks, including capitalization and write the following passage in your notebooks.
one day rashid said to his friends you know what i read in the newspaper that yellow house near our school is haunted
ghosts said sajjad i dont believe in ghosts
sara however said i believe in ghosts and im sure that all of you believe in ghosts really if you dont believe in them i challenge you to spend the night in that house
what you must be joking said javed
no im said serious prove it to me that you dont believe in ghosts by staying there tonight or else ill tell everyone thet youre cowards
all right said rashid ill do it wholl come with me i can depend on you asad cant i will you come javed can i rely on you coming with me
ghufran tahir asad and javed all agreed to go they decided to meet at eight o clock javed said ive got to complete my homework before i go please wait for me im late i dont want to go alone
surprise surprise said Rashid when they met outside the house at 8 o clock look whos here
theres no one else here said javed what do you mean
i mean shahid didnt you just see him go in
i didnt see anyone tahir ghufran javed and asad replied together
do you think we should go in said javed


Ans:
One day Rashid said to his friends , ”You know what I read in the newspaper, that yellow house near our school is haunted.”
“Ghosts!” said Sajjad ,”I don’t believe in ghosts.
Sara however, said , ”I believe in ghosts and I’m sure that all of you believe in ghosts.  Really, .if you don’t believe in them, I challenge you to spend the night in that house.”
“What! you must be joking,’’ said Javed.
“No, I’m serious,” said Sara. “ Prove it to me that you don’t believe in ghosts by staying there tonight or else I’ll tell everyone that you’re cowards.”
“All right,  said Rashid. “I ’ll do it. Who’ll come with me. I can depend on you Asad, can’t I? Will you come Javed? Can I rely on you, coming with me?”
Ghufran, Tahir, Asad and Javed,   all agreed to go. They decided to meet at eight o‘clock.
Javed
said, ” I’ve got to complete my homework before I go. Please wait for me, I’m late. I don’t want to go alone.”
“Surprise! surprise”! said Rashid, when they met outside the house at 8 o’clock. ”Look, who’s here?”
“There’s no one else here,”  said Javed. ”What do you mean?” “I mean, Shahid didn’ t you just see him go in?”
“I didn’ t see anyone,” Tahir, Ghufran , Javed and Asad replied together.
“Do you think we should go in?” said Javed.

PREFIXES AND SUFFIXES

ROOT WORD PREFIX SUFFIX
 The most basic part of a word. It is placed before the root word. Adding it to the beginning of a word changes it into another word and meaning. It is placed after the root word. Adding it to the ending of a word changes it into another word and meaning.

Exercise 5:

Work in pairs and form words given in the table by adding common prefixes and suffixes, respectively. Example have been done in both the tables.
Add prefixes (dis,im, un, pre, mis, ab, non,in,ir, mis,il)
Word Prefix+word
PayPrepay
OrderDisorder
ObeyDisobey
FormalInformal
UseMisuse
HonestDishonest
CertainUncertain
NormalAbnormal
LogicalIllogical
RegularIrregular
PoliteImpolite
UnderstandMisunderstand
SuccessfulUnsuccessful
ConsciousUnconscious
PossibleImpossible
UsualUnusual
SelfishUnselfish
literateIlliterate
MortalImmortal
EasyUneasy
LegalIllegal
appearDisappear
PleasantUnpleasant
bearableUnbearable
fortunatelyUnfortunately
relevantIrrelevant
OfficialUnofficial
SenseNonsense
AgreeDisagree
HappyUnhappy

Add suffix (ish, al,ful,en,ness,ment,able,hood,ive,ion)
Note: In most words ending in 'e' the ending 'e' is dropped before adding the suffix, as shown in the word 'survive' in the table below:
Word Word+suffix Word Word+suffix
ChildChildish/
childhood
StrengthStrengthen
PowerPowerfulResponseresponsive
PollutePollutionExciteExcitement
SuggestSuggestionAgreeAgreement/
agreeable
MotherMotherhoodRelate
Relation/
relatable
HelpHelpfulKindKindness
AccidentAccidentalSurviveSurvival
AchieveAchievementShameShameful
EnjoyEnjoyment/
enjoyable
ComfortComfortable
AttractAttractionSadSadness/
Sadden
ReflectReflectionEmployEmployment
SaltSaltishRejectRejection
ProductProductionInformInformation
EquipEquipmentImproveImprovement
AmuseAmusementCheerCheerful

Exercise 6:

Add prefixes or suffixes to the words given in brackets and fill in the blanks. Write the complete sentences in your note book:
1. My father was feeling uneasy due to severe pain. (easy)
2. His seat on the train was very comfortable.(comfort)
3. Mr. Moeen is very irregular and is often absent from his office. (regular)
4. His childish behaviour bothered everyone. (child)
5. There is a lot of pollution in our country. (pollute)
6. We must show kindness to every one, especially the old and the weak. (Kind)
7. All survived in the horrible accident, but unfortunately the driver was killed. (fortunate)
8. Reflection of the sunlight in the mirror disturbed me when I was driving. (reflect)
9. Rejection from the national hockey team was unbearable for me. (reject, bearable)
10. The information given by the team member was informal. (inform, formal)

Exercise 7:

Work in pairs and add prefix and suffix to the same root word. Then write a sentence using each word. The first one has been done as an example.
S.NO. Form Words Sentences
1. Root wordPay The business man promised to pay all the debt.
Or
 The receive their pay on the last day of a month.
 Prefix+rootPre pay I have bought a prepaid sim for my mobile phone
 Suffix+rootpay ment He has cleared all the payments before leaving the office.
2. Root wordHappy He wants to live a happy life.
 Prefix+rootUn happy Saima is always unhappy with her circumstances.
 Suffix+rootHappi ness All the money of the world cannot buy happiness.
3. Root wordAgree I agree to his plan of picnic.
 Prefix+rootDis agree The government officials disagree to his suggestions.
 Suffix+rootAgree ment The government has reached an agreement with the members of civil society over the electricity problem.
4. Root wordOrder We should obey the orders of our teachers
 Prefix+rootRe order He re ordered the books for his friends.
 Suffix+rootdis order The whole room was in disorder.
5. Root wordUse We should use all the available resources to complete our project.
 Prefix+rootRe use The plastic bottles should be re used to avoid pollution.
 Suffix+rootuse less All his efforts to find his lost book were useless.
6. Root wordRespect We should respect our elders.
 Prefix+rootDis respect We should not disrespect anyone.
 Suffix+rootRespect able Mr Ahmed is a very respectable man.
7. Root wordComfort I take care of my Parents comfort always.
 Prefix+rootdis comfort Steve had some discomfort, but no real pain.
 Suffix+rootComfort able That chair is very comfortable, we should buy it.


Source: Special Thanks To Sir Syed Arif Ali


Sunday 18 September 2022

Two letters words A-Z- Scrabble Game Valid Vocabulary From All Dictionaries

GO TO INDEX
Scrabble Game Valid Words From All Dictionaries
'2' letters words

Two Letters Words

A-Z

A F N U
AaFaNaUg
AbFeNeUh
AdFyNoUm
Ae-NuUn
AgGNyUp
AhGi-Ur
AiGoOUs
AlGuObUt
Am-Od-
AnHOeW
ArHaOfWe
AsHeOhWo
AtHiOi-
AwHmOkX
AxHoOmXi
Ay-OnXu
-IOo-
BIdOpY
BaIfOrYa
BeInOsYe
BiIoOwYo
BoIsOxYu
ByItOy-
---Z
CJPZa
ChJaPaZe
-JoPeZo
D-Pi-
DaKPo-
DeKa--
DiKiQ-
DoKoQi-
-Ky--
E-R-
EaLRe-
EdLa--
EeLiS
EfLoSh-
Eh-Si-
ElMSo-
EmMaSt-
EnMe--
ErMiT-
EsMmTa-
EtMoTe-
EwMuTi-
ExMyTo-


Four letters words From 'A' - Scrabble Game Valid Vocabulary From All Dictionaries

GO TO INDEX
Scrabble Game Valid Words From All Dictionaries
'4' letters words

Four Letters Words Start From 'A'

A
AahsAlaeArba
AalsAlaiArbs
AapaAlanArch
AapsAlapArco
AbacAlarArcs
AbasAlasArds
AbbaAlayArea
AbbeAlbaAred
AbbsAlbeAreg
AbedAlbsAres
AberAlcoAret
AbetAlecArew
AbidAleeArfs
AbleAlefArgh
AblyAlefAria
AbosAlewArid
AbriAlfaAril
AbutAlfsAris
AbyeAlgaArks
AbysAlgoArle
AcaiAliaArms
AccaAlifArmy
AcedAlitArna
AcerAlkoArow
AcesAlkyArpa
AcheAllaArre
AchyAllsArse
AcidAllyArsy
AcmeAlmeArti
AcneAlmsArts
AcreAlodArty
AcroAloeArum
ActaAlooArvo
ActoAlowAryl
ActsAlpsAsar
AcylAlso Asci
AdawAltoAsea
AddaAltsAshy
AddsAlumAsks
AddyAlusAsps
AditAmahAtap
AdosAmasAtes
AdryAmboAtma
AdvtAmenAtoc
AdzeAmesAtok
AeonAmexAtom
AeroAmiaAtop
AeryAmidAtua
AescAmieAtus
AfarAminAuas
AffyAmirAufs
AfroAmisAugh
AgalAmlaAuks
AgarAmmaAula
AgasAmmoAuld
AgedAmokAune
AgeeAmpsAunt
AgenAmusAura
AgerAmylAuto
AgesAnalAval
AghaAnanAvas
AginAnasAvel
AgioAnceAver
AgluAndsAves
AglyAnesAvid
AgmaAnewAvis
AgogAngaAvos
AgonAnilAvow
AgroAnisAway
AgueAnkhAwdi
AhedAnnaAwed
AhemAnnoAwee
AhisAnnsAwer
AhoyAnoaAwes
AiasAnonAwfy
AidaAnowAwks
AideAnsaAwls
AigaAntaAwns
AilsAnteAwny
AimsAntiAwol
AineAntsAwry
AinsAnusAxal
AintApayAxed
AirnApedAxel
AirsAperAxes
AirtApesAxil
AiryApexAxis
AitsApodAxle
AituAposAxon
AjarAppsAyah
AjeeApptAyes
AjisApseAyin
AkasApsoAyre
AkedAptsAyus
AkeeAquaAzan
AkesArakAzon
AkinArarAzym




سبق نمبر 27: نواۓ سروش (نظم) - درسی کتاب کی مشق - Gulzaar E Urdu - Compulsory (NEW BOOK - 2022 and onward) - Cass XI 1st Year) For All Groups

GO TO INDEX
(سبق نمبر 27: نواۓ سروش (نظم
درسی کتاب کی مشق


By Farabi Publishers Guide Book




سبق نمبر 27: نواۓ سروش (نظم) - اشعار کی تشریحات - Gulzaar E Urdu - Compulsory (NEW BOOK - 2022 and onward) - Cass XI 1st Year) For All Groups

GO TO INDEX
(سبق نمبر 27: نواۓ سروش (نظم
اشعار کی تشریحات


By Farabi Publishers Guide Book




احسان دانش کی شاعری پر تبصرہ - Ahsaan Danish - Urdu (Compulsory) For HSC - Part 1 & 2

Go To Index HSc Part 1

Go To Index HSc Part 2
احسان دانش کی شاعری پر تبصرہ


By Farabi Publishers Guide Book




سبق نمبر 26: مرد مسلماں (نظم) - درسی کتاب کی مشق - Gulzaar E Urdu - Compulsory (NEW BOOK - 2022 and onward) - Cass XI 1st Year) For All Groups

GO TO INDEX
(سبق نمبر 26: مرد مسلماں (نظم
درسی کتاب کی مشق


By Farabi Publishers Guide Book




Wednesday 14 September 2022

UNIT 03: INPUT/OUTPUT HANDLING IN C++ - Question Answers - Computer Science For Class X

GO TO INDEX

Computer Science For Class X
Unit 03: Input / Output Handling In C++
Question Answers



Q.1: Describe basic structure of C++ program.
Ans: BASIC STRUCTURE OF C++ PROGRAM:
C++ is mainly divided in three parts:
  1. Preprocessor directive
  2. Main Function Header
  3. Body of program / Function

Basic Structure of C++ program is given below:


Q.2: Describe elements of basic structure.
Ans: EXPLANATION OF BASIC STRUCTURE:
1. #include<iostream>:
The statement starts with # symbol is called preprocessor directives. This statement tells preprocessor to include contents of "iostrearm" header file in the program before compilation. This file is required for input-output statements.

2. using namespace std;:
This statement is used to instruct compiler to use standard namespace. A namespace is a declarative location that provides a space to the Namespace std contains all the classes, objects and functions of the standard C++ library.

3. int main():
This statement is a function and used for the execution of C++ program. Int means it returns integer type value.

4. {:
This symbol represents the start of main function.

5. statements;:
Statements are instructions that performs particular task. Statement terminator (;) is used to end every statement in C++ program.
6. return0;:
This statement is used to return the value to the operating system. By default, main function returns integer value 0.

7. }:
This symbol represents the end of main function.

Q.3: Define comments in C++. Also define its types.
Ans: COMMENTS IN C++:
Comments are special remarks that helps to understand different parts of the code in C++ program. Comments are ignored by the compiler. In C++, there are two types of comments statement.

  1. Single line Comment
  2. Multi line Comment

Q.4: Define single line comment in C++.
Ans: SINGLE LINE COMMENT:
This type is used to write single line comment. Double slash (//) symbol is used at the start of each single line comment.

Example:

  // This is my first C++ program
 // This program displays a statement on screen
 #include<iostream>:
 int main( )
 {
 puts("My First C++ Program");
 return 0;
 }



Q.5: Define multi line comment in C++.
Ans: MULTI LINE COMMENT:
This type is used to write multi line comment. Symbols (/*and*) are used at the start and end of comment statements.

Example:

 /*This is my first C++ program
 This program display a statement on screen.*/
 #include<iostream>
 int main()
 {
 puts("My First C++ Program");
 return0:
 }



Q.6: What do you mean input / output statement in C++.
Ans: INPUT / OUTPUT STATEMENTS IN C++:
Input and output statements are used to perform input & output operations in C++. These input / output statements are stored in header files like <iostream>. At the beginning of every program these header files must be included.

Q.7: Define output functions or statements in C++. Define cout statement and puts statement with syntax and example in C++.
Ans: OUTPUT FUNCTION / STATEMENT IN C++:
cout STATEMENT:
cout stands for "Character Output". In C++, cout sends formatted output to standard outputdevices, such as the screen. cout bject is used along with the insertion operator (<<) for displaying output.

Syntax

   cout << variable; or cout << exp. / string;

Example:

 cout << This is C++ Programming';
 cout << num1;



puts() STATEMENT:
This function is used to print the string output. After printing the screen new line is automatically inserted.

Syntax:

 puts("string constant");


Example:

 puts("This is C++ Programming");


Q.8: Define input functions or statements in C++.
Ans: INPUT FUNCTIONS / STATEMENT IN C++:
Following are the input functions / statement in C++:
  • cin STATEMENT
  • getchar() STATEMENT
  • getch() STATEMENT
  • getche() STATEMENT
  • gets() STATEMENT

Q.9: Define cin statement with syntax and example in C++.
Ans: cin STATEMENT:
cin stands for "Character Input". In C++, cin reads formatted data as input from keyboard. cin object is used along with the extraction operator (>>) to accept data from standard input device.

Syntax:

 cin >>variable;


Example:

 #include<iostream>
 using namespaces std;
 int main()
 {
 int b;
 cin >> // cin takes input in "b" variable
 return0;
 }



Q.10: Define getchar() statement with example in C++.
Ans: getchar() STATEMENT:
The getchar() function reads the available character from the keyboard. This function reads only single character at a time. When the user presses the key. getchar() requires Enter key to be pressed. This function is defined in <stdio.h> header file.

Example:

 #include<iostream>
 using namespace std;
 int main()
 {
 char b;
 cout << "\n Enter a character,";
 b = getchar();
 cout << "\n Input character is" << b;
 return 0;
 }



Q.11: Define getch() statement with example in C++.
Ans: getc() STATEMENT:
The getch() function reads the character from the keyboard. This function reads only single character and not printed on the screen. This function takes input and does not requires Enter key to pressed. This function is defined in <conio.h> header file.

Example:

 #include<iostream>
 #include<conio.h>
 using namespace std;
 int main()
 {
 char ch;
 cout << "\n Enter a character";
 ch = getch();
 cout << "\n Input character is "<<ch;
 return0;
 }



Q.12: Define getche() statement with example in C++.
Ans: getche() STATEMENT:
The getche() function reads the character from the keyboard and echoes on the screen. It reads only single character and displays on the screen. This function takes input and does not require Enter key to be pressed. This function is defined in <conio.h> header flle.

Example:

 #include<iostream>
 #include<conio.h>
 using namespace std;
 int main()
 {
 char ch;
 cout << "\n Enter a character:";
 ch = getche();
 cout << "\n Input character is" << ch;
 return0;
 }



Q.13: Define gets() statement with syntax and example in C++.
Ans: gets() STATEMENT:
This function is used to reads characters or the string input and stored them until a newline character found. This function is defined in <conio.h> header file.

Syntax:

 gets("variable");


Example:

 #include<iostream>
 #include<conio.h>
 using namespace std;
 int main()
 {
 char name {25};
 cout << "\n Enter your name:";
 gets(name);
 cout << "\n Your Name is"<< name;
 return0;
 }



Q.14: What is statement terminator?
Ans: STATEMENT TERMINATOR (;):
In C++, statement terminator used to end the statement. Statements are terminated with semicolon (;) symbol. Every statement in C++ must be terminated otherwise an error message will occur.

Q.15: Write down in detail about escape sequences in C++.
Ans: ESCAPE SEQUENCES:
Escape sequences are used to control the cursor moves on screen by using special codes. An escape sequence is a special non-printing characters consists of the escape character (the backslash "\") and a second (code) character. The list of the escape sequences is given below:

Escape Sequence Explanation with Example
\n Newline. Position the cursor at the beginning of the next line.
Example: cout << "\n";
\t Horizontal tab. It move the cursor to the next tab stop.
Example: cout << "\t";
\\ Backslash. Insert a backslash character in a string.
Example: cout << "\\";
\a Alert. Produces a beep sound or visible alert.
Example: cout << "\a";
\b Backspace. It moves the cursor backspace.
Example: cout << "\b";
\r Carriage Return. Moves the cursor to the beginning of the current line. Example: cout << "\r";
\' Single Quotation. It is used to print apostrophe sign (').
Example: cout << "\'";
\" Double Quotation. It is used to print quotation mark (").
Example: cout << "\" ";

Q.16: What are operators? Write down the name of operators used in C++.
Ans: OPERATORS IN C++:
Operators are the symbols which tell the computer to execute certain mathematical or logical operations. A mathematical or logical expression is generally formed with the help of an operator. C++ Programming offers a number of operators which are classified into the following categories.

  1. Arithmetic Operators
  2. Increment Operators
  3. Decrement Operators
  4. Relational Operators
  5. Logical/Boolean Operators
  6. Assignment Operators
  7. Arithmetic Assignment Operators

Q.17: What are arithmetic operators?
Ans: ARITHMETIC OPERATORS:
Arithmetic operators are used to perform mathematical operations. All operators used integer & floating.point data type except remainder or modulas operator.

Operator Operation Example
+ Addition, It is used to perform addition.a+b
- Subtraction: It is used to perform subtraction.a-b
* Multiplication: It is used to perform multiplication.a*b
/ Division, It is used to perform division.a/b
% Remainder Or Modulas: Find remainder after integer division.a%b

Q.18: Define all arithmetic operators with examples.
Ans: SIMPLE CALCULATOR PROGRAMMING IN C++ USING ARITHMETIC OPERATORS:


Q.19: Define increment operators with example in C++.
Ans: C++ provides the unary increment operator. It is used to be incremented a variable by 1. Increment operator represented by ++ (double plus sign). The increment operators are used in two ways (Postfix & Prefix) summarized below:

Operator Explanation
++a
(Prefix)
 Increment a by 1. then use the new value of a in the expression in which a resides. i.e. x = ++a;

a++
(Postfix)
 Use the current value of a in the expression in which a resides, then increment a by 1.




Q.20: Define decrement operator in C++.
Ans: DECREMENT OPERATORS:
C++ also provides the unary decrement operator. It is used to be decremented a variable by 1. The decrement operator represented by -- (Double minus sign). are used in The decrement operators are used in two ways (Postfix & Prefix) summarize below:

Operators Explanation
--a
(Prefix)
 Decrement a by 1, then Use the new value of a in the expression in which a resides.

a--
(Postfix)
 Use the current value of a in the expression in which a resides, then decrement a by 1.


Q.21: Define Relational operators with example in C++.
Ans: RELATIONAL OPERATORS:
Relational operators are used when we have to make comparisons. It is used to test the relation between two values. The result of comparison is True (1) or false (0). C++ Programming offers following relational operators:

Operators Operations Example
< It checks the value on left is less than value on right. a<b
> It checks the value on left is greater than value on right. a>b
<= It checks the value on left is less than or equal to value on right.a<=b
>= It checks the value on left is greater than or equal to tbe value on right.a>=b
== It checks the equality of two values.a==b
!= It checks the value on left is not equal to value on right.a!=b

PROGRAM USING RELATIONAL OPERATOR IN C++

 #include <iostream>
 using namespace std;
 int main()
 {
 int x=20, y=10;
 if(x>y)
 cout <<"X is greater than Y;
 else
 return 0;
 }

 OUTPUT
 X is greater than Y


Q.22: Define logical operators with example in C++.
Ans: LOGICAL OPERATORS:
Logical operators are used when more than one conditions are to be tested and based on that result, decisions have to be made. C++ programming offers three logical operators. They are:
Operators Operations Explanation
&& Logical AND. The condition will be true if both expressions are true. 1 if a==b && c==d; else 0
|| Logical OR. The condition will be true if any of the expressions ere true. 1 if a==b || c>d; else 0
! Logic NOT. The condition, will be inverted, False becomes true & true becomes false. 1 if !(a==0); else 0

PROGRAM USING LOGICAL OPERATOR IN C++:

 #include<iostream>
 #include<conio.h>
 using namespace std;

 int main()

 {
 int num1 = 30, num2 = 40;
 cout<< "Logical Operators Example \n";
 if (nun1<=40 && num2>=40)
 {
 cout<< "Numl is less than and Num2 is greater than or equal to 40 \n";
 }
 if (nun1>=40 || num2>=40)
 {
 cout<< "Numl or Num2 is greater than or equal to 40 \n";
 }
 getch();
 return 0;
 }

 OUTPUT
 Logical Operators Example
 Numl is less than and Num2 is greater than or equal to 40
 Numl or Num2 is greater than or equal to 40


Q.23: write down the difference between relational end logical operators.
Ans: DIFFERENTIATE BETWEEN RELATIONAL OPERATOR AND LOGICAL OPERATOR:
RELATIONAL OPERATOR:
  • Relational operators compare any values in the form of expressions.
  • Relational operators are binary operators because they require two operands to operate.
  • Relational operators return results either 1 (TRUE) or 0 (FALSE).

LOGICAL OPERATOR :
  • Logical operators perform logical operations on boolean values 1 (TRUE) and 0 (FALSE).
  • Logioal operator is usually used te compare one or more relational expressions.
  • Logical operator also return output as 1 (TRUE) and 0 (FALSE).

Q.24: Define assignment operator.
Ans: ASSIGNMENT OPERATOR:
Assignment operator (=) are used to assign result of an expression or a value to a variable. The associativity of assignment operators is right to left means value or expressi at the right is assigned to the left side variable.

Q.25: Define arithmetic assignment operators with example.
Ans: ARITHMETIC ASSIGNMENT OPERATOR:
Arithmetic assignment operator is a combination of arithmetic and assignment operators. This operator first performs an arithmetic operation on the current value of the variable on left to the value on the right and then assigns the result to the variable on the left.

OPERATOR DESCRIPTION
 +=(Addition-Assignment) Adds the right operand to the left and assigns the result to the left operand.
 -=(Subtraction-Assignment) Subtracts the right operand to the left and assigns the result to the left. operand.
 *=(Multipication-Assignment) Multiplies the right operand to the left and assigns the result to the left operand.
 /=(Division-Assignment) Divides the right operand to the left and assign the result to the left operand.

PROGRAM USING ASSIGNMENT & ARITHMETIC OPERATORS IN C++:

 #include<iostream>
 #include<conio.h>
 using namespace std;

 int main()

 {
 int a = 10;
 cout<< "Value of a using assignment operator is "<<a<<" \n";
 a+= 10;
 cout<< "Value of a using addition assignment operator is "<<a<<" \n";
 a-= 10;
 cout<< "Value of a using subtraction assignment operator is "<<a<<" \n";
 a*= 10;
 cout<< "Value of a using multiplication assignment operator is "<<a<<" \n";
 a/= 10;
 cout<< "Value of a using division assignment operator is "<<a<<" \n";
 return 0;
 }

 OUTPUT
 Value of a using assignment operator is 10
 Value of a using addition assignment operator is 20
 Value of a using subtraction assignment operator is 10
 Value of a using multiplication assignment operator 100

Value of a using division assignment operator is 10






Monday 12 September 2022

UNIT 02: BASICS OF PROGRAMMING IN C++ - Lab Activity - Computer Science For Class X

GO TO INDEX

Computer Science For Class X
Unit 02: Basics Of Programming In C++
Lab Activity


1. In groups, students learn to download, install and configure Dev C++.

INTRODUCTION TO DEV-C++:

Dev-C++ is a fully featured graphical IDE (Integrated Development Environment) for programming in C / C++. DEV-C++ is developed by Bloodshed software. It was originally developed by Colin Laplace and first released in 1998. It is written in Delphi. With Dev C++ programmer can write Windows or console-based C/C++ programs easily.

INSTALLING AND CONFIGURING DEV-C++ IDE:
Dev-C++ is free available for download on Internet. After downloading the package begin the installation process. Following are the steps for installing Dec-C++ IDE.

STEP 1:
  • Select "English" as the language to be used for installation process.


STEP 2:
  • Press " I Agree" button to agree the license agreement.


STEP 3:
  • Select "Full" from the drop-down menu "for type of Install". This will select all the necessary components required to run Dev-C++ and compile C++ source code.
  • Click on "Next" to proceed.


STEP 4:
  • Select the installation folder (directory) where all the necessary Dev-C++ files and libraries will be installed. Usually, the default specified path is used for installation but we can change it if desired.
  • Click on "Install" to start installation.




STEP 5:
  • After completing process, it will show a "Finish" dialog box.
  • Make sure the "Run Dev-C++ 5..." is checked.
  • Click 'Finish' button. This will automatically start Dev-C++ after installation completes.


CONFIGURING DEV-C++:
  • Dev-C++ will require some configuration when it runs first time.
  • Set "English (Original)". as default interface language in the Dev-C++ first time configuration dialogue.
  • Click "Next" to continue.
  • On the "Theme" selection dialog box leave the default setting and click on "Next" to continue.
  • Click "OK' to close first time configuration dialogue.



LINKER SETTING FOR DEBUGGING:
Linker setting for bugging is required first time to obtain information about problems in source code. The following steps are used to enable this configuration.
  • Click on ToolsCompiler Options.
  • Open the Setting tab from the Compiler Options dialogue box.
  • Under Setting tab, open Linker tab.
  • In Linker tab change the Generate Debugging Information (-g3) options to Yes.
  • Click on OK to save setting.



DEVELOPING PROGRAM IN DEV-C++:
Development of C++ program requires writing source and saving those files for compilation. The steps to create a new project in Dev-C++ are:
  • Click on File ⇨ click NewProject.
  • In New Project dialog, Select Empty Project.
  • From language option, select C++ Project. Also enter Name for project.
  • Click on OK.
  • Dev C++ will ask path to save the new project, enter path and save project.



ADD NEW FILES TO PROJECT IN DEV-C++:
The step to create a new file are:
  • Click on Project ⇨ New File. Alternatively we can also right-click on the Project Name in the Project Explorer and click on the New File.
  • Click on Yes on the confirm dialog box to add a file.
  • To save newly added file, click on File ⇨ Save
  • Enter the path and provide its name.
  • Click on Save to Store the file.


COMPILE AND EXECUTE PROJECT IN DEV-C++:
The steps to compile and execute project are:
  • Project needs to compile before execution. To compile, click on Execute ⇨ Compile or press F9 key. Compiler Log tab shows the compilation status. Compiler tab will show if there are any syntax errors.
  • After successfully compiling the project, run it by clicking on Execute ⇨ Run or by pressing F10 key.
  • A console window will open and show the output of the program.

2. Teacher demonstrate the use of IDE and its feature as given in this unit. Also explain the use of variables and constants.

INTEGRATED DEVELOPMENT ENVIRONMENT (IDE):

  • An integrated development environment (IDE) is software for building applications or programs that combines common developer tools into a single graphical user interface (GUI).
  • IDE facilitates the development of applications designed to encompass all programming tasks in one application, one of the main benefits of an IDE is that they offer a central interface with all the tools, a developer needs.
  • For instance, Dev-C++, is used for making programs in C++ language.
  • However, there are many multiple language IDEs. Such as Eclipse (C, C++, Python, Perl, PHP, Java, Ruby and more) and Visual Studio Code (Java, JavaScript, PHP, Python, Ruby, C, C++ and more).

Explanation:
  • Integrated Development Environment (IDE):
  • IDEs provide interfaces for users to write code, organize text groups, and automate programming tools.
  • Instead of a simple plain-text editor, IDEs combine the functionality of multiple programming processes into one.
  • Most IDES come with built-in translators.
  • If any bugs or errors are found, users are shown which parts of code have problems.
  • Some IDEs are dedicated to a specific programming language or set of languages, having a set of tools and features which are helpful in writing codes for that language.

Key Benefits of Integrated Development Environments:
Serves as a single environment for most of a developer's needs such as compilation, linking, loading, and debugging tools.
Code completion capabilities improve programming workflow.
Automatically checks for errors to ensure top quality code.
Refactoring capabilities allow developers to make comprehensive and mistake-free renaming changes.

COMPONENTS OF INTEGRATED DEVELOPMENT ENVIRONMENT (IDE):
IDEs increase programmer productivity by combining common activities of writing software into a single application: editing source code, building executable, and debugging.

EDITING SOURCE CODE:
Writing and editing source codes is a major part of programming. A text editor is used for writing and editing source codes with feature providing language specific autocompletion, and checking for bugs as code is being written.

SYNTAX HIGHLIGHTING:
Syntax highlighting is a feature of IDEs that provides visual cues, keywords, and other words that have special meaning in languages (like class in C++) are highlighted with different colors. This feature makes code easier to read by visually clarifying different elements of language syntax or understand.

CODE COMPLETION:
It is a feature of IDE that completely knows the language syntax that speeds up process of coding by reducing typos and other mistakes. Autocompletion popups while typing, querying parameters of functions, query hints related to syntax errors.

COMPILER:
Compiler is a component of IDEs that translate source code (programming language) into machine code, such as binary codes. IDEs provide automated build process for languages, so the act of compiling and executing code is done automatically. Thus this feature can help automate developer tasks that are more common to save time.

LINKER:
Linker opens the compiled program file and connects or links referenced library files with compiled code as needed. Unless all linker items are resolved, the process stops and returns the user to the source code file within the text editor with an error message. If no problem encountered, it saved the linked objects into an executable file.

LOADER:
The IDE directs the operating system's program called the loader to loads executable files into the computer's memory and directs the Central Processing System (CPU) to start running the program as directed by the IDE.

DEBUGGING:
The process of removing errors from a program is known as debugging. When a program does not run correctly, IDEs provide debugging tools that allow programmer to examine different variables and inspect their codes step by step. IDE also provide hints while coding to prevent errors before compilation.
Thus, debugging is a multi-step process that involves identifying a problem, isolating the source of the problem. The final step of debugging is to test the correction or work around and make sure it works. Programmers and engineers can usually test the various segment of codes and identify errors before the application is released.

CONSTANT:

A constant is an identifier whose value remains unchanged through out the program.
OR
Constants and Variables A constant is a data item whose value cannot change during the program's execution. Thus, as its name implies - the value is constant.
OR
A constant is a value that cannot be altered by the program during execution, i.e., the value is constant. When associated with an identifier, a constant is said to be "named," although the terms "constant" and "named constant" are often used interchangeably.


TYPES OF CONSTANT:
Constants are used in two ways. They are:
  1. Literal Constants
  2. Defined Constants

LITERAL CONSTANT:
Literal constants are data used for representing fixed values. 'They can be used directly in the codes.
Example:
  • 1, 2, 5, "c", "good", "Hello World", false, null etc.

DEFINED OR SYMBOLIC CONSTANT:
In C++, we can create symbolic constant or named which are constant and represented by names. Symbolic constant value remains unchanged but used as a variable. A symbolic constant can be created using the #define preprocessor directive or const keyword.
Many programming languages use ALL CAPS to define name constant.
Example:
  • const int LIGHT_SPEED = 299792458;
  • #define LIGHT SPEED 29972458

VARIABLE:

A variable is nothing but a name given to a storage area that our programs can manipulate. In simple words, A variable is the memory location that can hold a value. Its value can change during program execution. Each variable C++ has a specified data type, which determine the size and layout of the variable's memory.
Example:
A class room with capacity of 20 students is a fixed placed or constant but the subject taught, the teacher and students may vary with each class and subject and are variables.

Variables do not require to be assigned initial value. Variables once defined may be assigned a value within the instructions of the program. Variables can be assigned different values at different time during execution.
Example:
x = 5:
x = 37;

RULES FOR NAMING VARIABLE:
The general rules for constructing names for variables (unique identifiers) are:
  • A variable name contains alphabets (letters), number, and underscores.
  • A variable name must start with a letter or an underscore (_).
  • Variable names are case sensitive. (myVar and myvar or Sum end sum are different variables)
  • Variable names cannot contain whitespaces or special characters like !, #, % etc.
  • Reserved words (Like C++ keyword, such as int cannot be used as names.
  • A variable name cannot be longer than 32 characters in C++ by default.

DECLARATION (CREATING) VARIABLE:
A variable declaration tells the compiler where and how much storage to create a variable. in other words, variable declaration is a process in which we create storage space for variable in memory.
A variable declaration consists of data type and name of the variable written as follow:
Syntax:
  • data_type variable_name,
  • int sum
Where type is one of C++ data type (such as int), and variable_ name is the name of the variable (such as x or myName)

INITIALIZATION:
Assign initial value to a variable is known as variable initialization. It can be initialized during declaration or separately. The initialization consists of an equal sign followed by a constant expression. The equal sign is used to assign value written as follows:
Syntax:
  • data_type variable_name value;
  • int sum = 3;

STRINGS IN C ++:
  • Variables that can store non numerical (alphanumeric) value that consist of multiple characters (longer than one single characters) are called strings.
  • The C++ language library provides supports for strings through the standard string class.  In C++, strings are used by one-dimensional array of characters, which is terminated by a null character \0.
  • This is not a fundamental type, but it behaves in a similar way as a fundamental types do in its most basic usage.
  • String can be declared without an initial value and can be assigned values during executions.


Sunday 11 September 2022

Maulana Altaf Hussain Haali - Urdu (Compulsory) For HSC - Part 1 & 2 - شاعر: مولانا الطاف حسین حالی کی شاعری پر تبصرہ

Go To Index HSc Part 1

Go To Index HSc Part 2
شاعر: مولانا الطاف حسین حالی کی شاعری پر تبصرہ


By Farabi Publishers Guide Book



Unit 1: Real And Complex Numbers - Mathematics For Class IX (Science Group) - Multiple Choice Questions (MCQs)

Go To Index
Unit 1: Real And Complex Numbers
Multiple Choice Questions (MCQs)










Unit 1: Real And Complex Numbers - Mathematics For Class IX (Science Group) - Explanation Of Exercise 1.4

Go To Index
Unit 1: Real And Complex Numbers
Explanation Of Exercise 1.4



Explanation Of Laws of Exponents/Indices

 Laws of Exponents/Indices: 

Laws of exponents or indices are important in many fields of mathematics.

Recall Base, Exponent and value of Power
Consider an exponential form an here, 'a' is called the base and 'n' is called exponent or index i.e., read as a to the nth power. The result of an, where a ∈ R is called its value.

Apply the Laws of Exponents to Simplify Expressions with Real Exponents
The following laws of exponents are useful to simplify the expressions.

(i) Law of Product of Powers
  • (a) If a, b ∈ R and x, y ∈ Z+
  • Then, ax x ay = ax+y
Some examples based on this law are given below:
  • (a) a2 x a3 = a2+3 = a5
  • (b) 3 x 35 = 31+5 x 36 = 729

(ii) Law of Power of Power
If a ∈ R and x, y ∈ Z+, then (ax)y = axy
Some examples based on this law are given below:
  • (a) (52)4 = 52x4 = 58 = 390625