Question

In: Computer Science

Use C++, Java, or Python3 to create your own algorithm to complete a computing task. There...

Use C++, Java, or Python3 to create your own algorithm to complete a computing task.

There are four steps to algorithm methodology. Discuss your algorithm design in relation to these four steps and describe how you went through each step of the methodology to create your algorithm.

Solutions

Expert Solution

Four steps to algorithm methodology are

1.Design

2.Analyse

3.Implement

4.Experiment

lets say our algorithm is find volume and lateral surface of a sphere given radius

Design:-The is to identify the problem and thoroughly understand it. problem is to find volume and lateral surface area of a sphere

Analyse:-Once you have the basic framework of the algorithm it’s time to start analyzing how efficient the code is in solving the problem.This is a step that some programmers like to attack after they have coded the algorithm and run it through the compiler. Others prefer to examine it prior to writing the code and analyze results based on their expectations from the design stage.

we have to think of efficiency of the problem

formula for voulume is

lateral surface area is

Implement:-Writing and coding the algorithm is the next step in the process

using namespace std;

#include<bits/stdc++.h>

int main(){

int r;

cin>>r;

float volume,surface_area;

volume=(4/3)*(22/7)*r*r*r;

surface_area=4*(22/7)*r*r;

cout<<volume<<endl;

cout<<surface_area<<endl;

return 0;

}

Experiment:-Once the algorithm is designed and coded go back and experiment with different variables in the algorithm. We have to check for different values and see the output we are getting right or wrong.


Related Solutions

Task use c++ and Create Base class task with virtual method Create a pair of derivative...
Task use c++ and Create Base class task with virtual method Create a pair of derivative classes of architecture, scientist, economist - Define a salary in each of these classes and create a method that prints the salary for each job Create a working object Use dynamic_cast Use typeid Create an object for each job that it will include the number of employees of that type and the method of printing these numbers
Your task for this assignment is use the Java Canvas and Graphics classes to create an example of a computer generated image.
Your task for this assignment is use the Java Canvas and Graphics classes to create an example of a computer generated image. This is an opportunity for you to explore computer graphics and exercise some individual creativity. You should submit well-documented code, and once your program is done, create a presentation of your program. The presentation can be a PowerPoint or Word document, or something created with similar software. It could be a PDF file. Tell us what your prject is and...
I have to use a sentinel while loop to complete the following task in a java...
I have to use a sentinel while loop to complete the following task in a java program, I want to see how this is executed so I can better understand how the sentinel while loop works. Thank you! Convert Lab 10 from a counter controlled WHILE loop to a sentinel WHILE loop. Do the following: Prompts the user to enter a grade or a -1 to quit. IF the user entered a -1 THEN Display a message that the User...
Your task is to create a Java application that converts a specified amount of one currency...
Your task is to create a Java application that converts a specified amount of one currency into another currency for a user. The application must meet the following requirements: Upon execution, the application shall display a brief welcome message announcing that the user is running the currency converter application. The application shall allow a user to convert amounts between any two of the following currencies: United States Dollars (USD), British Pounds (GBP), Swiss Francs (CHF), and Indian Rupees (INR). The...
Your task is to create a Java application that converts a specified amount of one currency...
Your task is to create a Java application that converts a specified amount of one currency into another currency for a user. The application must meet the following requirements: 1. Upon execution, the application shall display a brief welcome message to the user to let her know she is running the currency converter application. 2. The application shall allow a user to convert amounts between any two of the following currencies: United States Dollars (USD), British Pounds (GBP), Swiss Francs...
Java programming : Your task is to create an application that takes orders for beach holidays,...
Java programming : Your task is to create an application that takes orders for beach holidays, calculates, and displays the total cost. Cost is $100 per day for accommodation Wind surfing rental is $50 per day (not optional) Sales tax is 7 % The orders for this application will be how many days they wanna spend at the resort and for how many days do they want the wind surfing rental.
Create the appropriate variables and algorithm to calculate the following. Choose your own values for the...
Create the appropriate variables and algorithm to calculate the following. Choose your own values for the variables. Do not enter the code on this paper. Create a program that calculates and displays the calculation. Approximate pi (π) as 3.14159. You do not need to create a new program for each question. If certain math equations use the same variable name, then you only need to declare it once in your main function. Separate each problem using comments, like seen in...
Use Java GUI create following: Task 1: A basic UI with a button and a TextField,...
Use Java GUI create following: Task 1: A basic UI with a button and a TextField, when you press the button, set the button text to the current text field contents. Task 2: set the text field text to the mouse coordinates when that same button is pushed.
Using Python, Establish random centroids according to the k , and create your own algorithm to...
Using Python, Establish random centroids according to the k , and create your own algorithm to make clusters: create a functions kmeans() that accepts a dataframe and k as parameters, and returns the clusters created.
In your own words, describe the purpose behind performing algorithm analysis. C++.
In your own words, describe the purpose behind performing algorithm analysis. C++.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT