Lab Assignment 3
Lab Assignment 3
Lab Assignment 3
Question 1
Consider the following facts.
Add the following rules and get the output by using console.
1. A student is an excellent student if she/he is a dean list student.
2. A student is an active student if she/he involves in any committee.
3. Get who is the DCS coordinator?
4. Get who is the DICE coordinator?
5. Get who is the active student in DCS program?
6. Get who is the excellent student in DCS program?
7. Get who is the excellent student in DICE program?
8. Get who is involved in the college committee?
9. Get who is involved in the seminar committee?
Lab Assignment 4
CSC305: Programming Paradigms
Functional Programming
Question 1
Explain the use of arithmetic expressions and Input Output in Scheme language. Give an
example to support your answer. Also show the difference between functional and imperative
languages in both aspects.
Question 2
Write a program that converts degrees to radians using the formula below.
Question 3
Write a program that input an integer and display for the user whether the number is even or
odd.
Question 4
Write a program that calculates simple interest (I = PRT) given the principal, the interest rate
and period of years.
Question 5
Write a program that calculates the current through a resistor given the voltage drop across
the resistor and the resistance in ohms. Use the formula I = V/R where V is voltage, R is
resistance in ohms and I is current in amps.
Question 6
Write a program that calculates force (f = ma), where F is force in Newton’s, m is mass in
kilogram and a is acceleration in meter/second.
Question 7
Write a program that uses Einstein’s e = mc2 equation to find the amount of energy for a
given mass.
Question 8
Steel manufacturing tapes vary in length slightly depending on the temperature. When they
are manufactured, they are standardized for 20 degrees Celsius (68 degrees Fahrenheit). As
the temperature varies above or below 20 degrees C, the tape becomes slightly inaccurate,
which must be taken into consideration. The formula below will produce a length correction
given the length measured by the tape and the temperature in Fahrenheit.
(T = temperature, L = measured length)
new length = L + C
Write a function to input the measured length and temperature in Celsius and outputs and
adjusted length using the formula above.