Question #162739

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 + … + š‘„n

Expert's answer

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 x, total number of terms as n
sum(int x, int n)
{
    double i, total = 1.0, multi = x;
    cout << total << " ";
    for (i = 1; i < n; i++) {
          total = total + multi;
          cout << multi << " ";
          multi = multi * x;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS