Provide
a) An algorithm
b) Flow chart
c) Pseudocode
(1). To illustrate the assignment of 10 to X if X < Y otherwise
5 is assigned to X.
(2). To compute the sum of the series:
𝑓(𝑥) = 1 + 𝑥 + 𝑥
2 + 𝑥
3 + … + 𝑥
a) Algorithm: In computer science and mathematics, we define a finite set of rules to solve the problem for the computer implementable instructions .
b) Flowchart: A flowchart is graphical representation of steps to solve any problem.
c) Pseudo-code:It in an artificial and informal language which helps the programmer to develop algorithm.
1)
start
initiate x
if (x>y)
assigned value is 5
if (x<y)
then assigned value be 1 to 10
end
2)start
define first term as a, total number of terms as n
common ratio r=t_(n+1)/t_n
if r>1 then,
sum =a*(r^n-1)/(r-1)
else
sum = a*(1-r^n)/(1-r)
end
Comments
Leave a comment