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

  Reads in up to 1000 non-negative integers

Write a program that reads in up to 1000 non-negative integers and displays distinct numbers (i.e., if a number appears multiple times, it is displayed only once). (Hint: Read each number and store it in an array if it is new. If the number is alread..

  Prepare executable program and a dictionary program

Prepare executable program and a dictionary Program.

  Java-s ability to derive new fonts from existing ones

Find out where on your system these font libraries are located. When you do, please specify the operating system and the location (folder/directory) where you found them. Discuss Java's ability to derive new fonts from existing ones.

  Bilinear and nearest neighbour algorithm in java

How to do bilinear and nearest neighbour algorithm in java. Show how to eliminate change in pixel aspect ratio in java.

  Write a program that assigns seats on an airplane

Prepare a program that teaches arithmetic to a young child. The program tests subtraction and addition. Write a program that assigns seats on an airplane.

  List various bindings that are needed to determine semantics

List the various bindings that are required to determine the semantics when the statement is executed. For each binding, indicate the binding time used for the language.

  Compute area and perimeter of a polygon

Create a project that would let a user compute area and perimeter of a polygon

  Program that initializes an array with ten random integers

Write a JAVA program that initializes an array with ten random integers and then prints four lines of output, containing

  Program should assign a seat in the first class

If a person enters 1, your program should assign a seat in the first class (rows 1 - 3). If a person enters 2, your program should assign a seat in business class (rows 4 - 7). If a person enters 3, your program should assign a seat in economy class ..

  Inheritancedemo

Create a New Project named InheritanceDemo . 2. Create a new class called Person and cut and paste the Person.java file from Blackboard into the class. Create a new class called Student and cut and paste the Student.java file from Blackboard into the..

  Write a recursive program

Write a recursive program to compute the number of ways in which an integer k can be written as sum

  Implementation of encryption and steganography in java

This is a project report showing the essential details and coding structures related with the implementation of encryption techniques and steganography in JAVA.

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