Question:

Help <span title="please!!!!!!!!!!!!!!!!!!!!!!!?">please!!!!!!!!!!!!!!!!!!!...</span>

by  |  earlier

0 LIKES UnLike

Can some help me with these Information Technology Programming questions.

1.Design a pseudocode algorithm that finds the average age of 10 of your friends and display the name and age of the eldest friend.

2. Write an algorithm, which reads three values a, b, and c and prints the largest of the three.

3. Write an algorithm to read 10 positive integers and find the average of all even numbers.

4. Write an algorithm to read the names of 10 items and their prices, and print the name of the item with the highest price. Assume that no items have the same price. Data is supplied in the form: item1, price1, item2, price2 etc.

 Tags:

   Report

1 ANSWERS


  1. 1)  I&#039;ll start by defining an array of integers that will be the input to my function.  A = [age1 age2 ... age10] Where A[i] returns the ith element and A[0] = age1.

    We define a function that returns a fp number:

    AverageAgeFinder(A){

    int total = 0;

    int index = 0;

    int limit = length(A);

    while(index&lt;limit){

    total = total + A[index];

    index = index + 1;

    }

    return total/limit

    }

    2) Define a function Average(a,b,c) with input of 3 floating points a,b and c.  

    Average(a,b,c){

    If(a&gt;b and a&gt;c)

    print(a);

    else if(b&gt;a and b&gt;c)

    print(b);

    else if(c&gt;a and c&gt;b)

    print(c);

    else

    print(&quot;no largest value&quot;);

    }

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.