1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Kitty [74]
3 years ago
5

Create the algorithms in both flowchart and pseudocode form for the following two program requirements:

Computers and Technology
1 answer:
Zarrin [17]3 years ago
4 0

Answer:

Hello Brissap2814! This question has 3 parts. The first is asking you to print the highest price from an array of 100 prices. The easiest way to do this is to sort the array in ascending order, so that the highest value of the array becomes the last array element, which you can then simply print to the screen. The second part of the question is asking you to reduce the highest price that you got in the first part of the answer by 10%. Finally, the last part of the question is asking you to prompt a user to input 3 numbers and then print the numbers in ascending order. The requirements are to provide both Flowchart and Pseudocode algorithms for all 3 parts.  

Explanation:

1. Print highest price from array prices

 Algorithm: Pseudocode  

    highest_price = prices.sort.last

      OR    

    highest_price = prices.sort[100]

2.

 Algorithm: Pseudocode    

   reduced_price = highest_price – 10%  

   prices[100] = reduced_price

3.

 Algorithm: Pseudocode    

   // initialize empty array  

   input_array = []  

   // loop 3 times    

   for count in 0..2    

      prompt user input for number    

      handle exceptions for non-numeric input    

      save user input to input_array  

    end  

    // sort input array  

    input_array.sort  

    print input_array  

You might be interested in
As a prospective student, what is the best reason to request an interview with your college application?
weqwewe [10]

Answer: The correct answer is A. I just answered this question myself!

6 0
3 years ago
OSHA standards appear in the ___________ and are then broken down into ____________.
Alisiya [41]
OSHA standards appear in the Code of Federal Regulations (CFR) <span>and was then broken down into two parts. It contains standards to ensure a </span>
4 0
3 years ago
Write a program that reads the lengths of the sides of a triangle from the user. Compute the area of the triangle using Heron's
slamgirl [31]

Answer:

The java program is as follows.

import java.util.Scanner;

import java.lang.*;

public class Area

{

   //variables to hold the values

   static double a, b, c;

   static double s;

   static double area;

public static void main(String[] args) {

    //scanner class object created

    Scanner sc = new Scanner(System.in);

 System.out.print("Enter the first side: ");

 a=sc.nextInt();

 System.out.print("Enter the second side: ");

 b=sc.nextInt();

 System.out.print("Enter the third side: ");

 c=sc.nextInt();

 s=(a+b+c)/2;

 //function of Math class used

 area = Math.sqrt( s*(s-a)*(s-b)*(s-c) );

 //result displayed with 3 decimal places

 System.out.printf("The area of the triangle is %.3f", area);  

}

}

OUTPUT

Enter the first side: 1

Enter the second side: 1

Enter the third side: 1

The area of the triangle is 0.433

Explanation:

1. The variables to declare the three sides of the triangle, the semi-perimeter and the area of the triangle are declared with double datatype. All the variables are declared at class level and hence, declared with keyword, static.  

2. Inside main(), an object of the Scanner class is created.

Scanner sc = new Scanner(System.in);

3. Using the Scanner class object, user input is taken for all the three sides of the triangle.

4. Following this, the semi-perimeter is computed as shown.

s=(a+b+c)/2;

5. The area of the triangle is computed using the given formula which is implemented as shown.

area = Math.sqrt( s*(s-a)*(s-b)*(s-c) );

6. The sqrt() method of the Math class is used while computing the area of the triangle.

7. The area is displayed with three decimals. This is done using the printf() method as shown.

System.out.printf("The area of the triangle is %.3f", area);

8. The program is saved with the same name as the name of the class having the main() method.

9. The class having the main() method is always public.

3 0
3 years ago
in what way do rules and laws created to address public problems affect individuals groups and business
Anika [276]

Answer:

Explanation:

bussnise

4 0
3 years ago
Interest groups are a new political force never envisioned by the Founders. simply reflect the conflictual nature of American po
DiKsa [7]

Answer:

simply reflect the conflictual nature of American politics.

Explanation:

Interest groups simply reflect the conflictual nature of American politics.

3 0
3 years ago
Other questions:
  • Create a variable ‘temp’ and assign the value in Celsius. Display the message ‘It’s extremely hot day today!’ if the temperature
    8·1 answer
  • g Create your own data file consisting of integer, double or String values. Create your own unique Java application to read all
    7·1 answer
  • 1. Rice paste changes from white to blue black colour when a few drops of iodine solution are added to it. It shows the presence
    8·1 answer
  • What should a system administrator use to disable access to a custom application for a group of users?
    5·1 answer
  • You have three users who travel to four branch offices often and need to log on to the RODCs at these offices. The branch office
    12·1 answer
  • Create two algorithms for an everyday problem such as computing sales tax or figuring out the number of tables to seat guests. T
    10·1 answer
  • Match the elements of a web page with their description
    15·2 answers
  • Write a Python program stored in a file q1.py to play Rock-Paper-Scissors. In this game, two players count aloud to three, swing
    13·1 answer
  • Use the drop-down menus
    9·2 answers
  • Which factors have increased the need for the latest cybersecurity technologies?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!