Java program that allows the user to enter a letter

Assignment Help JAVA Programming
Reference no: EM13163314

Write a java program that allows the user to enter a letter (as a code) and a real number (as the radius of a circle). If the letter is 'A' your program must calculate the area of the circle. If the letter is 'C' your program must calculate the circumference of the radius. In each case you must print the output using the appropriate message.

You have to use the following two methods for this program:

1) A method that accepts the radius and returns the area. The header of the method could be like

          public static double Area (double radius )

2) A method that accepts the radius and returns the circumference. The header of the method could be like

          public static double Circumference(double radius )

Turn in the hard copy of

1)      Flowchart

2)      Source file (make sure you have comments in the source file and print the file from IDE)

3)      Output (print screen)

 

Reference no: EM13163314

Questions Cloud

A graph is two-connected iff : A graph is two-connected iff, removal of any single vertex and the edges adjacent to that vertex, leaves the graph connected. How can we tell if a graph is two-connected? Explain your algorithm in English
Which reduces the solubility of calcium fluoride : Which of the following reduces the solubility of calcium fluoride?
How much heat in kilojoules is required to warm : How much heat in kilojoules is required to warm 10.0 of ice, initially at -10.0, to steam at 125. The heat capacity of ice is 2.09 and that of steam is 1.84 .
Design the static method below to count : Design the static method below to count and return the frequency of each digit in the array of strings.
Java program that allows the user to enter a letter : Write a java program that allows the user to enter a letter (as a code) and a real number (as the radius of a circle). If the letter is 'A' your program must calculate the area of the circle. If the letter is 'C' your program must calculate the ci..
What mass of oxygen gas is required in order to release : What mass of oxygen gas is required in order to release 6670 kJ of heat to the surroundings by the following reaction
Calculate the concentration of all species : Sodium azide (NaN3) is sometimes added to water to kill bacteria. Calculate the concentration of all species in a 0.010 M solution of NaN3. The Ka value for hydrazoic acid (HN3) is 1.9 * 10-5.
Compute the ph during the titration : Calculate the pH during the titration of 50.00 ml of 0.0500 M NaOH with 0.1000 M CH3CO2H after the addition of the following volumes
What is the mass in grams of the lead : The water level in a graduated cylinder initially at 221 rises to 271 after a piece of lead is submerged. What is the mass in grams of the lead?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Java application to generate three-digit random number

Write a Java application that generates a 3-digit random number 100 times. Display the output for each of the generated numbers and the sum of all 100 numbers.

  Java program that will prompt the user to input a file

Write a Java program that will prompt the user to input a file (document) in order to count the frequency of each word. This program will display the frequency of each word sorted alphabetically or by frequency (depending on the preference of the use..

  Write specifications for method which advances date by one

Write specifications for the method which advances any given date by one day. Comprise a statement of purpose, pre- and post-conditions, and description of parameters.

  What is the average response time for this system?

A web server receives a request every 50ms and processes web requests every 8 ms. Using queuing theory, 1. What is the average response time for this system?

  Create a file that contains your favorite movie quote

Create a file that contains your favorite movie quote. Use a text editor such as Notepad, and save the file as quote.txt. Copy the file contents,

  Write a program that asks the user to enter three names

Write a program that asks the user to enter three names

  Write a functions that takes an array of doubles

1. Write a function that is passed a single integer and then calculates the factorial of that number. A factorial is the product of the integer times all of the integers below it stopping at 1. So n!= n*(n-1)*(n-2).......3.2.1

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Loops and files

Convert an algorithm using control structures into Java and write a while loop

  A remote web-based file storage application

Develop a web-based application. The server-side part of the application must be developed using Java Servlets (possibly including JSP). The development of the client (browser) side will typically be a combination of HTML and Javascript.

  Calculate the maximum data rate in mb/second

b)How much cylinder skew is needed for an Oceangate disk operating at 20,000 rpm(new series for the Christmas promotions) which has a seek time of 0.5 milliseconds? This disk has 800 sectors of 512 bytes each on each track.

  Create your own date class

You are to write a program that determines the day of the week for New Year's Day in the year 3000. To do this, you must create your own date class (MyDate) and use the following interface and main program:

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