Question

In: Computer Science

Area and Circumference -- FLOWGORITHM ------ You are going to update assignment 2 which was Area...

Area and Circumference -- FLOWGORITHM

------

You are going to update assignment 2 which was Area and Circumference (see below). This time the user will have the ability convert Area of Circle or the Circumference of Circle. Don’t forget all of the below requirements still apply, so if you didn’t fix or update assignment 2, you’d better get it done.

Assignment 2

In this assignment you are to develop the modules (i.e. functions or procedures). You are going to calculate the Area of Circle and the Circumference of Circle. There will be 4 modules to create. So, calculate the Area of Circle first then do the Circumference of Circle. You will have to research and decide which modules need to be a subroutine and which need to be a function.

Requirements:

  • The user will enter the information when the program is executing

  • 1st convert the Area of Circle

  • 2nd convert the Circumference of Circle

  • 5 total module, 4 modules to create

    • One for input

    • One calculating Area

    • One for calculating Circumference

    • One for output

    • And you are still required to use the main(), which runs everything

  • No decision structures or loops

  • With correct answer and the number entered will be displayed. Information will need to be passed in so the correct output will be displayed

Required use Flowgorithm, then submit it for a grade.

The formulas are:

Area of Circle: area = π * r²

  • Calculates specifically the total area within a circle.

    • For example: radius = 4

    • a = π x 4²

    • a = π x 16

    • a = 50.24

Circumference of Circle: circumference = 2π * r

  • Calculates specifically the length of the outline of a circle.

    • For example: radius = 7

    • c = 2π x 7

    • c = 43.98

Solutions

Expert Solution

Answer: Hey!! Kindly finds your solution below. Let me know if any issue. Thanks.

Pseusocode: This code has 5 modules including main. input(),output(),areaOfCircle(),circumOfCircle(). In main, all functions called to get proper result as you shown in your problem.

if any issue asks in the comment box.

Module main()
Declare Real r, area, cir
  
Set r = 1
Set r = input_function(r)
Set area = areaOfCircle(r)
Set r = input_function(r)
Set cir = circumOfCircle(r)
Call output(area, cir)
End Module

Function Real areaOfCircle(Real radius)
Declare Real area
  
Set area = 3.14 * radius * radius
  
Return area
End Function

Function Real circumOfCircle(Real radius)
Declare Real circum
  
Set circum = 2 * 3.14 * radius
  
Return circum
End Function

Function Real input_function(Real radius)
Display "Enter radius of circle: "
Input radius
  
Return radius
End Function

Module output(Real a, Real c)
Display "Area of Circle: ", a
Display "Circumference of Circle: ", c
End Module


Flowchart:


Related Solutions

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...
For this 1-2 page assignment, you are going to watch the video of a speech and...
For this 1-2 page assignment, you are going to watch the video of a speech and write a peer review as if the speaker would get the feedback from you in written form. In the review please address the following aspects of the speech, giving clear examples from the speech and then critique the student’s performance. At least three aspects of delivery At least two aspects of content Was the speech effective? Student Speeches for Analysis
In this assignment you are going to use the menu you created in Assignment 1 to...
In this assignment you are going to use the menu you created in Assignment 1 to test both your Double and Integer classes. You should add functionality to the menu to allow you test the add, sub, mul, div functions for instances of both classes You are going to have make a modification to your menu class. Currently it uses an array to hold a fixed amount of menu items. While this may be OK for most applications we want...
Write a program that calculates the area and circumference of a circle. It should ask the...
Write a program that calculates the area and circumference of a circle. It should ask the user first to enter the number of circles n, then reads the radius of each circle and stores it in an array. The program then finds the area and the circumference, as in the following equations, and prints them in a tabular format as shown in the sample output. Area = πr2 , Circumference = 2πr, π = 3.14159 Sample Output: Enter the number...
a research study in an area that is of interest to you we are going to...
a research study in an area that is of interest to you we are going to analyze the study using a one-way ANOVA by doing the following: State the null and alternative hypotheses Make a decision about the null hypothesis Draw a conclusion from the analysis Relate the results of the analysis to the research hypothesis
Write a program to calculate the area and circumference of a cuboid. Use printf to display...
Write a program to calculate the area and circumference of a cuboid. Use printf to display 2 digits after decimal point in all the results Program should be in java language.
Assignment 3 - Enhanced Employee Hierarchy For this assignment, you are going to enhance the Employee...
Assignment 3 - Enhanced Employee Hierarchy For this assignment, you are going to enhance the Employee Hierarchy that you created in Java in Programming Assignment 2 by adding an interface called Compensation with the following two methods: earnings() - receives no parameters and returns a double. raise(double percent) - receives one parameter which is the percentage of the raise and returns a void. Create the abstract class CompensationModel which implements the Compensation interface. Create the following classes as subclasses of...
Assignment 1 – Writing a Linux Utility Program Instructions For this programming assignment you are going...
Assignment 1 – Writing a Linux Utility Program Instructions For this programming assignment you are going to implement a simple C version of the UNIX cat program called lolcat. The cat program allows you to display the contents of one or more text files. The lolcat program will only display one file. The correct usage of your program should be to execute it on the command line with a single command line argument consisting of the name you want to...
pseudocode please! Assignment 5B: Moneyball: Part 2. Similar to the previous assignment, you’re going to read...
pseudocode please! Assignment 5B: Moneyball: Part 2. Similar to the previous assignment, you’re going to read in the number of years the player played and the starting year of that player – followed by the statistics for those years. This time, however, you’re going to print out the years from worst to best in sorted order. Hint: this will require a second array to store years. If you can sort one array, can you sort both? Sample Output #1: Enter...
Mental Health Awareness For this week’s assignment, you are going to be working on a campaign...
Mental Health Awareness For this week’s assignment, you are going to be working on a campaign for mental health awareness for your community. Choose either ADHD, Alcoholism, or Postpartum Depression as the topic you will chose to advocate for and disseminate information about to the public. Illustrate the disease you have chosen for public health education. Include the following aspects in your discussion: Describe your chosen diseases cause, symptoms, and outlook with proper treatment Include at least two scholarly references...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT