String Functions

String functions are used to manipulate strings. A string can defined as set of alphanumeric characters. This note provides an information about String Functions .

Summary

String functions are used to manipulate strings. A string can defined as set of alphanumeric characters. This note provides an information about String Functions .

Things to Remember

  • String functions are used to manipulate strings.
  • LEFT$ Function returns specific number of characters from left side to supplied string and returns the value.
  • RIGHT$ Function returns specific number of characters from right side to supplied string and returns the value.
  • MID$ Function returns the specified number of characters from the specified location of a string.

MCQs

No MCQs found.

Subjective Questions

Q1:

Calculate the three fundamental trigonometric ratios for the acute angle x of each of the folllowing triangles expressing them in the lowest terms and correct to two decimal places. 

figure
figure

Type: Short Difficulty: Easy

Show/Hide Answer
Answer: <p>Given , in BCA<br>Opposite side of x (AB) = p = 24<br>Adjacent side of x (AC) = b = 1 0<br>Opposite side of (&lt;A = 90<sup>o</sup>) h = 26<br>Here , sin x = \(\frac{p}{h}\) = \(\frac{24}{26}\) = \(\frac{12}{13}\) = 0.92<br>cos x = \(\frac{b}{h}\) = \(\frac{10}{26}\) = \(\frac{5}{13}\) = 0.38<br>and<br>tan x = \(\frac{p}{b}\) = \(\frac{24}{10}\) = \(\frac{12}{5}\) = 2.40</p>

Q2:

Find out the third side by using Pythagoras theroem and then calculate sin x , cos x and tna x. 

figure
figure

Type: Short Difficulty: Easy

Show/Hide Answer
Answer: <p>In given ACB ,<br>Opposite side of x = p = 1.2 cm<br>Adjacent side of x = b = 0.9 cm<br>Oppsite side of B = h = ?<br>Here , by pythagoras theroem ,<br>h<sup>2</sup> =p<sup>2</sup> + b<sup>2</sup><br>h = \(\sqrt{p^{2} + b^{2}}\)<br> = \(\sqrt{1.2^{2} + 0.9 ^{2}}\)<br> = \(\sqrt{1.44 + 0.81}\)<br> = \(\sqrt{2.25}\)<br> = 1.5 cm.<br><br>Now ,<br>sinx = \(\frac{p}{h}\) = \(\frac{1.2 cm}{1.5 cm}\) = \(\frac{12}{15}\) = \(\frac{4}{5}\)<br><br>cos x = \(\frac{b}{h}\) = \(\frac{0.9 cm}{1.5 cm}\) = \(\frac{09}{15}\) = \(\frac{3}{5}\)<br><br>and<br>tanx = \(\frac{p}{b}\) = \(\frac{1.2cm}{0.9 cm}\) = \(\frac{12}{9}\) = \(\frac{4}{3}\)</p>

Q3:

Find out the third side by using Pythagoras theorem :

figure
figure

Type: Short Difficulty: Easy

Show/Hide Answer
Answer: <p>In given triangle EFG ,<br>p = EF = 9 cm , b = FG = 40cm , h = EG = ?<br>h<sup>2</sup> = p<sup>2</sup> + b<sup>2</sup><br>or , h = \(\sqrt{p^{2} + b^{2}}\)<br>or , \(\sqrt{9^{2} + 40^{2}}\) = \(\sqrt{81 + 1600}\) = \(\sqrt{1681}\) = 41 cm.<br><br>Now ,<br>sinx =\(\frac{p}{h}\) = \(\frac{9}{41}\) = \(\frac{9}{41}\)<br><br>cosx = \(\frac{b}{h}\) = \(\frac{40}{41}\) = \(\frac{40}{41}\)<br><br>and tanx = \(\frac{p}{b}\) = \(\frac{9}{40}\) = \(\frac{9}{40}\)</p>

Q4:

Find out the third side by using Pythagoras theorem. 

figure
figure

Type: Short Difficulty: Easy

Show/Hide Answer
Answer: <p>In given PQR , h = QR = 25cm , b = QP = 7cm ,<br>p = PR = ?<br>By Pythagoras theorem ,<br>p<sup>2</sup> + b<sup>2</sup> = h<sup>2 </sup><br>or , p<sub>2</sub> = h<sup>2</sup> - h<sup>2</sup><br>\(\therefore\) p = \(\sqrt{h ^{2} - b^{2}}\) = \(\sqrt{25 ^{2} - 7^{2}}\) <br> = \(\sqrt{576}\) = 24 cm.<br>Here ,<br>sinx = \(\frac{p}{h}\) = \(\frac{24}{25}\) = \(frac{24}{25}\)<br>cosx = \(\frac{b}{h}\) = \(\frac{7}{25}\) = \(\frac{7}{25}\)<br>and<br>tanx = \(\frac{p}{b}\) = \(\frac{24}{7}\) = \(=frac{24}{7}\)</p>

Q5:

Find the third side by using Pythagoras theorem, 

figure
figure

Type: Short Difficulty: Easy

Show/Hide Answer
Answer: <p>In given XYZ ,<br>p = XY = 16 , h = XZ = 65 , b = YZ = ?<br>p<sup>2</sup> + b<sup>2</sup> = h<sup>2 </sup><br>or , b<sup>2</sup> = h<sup>2</sup> - p<sup>2</sup><br>b = \(\sqrt{h^{2} - p^{2}}\) =\(\sqrt{65^{2} - 16^{2}}\)<br>= \(\sqrt{3969}\) = 63.<br>Here ,<br>sinx = \(\frac{p}{h}\) = \(\frac{16}{65}\) = \(\frac{16}{65}\)<br>cosx = \(\frac{b}{h}\) = \(\frac{63}{65}\) = \(\frac{63}{65}\)<br>and<br>tanx = \(\frac{p}{b}\) = \(\frac{16}{63}\) = \(\frac{16}{63}\)</p>

Q6:

Calculate the value of given equations :
1. cos60o \(\times\) sin 60


Type: Very_short Difficulty: Easy

Show/Hide Answer
Answer: <p>= \(\frac{1}{2}\) \(\times\) \(\frac{\sqrt{3}}{2}\) = \(\frac{\sqrt{3}}{4}\).</p>

Q7:

2cos60o \(\times\)  sin30


Type: Very_short Difficulty: Easy

Show/Hide Answer
Answer: <p>= 2 \(\frac{1}{2}\) \(\times\) \(\frac{1}{2}\) = \(\frac{1}{2}\) Ans.</p>

Q8:

Calculate the value of given equation: 
sin45o \(\times\) 2cos45


Type: Very_short Difficulty: Easy

Show/Hide Answer
Answer: <p>= \(\frac{1}{\sqrt{2}}\) \(\times\) 2 \(\times\)\(\frac{1}{\sqrt{2}}\)<br>= \(\frac{2}{2}\)<br> = 1.</p>

Q9:

Calculate the value of given equations : 
tan45o + sin 30o  


Type: Very_short Difficulty: Easy

Show/Hide Answer
Answer: <p>= 1 +\(\frac{1}{2}\)<br>= \(\frac{3}{2}\)<br>= 1 \(\frac{1}{2}\).</p>

Q10:

Find the values of the given equation :
sin230+ sin245o + sin260o   


Type: Short Difficulty: Easy

Show/Hide Answer
Answer: <p>= ( \(\frac{1}{2}\) )<sup>2</sup> + ( \(\frac{1}{\sqrt {2}}\) )<sup>2</sup> + ( \(\frac{\sqrt{3}}{2}\) )<sup>2<br></sup><br>= \(\frac{1}{4}\)+ \(\frac{1}{2}\) +\(\frac{3}{4}\)<br><br>= \(\frac{1+2+3}{4}\)<br><br>= \(\frac{3}{2}\)<br><br>= 1\(\frac{1}{2}\)</p>

Q11:

Solve:
cos\(\beta\) = \(\sqrt{3}\) cos60


Type: Short Difficulty: Easy

Show/Hide Answer
Answer: <p>cos\(\beta\) = \(\sqrt{3}\) \(\times\) \(\frac{1}{2}\)<br>or ,cos\(\beta\) = \(\frac{\sqrt{3}}{2}\)<br>or ,cos\(\beta\) = cos 30<sup>o </sup><br>\(\therefore\) \(\beta\) = 30<sup>o</sup> Ans.</p>

Q12:

In a right angle ABC , AC = 30 , A = 30 , B = 60. What is the length of BC ?

figurte
figure

Type: Long Difficulty: Easy

Show/Hide Answer
Answer: <p>Here , A + B = 30<sup>o</sup>+ 60<sup>o</sup> = 90<sup>o</sup><br>Remaning angle C=90<sup>o</sup><br>In rt. angled triangle ABC ,<br>tan60<sup>o</sup> = \(\frac{AC}{BC}\)<br>\(\sqrt{3}\) = \(\frac{30}{BC}\)<br>BC \(\times\) \(\sqrt{30}\) = 30<br>BC = \(\frac{30}{\sqrt{30}}\) = \(\frac{3 \times 10}{\sqrt{30}}\) = 1.732 \(\times\) = 17. 32 Ans.</p>

Q13:

In the adjoining figure , AB = 6 cm , BC = 8 cm , ABC = 90 , BD⊥AC and ABD = \(\theta\). Calculate the value of sin\(\theta\). 

figure
figure

Type: Long Difficulty: Easy

Show/Hide Answer
Answer: <p>Here , AC<sup>2</sup> = AB<sup>2</sup> + AB<sup>2</sup><br>AC = \(\sqrt{AB^{2} + BC^{2}}\) <br> = \(\sqrt{6^{2} + 8^{2}}\)<br> = 10.<br><br>In ABC and ABD ,<br>ABC = ADB [both are right angles]<br>BAC = BAD [common angles]<br>ACB = ABD = \(\theta\) [remaining angle]<br><br>In&Delta;ABC ,<br>sin ACB = \(\frac{AB}{AC}\)<br>\(\therefore\) sin \(\theta\) = \(\frac{6}{10}\) = \(\frac{3}{5}\)</p>

Q14:

In the adjoining DEF , DG⊥ EF. If DE = EF = FD = x, 
prove that : cos\(\theta\) = \(\frac{\sqrt{3}}{2}\). 

figure
figure

Type: Long Difficulty: Easy

Show/Hide Answer
Answer: <p>EG = GF [perpendicular drawn from any vertex to the opposite side of equilateral triangle bisects that side]<br> EG = \(\frac{EF}{2}\) = \(\frac{x}{2}\)<br><br>In rt. angled triangle DGE ,<br>or , DG<sup>2</sup> + GE<sup>2</sup> = DE<sup>2</sup><br><br>or , DG<sup>2</sup> + \(\frac{x}{2}\)<sup>2</sup> = x<sup>2</sup><br><br>or , DG = \(\frac{\sqrt{4x^{2} - x^{2}}}{4}\) = \(\frac{\sqrt{3x^{2}}}{4}\) = \(\frac{\sqrt{3x}}{2}\)<br>cos \(\theta\) = \(\frac{DG}{DE}\) = \(\frac{\sqrt{3}}{2}\) Proved.</p>

Q15:

Solve :
4 sin2\(\beta\) = 1. 


Type: Short Difficulty: Easy

Show/Hide Answer
Answer: <p>or , sin<sup>2</sup>\(\beta\) = \(\frac{1}{4}\)<br>or , sin<sup>2</sup> \(\beta\) =( \(\frac{1}{2}\) )<sup>2</sup><br>or , sin<sup>2</sup> \(\beta\) = (sin30<sup>o</sup>)<sup>2</sup><br>or ,sin \(\beta\) = sin30<sup>o</sup><br>\(\therefore\) \(\beta\) = 30<sup>o</sup> Ans. </p>

Videos

Basic trigonometry | Basic trigonometry | Trigonometry | Khan Academy
the BASICS of TRIGONOMETRY (Review and Tutorial)
Basic Trigonometry
String Functions

String Functions

String functions are used to manipulate strings. A string can defined as set of alphanumeric characters.

Some of the strings manipulating functions are as follows:

  • LEFT$ Function: It is a string function that returns specific number of characters from left side to supplied string and returns the value.
  • RIGHT$ Function: It is a string function that returns specific number of characters from right side to supplied string and returns the value.
  • MID$ Function: IT returns the specified number of characters from the specified location of a string.
  • UCASE$ Function: It returns a string expression with all letters in uppercase.
  • LCASE$ Function: It returns a string expression with all letters in lowercase.
  • CHR$ Function: IT retrieves the single characters and returns a character of the corresponding ASCII code in decimal.
  • STR$ Function: It converts a numeric expression into its string data returns the string value.
  • LTRIM$ Function: It removes trailing blank spaces from the left side of the string expression.
  • SPACE$ Function: It returns a number of spaces.
  • INSTR Function: It returns the position of first occurrence of a string in another string.
  • STRING$ Function: It is used with a PRINT statement that displays a particular character a specified number of times.
  • INKEY$ Function: It reads a character from the keyboard and returns the character.
  • INPUT$ Function: It returns a string of characters read from the specified file.
  • DATE$ Function: It returns the current system date of computer in string format in the form of MM/DD/YYYY.
  • TIME$ Function: It returns the current system time of computer in string format in the form of HH:MM:SS.

Lesson

Modular Programming in QBASIC

Subject

Computer Science

Grade

Grade 10

Recent Notes

No recent notes.

Related Notes

No related notes.