Question

In: Computer Science

Write an algorithm (flowchart OR Pseudocode) for the following problems: Take ten different numbers as input...

Write an algorithm (flowchart OR Pseudocode) for the following problems:
  1. Take ten different numbers as input and display the sum of there squares (SS).

    Example: let the inputs are: 3, 0, -1, 0, 9, -5, 6, 0, 2, 1 then 157 is displayed, because: SS=32+02+(-1)2+02+92+(-5)2+62+02+22+12=157

  2. Take input character from the user unless he enters '$'. Thereafter display how may vowels were entered by the user. Also display the number of each vowel ('a', 'e', 'i', 'o' and 'u') separately.

    For example if the user enters B
    a
    b
    e
    c
    o
    o
    d
    i
    u
    g
    o
    a
    l
    $
    Then we have the output below:
    #A=2
    #E=1
    #I=1
    #O=3
    #U=2

Solutions

Expert Solution

Take ten different numbers as input and display the sum of there squares (SS).

Function Main
    Declare Integer sum
    Declare Integer a
  
    For i = 0 to 9
        Input a
        Assign sum = sum+(a*a)
    End
    Output sum
End

Take input character from the user unless he enters '$'. Thereafter display how may vowels were entered by the user. Also display the number of each vowel ('a', 'e', 'i', 'o' and 'u') separately.

Function Main
    Declare Integer Array Vowels[5]
    Declare String a
  
    While a!="$"
        Input a
        If a=="A" || a=="a"
            Assign Vowels[0] = Vowels[0]+1
        End
        If a=="E" || a=="e"
            Assign Vowels[1] = Vowels[1]+1
        End
        If a=="I" || a=="i"
            Assign Vowels[2] = Vowels[2]+1
        End
        If a=="O" || a=="o"
            Assign Vowels[0] = Vowels[0]+1
        End
        If a=="U" || a=="u"
            Assign Vowels[0] = Vowels[0]+1
        End
    End
    Output "#A" = Vowels[0]
    Output "#E" = Vowels[1]
    Output "#I" = Vowels[2]
    Output "#O" = Vowels[3]
    Output "#U" = Vowels[4]
End


Related Solutions

Write an algorithm (flowchart) for the following problems: Take ten different numbers as input and display...
Write an algorithm (flowchart) for the following problems: Take ten different numbers as input and display the sum of there squares (SS). Example: let the inputs are: 3, 0, -1, 0, 9, -5, 6, 0, 2, 1 then 157 is displayed, because: SS=32+02+(-1)2+02+92+(-5)2+62+02+22+12=157
Write an algorithm (flowchart OR Pseudocode) for the following problem Take input character from the user...
Write an algorithm (flowchart OR Pseudocode) for the following problem Take input character from the user unless he enters '$'. Thereafter display how may vowels were entered by the user. Also display the number of each vowel ('a', 'e', 'i', 'o' and 'u') separately. For example if the user enters B a b e c o o d i u g o a l $ Then we have the output below: #A=2 #E=1 #I=1 #O=3 #U=2
Write a Python program that: Create the algorithm in both flowchart and pseudocode forms for the...
Write a Python program that: Create the algorithm in both flowchart and pseudocode forms for the following requirements: Reads in a series of positive integers,  one number at a time;  and Calculate the product (multiplication) of all the integers less than 25,  and Calculate the sum (addition) of all the integers greater than or equal to 25. Use 0 as a sentinel value, which stops the input loop. [ If the input is 0 that means the end of the input list. ]...
(Do the algorithm and flowchart) Write a C++ program that reads integer numbers and print it...
(Do the algorithm and flowchart) Write a C++ program that reads integer numbers and print it in horizontal order of the screen
Homework Arrays and Tables In this assignment you are to create an algorithm, flowchart, and pseudocode...
Homework Arrays and Tables In this assignment you are to create an algorithm, flowchart, and pseudocode for a solution of the following problem. This solution will include the use of arrays needed to complete all parts of the logic. You have requested to develop a program that will record and process the rainfall totals of a 12 month period. You would use an array to store each months total. Once all 12 months amounts are entered then your solution need...
write pseudocode for the following problems not c code Pseudocode only Write a C program to...
write pseudocode for the following problems not c code Pseudocode only Write a C program to print all natural numbers from 1 to n. - using while loop Write a C program to print all natural numbers in reverse (from n to 1). - using while loop Write a C program to print all alphabets from a to z. - using while loop Write a C program to print all even numbers between 1 to 100. - using while loop...
Develop an Algorithm and java program using Design Recipe for the following problems. Draw a flowchart...
Develop an Algorithm and java program using Design Recipe for the following problems. Draw a flowchart to compute the largest and smallest of 4 numbers : Write a Java Program for the above flowchart, use methods(functions), and nested if-else statements. Take input from the user using the Scanner object. Use separate methods to compute the Largest and Smallest of the numbers. Method 1 Name: findLargest(param 1, param 2, param 3, param 4) Method 2 Name: findSmallest(param 1, param 2, param...
Make an algorithm in the form of a sentence and flowchart from the following cases: Algorithm...
Make an algorithm in the form of a sentence and flowchart from the following cases: Algorithm for calculating the amount of net salary if known: the amount of base salary, allowances, melting money, taxes, and credit deductions.
6. Write a program in C programming (compile and run), a pseudocode, and draw a flowchart...
6. Write a program in C programming (compile and run), a pseudocode, and draw a flowchart for each of the following problems: a) Obtain three numbers from the keyboard, compute their product and display the result. b) Obtain two numbers from the keyboard, and determine and display which (if either) is the smaller of the two numbers. c) Obtain a series of positive numbers from the keyboard, and determine and display their average (with 4 decimal points). Assume that the...
Draw a structured flowchart or write pseudocode that describes the process of guessing a number between...
Draw a structured flowchart or write pseudocode that describes the process of guessing a number between 1 and 100. After each guess, the player is told that the guess is too high or too low. The process continues until the player guesses the correct number. Pick a number and have someone try to guess it by following your instructions. Submit the flowchart or pseudocode and the results of your test. Create a python program based on your flowchart or pseudocode....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT