Pascal programmng -issues - Pascal programming

  1. For to While

    Write the following FOR statement in an equivalent WHILE form:

  2. Repeat to While

    Write the following REPEAT statement in an equivalent WHILE form:

  3. While to Repeat

    Write the following WHILE statement in an equivalent REPEAT form:

    WHILE C1 DO S1;
  4. Case to Ifs

    Write the following CASE in terms of the IF statement:

    CASE E1 OF K1: S1; K2, K3: S2; K4: S3; S4; END
  5. Char

    Four successive character A, B, C and D are input to a program. Write short pieces of program to compare these characters and to output whether or not the following are true.

    a. All the characters are digits.
    b. None of the characters is a digit.
    c. Some of the characters are vowels.
    d. The characters are in increasing order.
    e. There is no repetition within the sequence of characters.
  6. Numeric Characters

    Four successive characters E, F, G, H are input to a program. One of the characters F, G or H could be a period; all the others are digits. Thus, the sequence of characters can be interpreted as representing an amount of money. Write a piece of program to compare the characters and to output the value of the amount in cents. For example 1.25 is output as 125.

  7. Logical evaluation

    Given 5 logical variables P, Q, R, S and T, where P and Q both have the value TRUE, and R and S both have the value FALSE, and the value of T is undefined, evaluate the truth values of each of the following.

    a. P OR (R AND T)
    b. Q OR (R OR T)
    c. R AND (S OR T)
    d. P AND (T OR R)
    e. Q AND NOT (S OR T)
  8. More

    Create Pascal programs for the following problem statements:

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

Pascal programming Topics