subject
Engineering, 31.12.2019 03:31 chinadoll24

Develop a program that computes the scalar product of two vectors. the program must not accept vectors having different size (in such a case print an error message) for example:

> (scalar-product '# (1 2 3) '#(2 1 1))
7
> (scalar-product '#(1 2 3) '#(1 2 3 4 5))
error: different sizes of vectors!
>

a) write the program in iterative style using the do loop
b) write the program using recursion.

ansver
Answers: 1

Another question on Engineering

question
Engineering, 04.07.2019 18:20
Atank with constant volume contains 2.27 kg of a mixture of water phases (liquid-vapor). in the initial state the temperature and the quality are 127 °c and 0.6, respectively. the mixture is heated until the temperature of 160 oc is reached. illustrate the process in a t-v diagram. then, determine (1) the mass of the vapor in kg at the initial state, (2) the final pressure in kpa.
Answers: 3
question
Engineering, 04.07.2019 19:20
Brief discuss how the presence of dislocations in crystal structures can be an advantage and a disadvantage to engineer and designers.
Answers: 3
question
Engineering, 06.07.2019 02:30
On solidification from a melt, the polymer polyethylene forms a semi-crystalline spherulite structure. (i) sketch an individual spherulite and label the amorphous and crystalline regions. (ii) draw a schematic to show the changes in specific volume with temperature during cooling from the melt, comparing it to the theoretical extremes of fully crystalline and fully amorphous (indicate tm and tg)
Answers: 2
question
Engineering, 06.07.2019 03:10
What is the direction and how to operate the lathe?
Answers: 2
You know the right answer?
Develop a program that computes the scalar product of two vectors. the program must not accept vecto...
Questions
question
English, 19.02.2021 19:40
question
SAT, 19.02.2021 19:40
question
Mathematics, 19.02.2021 19:40
question
Social Studies, 19.02.2021 19:40
question
Mathematics, 19.02.2021 19:40
question
Mathematics, 19.02.2021 19:40
Questions on the website: 13722367