SELF TEST...Match the inputs and outputs for the following.....


	program READCHARACTERS (input, output);
	var     C1, C2, C3, C4, C5, C6 : char;
	begin
		readln( C1, C2, C3, C4, C5, C6 );
		writeln(C1, C2, C3, C4, C5, C6 )
	end.

	Inputs                           Outputs ( spaces shown as _ )

	a) Hi there                      a) A1_B2_
	
	b) Hi                            b) 57_4_3
	   there
	c) 694                           c) Hi_the
	   827
	d) 57 4                          d) Hi_the
	   329
	e) A1                            e) 694_82
	   B2 C3

Click here for answer

PROGRAM THREE
Ohm's law states that the voltage (V) in a circuit is equal to the current flowing in amperes (I) multiplied by the resistance in the ciruit (R) [ ie, E = I * R ]. Write a program to enter in the values of resistance and current, displaying the voltage which would exist.

Click here for answer

PROGRAM FOUR
Write a program which inputs two resistance values, and then displays their sum value when placed in series and then in parallel. [ The total series resistance is R1 + R2, whilst the parallel resistance is (R1 * R2) / (R1 + R2) ]

Click here for answer


Copyright B Brown/P Henry/CIT, 1988-1997. All rights reserved.