0% found this document useful (0 votes)
42 views2 pages

Practice Problems

The document contains 15 practice questions for a test on writing pseudocode. The questions cover a range of topics including determining if a number is even or odd, calculating profits and losses, finding the youngest of three ages, determining if a triangle's angles add to 180 degrees, and reversing the digits of an integer. The pseudocode is to be written to solve each problem based on numeric values or other conditions provided in the user input or question.

Uploaded by

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

Practice Problems

The document contains 15 practice questions for a test on writing pseudocode. The questions cover a range of topics including determining if a number is even or odd, calculating profits and losses, finding the youngest of three ages, determining if a triangle's angles add to 180 degrees, and reversing the digits of an integer. The pseudocode is to be written to solve each problem based on numeric values or other conditions provided in the user input or question.

Uploaded by

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

Practice Questions For ITC

Before MID 1
Question 1 Any integer is input by the user. Write a pseudocode to find out whether
it is an odd number or even number.
Question 2 Find the absolute value of a number entered by the user.
Question 3 Write a pseudocode to calculate the total expenses. Quantity and price
per item are input by the user and discount of 10% is offered if the
expense is more than 5000.
Question 4 Write a pseudocode to determine whether the seller has made profit or
incurred loss. Also determine how much profit he made or loss he
incurred. Cost price and selling price of an item is input by the user.
Question 5 If the ages of Ahmed, Rayaan and Alyaan are input by the user, write a
pseudocode to determine the youngest of the three.
Question 6 Write a pseudocode to check whether a triangle is valid or not, when the
three angles of the triangle are entered by the user. A triangle is valid if
the sum of all the three angles is equal to 180 degrees.
Question 7 Any year is input by the user. Write a pseudocode to determine whether
the year is a leap year or not.
Question 8 In a company an employee is paid as under:
If his basic salary is less than Rs. 1500, then HRA = 10% of basic salary

and DA = 90% of basic salary.


If his salary is either equal to or above Rs. 1500, then HRA = Rs. 500
and DA = 98% of basic salary.
If the employee's salary is input by the user write a pseudocode to find
his gross salary.
Question 9 Write a pseudocode to calculate the monthly telephone bills as per the
following rule:
Minimum Rs. 200 for upto 100 calls.
Plus Rs. 0.60 per call for next 50 calls.
Plus Rs. 0.50 per call for next 50 calls.
Plus Rs. 0.40 per call for any call beyond 200 calls.
Question 10 Write a pseudocode to find the roots of and quadratic equation of type
ax2+bx+c where a is not equal to zero.
Question 11 The marks obtained by a student in 5 different subjects are input by the
user. The student gets a division as per the following rules:
Percentage above or equal to 60 - First division
Percentage between 50 and 59 - Second division
Percentage between 40 and 49 - Third division
Percentage less than 40 - Fail
Write a pseudocode to calculate the division obtained by the student.
Question 12 Any character is entered by the user; write a pseudocode to determine
whether the character entered is a capital letter, a small case letter, a
digit or a special symbol. The following table shows the range of ASCII
values for various characters.

Characters ASCII Values

A–Z 65 – 90

a–z 97 – 122

0–9 48 – 57

special 0 - 47, 58 - 64, 91 - 96, 123 – 127


symbols

Question #13:
A player rolls two dice. Each die has six faces. These faces contain 1, 2, 3, 4, 5 and 6 spots. After
the dice have come to rest, the sum of the spots on the two upward faces is calculated. If the sum
is 7 or 11 on the first roll, the player wins. If the sum is 2, 3 or 12 on the first roll (called
“craps”), the player loses (i.e., the “house” wins). If the sum is 4, 5, 6, 8, 9 or 10 on the first roll,
then that sum becomes the player’s “point.” To win, you must continue rolling the dice until you
“make your point.” The player loses by rolling a 7 before making the point.

Question #14:
Write pseudocode segments that accomplish each of the following:
a) Calculate the integer part of the quotient when integer a is divided by integer b.
b) Calculate the integer remainder when integer a is divided by integer b.
c) Use the pseudocode pieces developed in (a) and (b) to write a pseudocode that inputs an
integer between 1 and 32767 and prints it as a series of digits, each pair of which is separated
by two spaces.

Question #15:
Write a pseudocode that takes an integer value and returns the number with
its digits reversed. For example, given the number 7631, the function should return 1367.

You might also like