Calculate the area and circumference of a circle

Assignment Help JAVA Programming
Reference no: EM13694478

Question 1: Write a program to move and calculate the area and circumference of a circle.

The program should read from the screen the information of a circle, which contains:

1. the location of a circle indicated by three integers, i.e.
x- and y-coordinates of the center, and radius.

2. an integer indicating the moving distance in the horizontal direction.
Positive number means moving right, otherwise moving left.

3. an integer indicating the moving distance in the vertical direction.
Positive number means moving down, otherwise moving up.

For example, suppose we read the following 5 intergers from the screen:
20 10 40 9 -7
So the location of the center is (20, 10), and radius is 40. The circle should be moved 9 units to the right and 7 units up.

You are required to declare and define the subsequent "void" functions,

1. moveCircle function, which passes coordinates of the center by reference, and the moving distances on horizontal and vertical directions by value.

2. Calculate function, which passes the radius by value, and get back the area (PI*radius*radius) and circumference (2*PI*radius) of the circle through reference

Describe each and every question in depth with examples and prepare this application in java programming.

Reference no: EM13694478

Questions Cloud

Describe and assess impact of these devices on newspaper : Personal data assistants (PDAs), iPads, and e-Readers have the capability to wirelessly connect to online stores so that their users can purchase books, music, games,read e-Books, read the news, and perform a myriad of other tasks
Determine the security risks with respect to phishing : Mobile banking features have added several advantages for customers. Determine the security risks with respect to phishing, smishing, vishing, cloning, and a lost or stolen Smartphone that have been experienced by the financial services industry ..
Solve a single quadratic equation of the form : Write a C++ program to solve a single quadratic equation of the form - The actual solution of the equation shall be done by a function named equSolver(), which takes three coefficients as parameters and returns a structure of three fields: two root..
Use of universal quantification : Let L1, L2, ..., Ln be distinct lines in the Euclidean plane, and let A be the set of points formed by intersections of these lines. Characterize A using set notation and quantifiers.
Calculate the area and circumference of a circle : Write a program to move and calculate the area and circumference of a circle. - Calculate function, which passes the radius by value, and get back the area (PI*radius*radius) and circumference (2*PI*radius) of the circle through reference
Write a function named append that accepts three arguments : Write a function named append that accepts three arguments. The first two arguments passed to append are c-strings to be appended (the second c-string is appended to the first). The third argument passed should be the size of the character array ..
Program that computes the monthly loan payment : Write a program that computes the monthly loan payment, given the loan amount (a double value), the interest, as a percent % (a double value), and the number of years to repay the loan
Draw a diagram of how the stacks might look : Two stacks of positive integers are needed, both containing integers with values less than or equal to 1000. One stack contains even integers; the other contains odd integers.
Determine the successor to the throne of france : Define the predicate Successor(Year) giving the solution as the first successor to the crown for the year specified.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Create an application for an animal-fur trimming service

create an application for an animal-fur trimming service. the business is open 15 weeks of the year from april through

  Java program use breadth-first search closest broadcast

Write the java program which will use breadth-first search (which you implement as part of your program) to determine the closest broadcast vertex for each vertex in graph.

  You need to find out the average score how many scores are

suppose that you have an array of baseball scores type integer called scores. the values in the array are ordered from

  Program mimics a rudimentary spreadsheet

Change the averages so that they are rounded to the nearest one hundredth. The example above shows averages in format - Change the program so that before the spreadsheet window is displayed, the user sees the window

  Write a java servlet to validate the data

Write a Java Servlet to validate the data submitted through the above registration page. If the required fields are empty relevant error messages should be displayed on the same registration page.

  Difference between the two following statements

What exactly is the difference between the two following statements and which is preferred, please provide details: 1) frame.setSize(400, 300); // Set JFrame Size

  Strong authentication can also risk availability

Strong authentication can also risk availability. A simple example is that forgetting your password denies you access to that which required a password. Sometimes the stakes are high, for example, if a network administrator is the only one who knows ..

  Write a java program called salesinfominer

Write a Java program called SalesInfoMiner that reads in a file of products, stored in text format. The program must then read in information about past sales transactions and output all the products to a new file, sorted by product description,..

  Your task in this assignment is to develop a graphical user

your task in this assignment is to develop a graphical user interface based java program that can communicate with a

  Find method of the class is passed each of the targets

How many calls to the recFind method of the ArraySortedList3 class are made when the find method of the class is passed each of the targets?

  A game of tic-tac-toe

A game of tic-tac-toe, two players (one the computer) take turns marking an available cell in a 3 X 3 grid (a two dimensional array) with their respective tokens (either and X or an O). When one player has placed three tokens in a horizontal

  Check wether two appointments overlap

in a scheduling program, we want to check wether two appointments overlap. For simplicity, appointments start at a full hour,

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd