









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










Assignment statement Computes the product of Distance := Speed * Time; (^) Speed and Time and
assigns it to Distance
Input Statements Enters data into the Ada.Text_Io.Get (^) character variable Initial (Item =>Initial);
Input Statements … into the integer Ada. Integer _Text_Io.Get (^) variable Age (Item => Age);
Input Statements … into the float variable Ada. Float _Text_Io.Get (^) PayRate (Item => PayRate);
Output Statements Displays the value of Ada.Text_Io.Put (Item =>Initial); (^) the character variable
Initial
Output Statements Ada. Integer _Text_Io.Put (Item =>HowMany, Width=>3);
… integer variable HowMany, using five columns on the display
Output Statements Ada. Float _Text_Io.Put (Item => GrossPay, Fore => 4, Aft => 2, Exp => 0);
… float variable GrossPay using four columns before the decimal point and two columns after the decimal point
Max_Str_Length : constant := 26; Alphabet, Response:String(1..Max_Str_Length);
Alphabet := “abcdefghijklmnopqrstuvwxyz” Response := Alphabet;
Alphabet(1..3) & Alphabet(26..26)
Alphabet & “.”);
Put(Item => “The alphabet is “ &
test
statement(s)_
statement_after
true
false
end if
test
statement(s)_
statement_after
false true
statement(s)_
end if
end if
Balance after Action withdrawal
= 0 Accept withdrawal
= -50 and < 0 Overdraft
< -50 Refuse withdrawal
Enter the withdrawal 50 Accepted. Balance is 50
76 Enter the withdrawal 150 Refused! Balance is 76
50 Enter the withdrawal 75 Overdraft! Balance is -
Enter balance of the account
Enter balance of the account
Get balance and withdrawal
Calculate resulting balance
then
else if new balance between zero and overdraft limit
else
Algorithm
If new balance is >= zero
NAME TYPE Notes
Overdraft_Limit Integer -50 (for ease of change)
Zero Integer 0 (for readability only)
Balance Integer Balance in the account
Withdrawal Integer Amount requested by user
Resulting_Balance Integer Balance after withdrawal
test_1 test_2 test_3 (^) s_1 s_2 s_3 s_
F F F * F F T * F T F * F T T * T F F * T F T * T T F * T T T *
the iteration.
execution of the loop.
the program is executing, just before starting
Ada provides the
times. The number is determined during
Ada provides the
statements_
exit condition satisfied ?
true
false statements_
bin hex dec 0000 0 0 0001 1 1 0010 2 2 0011 3 3 0100 4 4 … 1001 9 9 1010 A 10 1011 B 11 … 1111 F 15
Byte
(^10100110 01111010 10100110 11010110 )
Cell 0 Cell 1 Cell 2 Cell 3 Cell 4 Cell 5 Cell 6 10111010 10010101
Address Big-Endian repr. of 1025
Little-Endian repr. of 1025 00 0000 0000 0000 0001 01 0000 0000 0000 0100
02 0000 0100 0000 0000 03 0000 0001 0000 0000
0 1 2 3 4 5 6 7 8 9
10 11 12 13 14 15
0 1 2 3 4 5 6 7 8 9 A B C D E F NUL SOH STX ETX EOT ENQ ACK BEL BS TAB LF VT FF CR SO SI
ASCII Hex Symbol 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
0 1 2 3 4 5 6 7 8 9 : ; < = >?
ASCII Hex Symbol 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
` a b c d e f g h i j k l m n o
ASCII Hex Symbol
… …
3 7 5
1 0 1 1
One
Eight One
25 24 23 22 21 20 32 16 8 4 2 1 1 0 1 1 0 1 32 + 0 + 8 + 4 + 0 + 1 = 45
Representation
Position's quantity
Representation
Position's quantity
Hundred
Ten
Four Two
Base ten system
Base two system