Suppose you are given a transaction:
read(A);
A:= A - 150;
write(A);
read(B);
B:= B + 150;
Write (B).
Now, describe A-C-I-D properties for the above transaction.
Consider the functional dependency of relation R (M, N, R, P)
F = {M→NR, N→R, M→N, MN→RP }
Compute the canonical cover Fc of F
9) Enter the code
#include <stdio.h>
int main(int argc, char *argv[])
{
int a;
int *b;
b = &a; // b contains the address of a
// Display the value of b and the dereferenced value
printf("b = %d, *b = %d\n", b, *b);
// Assign a value to a
a = 3245;
// Display the value of b and the dereferenced value
printf("b = %d, *b = %d\n", b, *b);
return 0;
}• Make the following two-line addition to the end of the code
Assign the value 12345 to the dereferenced pointer b. In other words, assign the value 12345 to *b
Display the value of a.
Write a short reflective account explaining the functionality of your modifications.
I'm quite into games now, so how about we play In or Out! When a given number is even, the team scores so we shall print "In", but if it's not an even number, then we print "Out". Simple, right?
Give example of chained conditional
3. Read strings from standard input and wite to a file, read the info from the file and print to console.
2. Accept a month as number (eg: 3 is March), and print month name. Any invalid month should throw an exception, “Month Error”. The program should continuously ask the user to enter the month until the user choses to exit.
Define exception handling in your own words then justify, using at least four examples of pre‐ defined system exceptions. (10 marks)
1. Accept two numbers a,b from the user and print a/b. If b is entered as zero, handle the exception and print appropriate message. Use, try, catch ,throw keywords
1. Accept two numbers a,b from the user and print a/b. If b is entered as zero, handle the exception and print appropriate message. Use, try, catch ,throw keywords
2. Accept a month as number (eg: 3 is March), and print month name. Any invalid month should throw an exception, “Month Error”. The program should continuously ask the user to enter the month until the user choses to exit.
3. Read strings from standard input and wite to a file, read the info from the file and print to console.