Question

In: Computer Science

DESIGN A FLOWCHART IN THE APPLICATION FLOWGORITHM Exercise called: Number Analysis Program Design a program that...

DESIGN A FLOWCHART IN THE APPLICATION FLOWGORITHM

Exercise called: Number Analysis Program

Design a program that asks the user to enter a maximum of 20 numbers. The program should store the numbers in an array and then display the following data:

1-The lowest number in the array.

2-The highest number in the array.

3-The total of the numbers in the array.

4-The average of the numbers in the array.

PLEASE AND THANK YOU

Solutions

Expert Solution

The Flowchart for the above Program in Flowgorithm is :-

Example Output :-

Enter the amount of numbers you want to add in array ,Maximum-20
10
Enter the numbers to assign in Array
1
2
3
4
5
6
7
8
9
10
Largest element is 10
Smallest element is1
Sum is55
Average is5.5

Code in Java for above program :-

import java.util.*;
import java.lang.Math;

public class JavaApplication {
    private static Scanner input = new Scanner(System.in);

    public static void main(String[] args) {
        int[] numbers = new int[20];
        int nums;
        
        System.out.println("Enter the amount of numbers you want to add in array ,Maximum-20");
        nums = input.nextInt();
        System.out.println("Enter the numbers to assign in Array");
        int count;
        
        count = 0;
        int smallest;
        int largest;
        int sum;
        
        sum = 0;
        double average;
        
        average = 0;
        while (count < nums) {
            numbers[count] = input.nextInt();
            if (count == 0) {
                largest = numbers[count];
                smallest = numbers[count];
            } else {
                if (count > 0 && numbers[count] > numbers[count - 1]) {
                    largest = numbers[count];
                }
                if (count > 0 && numbers[count] < numbers[count - 1]) {
                    smallest = numbers[count];
                }
            }
            sum = sum + numbers[count];
            count = count + 1;
        }
        average = (double) sum / nums;
        System.out.print("Largest element is ");
        System.out.println(largest);
        System.out.print("Smallest element is");
        System.out.println(smallest);
        System.out.print("Sum is");
        System.out.println(sum);
        System.out.print("Average is");
        System.out.println(average);
    }
}

The pseudocode for above flowchart is :-

Function Main
Declare Integer Array Numbers[20]
Declare Integer nums
  
Output "Enter the amount of numbers you want to add in array ,Maximum-20"
Input nums
Output "Enter the numbers to assign in Array"
Declare Integer count
  
Assign count = 0
Declare Integer smallest
Declare Integer largest
Declare Integer sum
  
Assign sum = 0
Declare Real average
  
Assign average = 0
While count<nums
Input Numbers[count]
If count==0
Assign largest = Numbers[count]
Assign smallest = Numbers[count]
False:
If count>0 && Numbers[count]>Numbers[count-1]
Assign largest = Numbers[count]
End
If count>0 && Numbers[count]< Numbers[count-1]
Assign smallest = Numbers[count]
End
End
Assign sum = sum+ Numbers[count]
Assign count = count+1
End
Assign average = sum/nums
Output "Largest element is "
Output largest
Output "Smallest element is"
Output smallest
Output "Sum is"
Output sum
Output "Average is"
Output average
End


Related Solutions

DESIGN A FLOWCHART IN THE APPLICATION FLOWGORITHM Exercise called: Number Analysis Program Requirement: Make two modules...
DESIGN A FLOWCHART IN THE APPLICATION FLOWGORITHM Exercise called: Number Analysis Program Requirement: Make two modules in function and two modules in regular mode that carry out the processes and print the particular result and two function modules where the results are printed in the main. Design a program that asks the user to enter a maximum of 20 numbers. The program should store the numbers in an array and then display the following data: 1-The lowest number in the...
DESIGN A FLOWCHART IN FLOWGORITHM AND WRITE THE PSEUDOCODE Number Analysis Program Design a program that...
DESIGN A FLOWCHART IN FLOWGORITHM AND WRITE THE PSEUDOCODE Number Analysis Program Design a program that asks the user to enter a series of 20 numbers. The program should store the numbers in an array and then display the following data: The lowest number in the array. The highest number in the array. The total of the numbers in the array. The average of the numbers in the array. PLEASE AND THANK YOU
DESIGN A FLOWCHART IN FLOWGORITHM Rainfall Statistics Design a program that lets the user enter the...
DESIGN A FLOWCHART IN FLOWGORITHM Rainfall Statistics Design a program that lets the user enter the total rainfall for each of 12 months into an array. The program should calculate and display the total rainfall for the year, the average monthly rainfall , and the months with the highest and lowest amounts. PLEASE AND THANK YOU
create flowchart using Flowgorithm and Pseudocode for the following program example:   Design a program for Jones...
create flowchart using Flowgorithm and Pseudocode for the following program example:   Design a program for Jones College. The current tuition is $12,000 per year, and tuition is expected to increase by 5 percent each year. Display the tuition amount for each year over the next five years (use a looping structure).
DESIGH A FLOWCHART IN FLOWGORITHM Speeding Violation Calculator. Design a program that calculates and displays the...
DESIGH A FLOWCHART IN FLOWGORITHM Speeding Violation Calculator. Design a program that calculates and displays the number of miles per hour over the speed limit that a speeding driver was doing. The program should ask for the speed limit and the driver's speed. Validate the input as follows: The speed limit should be at least 20, but not greater than 70. The driver's speed should be at least the value entered for the speed limit (otherwise the driver was not...
For this assignment, you will create flowchart using Flowgorithm to represent the logic of a program...
For this assignment, you will create flowchart using Flowgorithm to represent the logic of a program that allows the user to enter a number of dollars and convert it to Euros and Japanese yen. You will have to do some research on current rates of monetary exchange for this one. Don't forget to declare your variables and use output statements to prompt the user to enter specific values prior to including an input statement. You will use an assignment statement...
PLEASE DESCING A FLOWCHART IN FLOWGORITHM Test Average and Grade Write a program that asks the...
PLEASE DESCING A FLOWCHART IN FLOWGORITHM Test Average and Grade Write a program that asks the user to enter five test scores. The program should display a letter grade for each the five test score and the average test score. Design the following functions in the program : -calAverge This function should accept five test scores as arguments and return the average of the scores. -determineGrade This function should accept a test score as an argument and return a letter...
Design a program using a flowchart or pseudocode that accepts a person’s loyalty card number and...
Design a program using a flowchart or pseudocode that accepts a person’s loyalty card number and amount spent in the store last month. Display the data only if the customer is a high spender – a person who spent more than $1000 in the store. A program that accepts customer info continuously until a sentinel value is entered and displays a list of high spenders.
PLEASE USE THE FLOWORITHM APPLICATION FOR THE ANSWER . I need that not a flowchart .Design...
PLEASE USE THE FLOWORITHM APPLICATION FOR THE ANSWER . I need that not a flowchart .Design the logic for a program that takes in three numbers from the user. Find the largest of the three numbers and output the largest number.
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...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT