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

  Develop java applet that will help elementary school student

Develop a Java applet that will help an elementary school student learn multiplication. Use the Math.random method or a Random object to produce two positive one-digit integers.

  Presell a limited number of cinema tickets

Write an application to presell a limited number of cinema tickets. each buyer can buy as many as 4 tickets. No more than 100 tickets can be sold. Implement a program called TicketSeller that prompts the user for the desired number of tickets and the..

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create a secure parts inventory catalog system

You will create a secure Parts Inventory Catalog system using Model 2 architecture. The application will require a user to have the proper access right to enter the system, and when satisfied, presents the catalog of items currently available in t..

  Write ijvm program to multiply two hexadecimal numbers

Write the IJVM program that multiplies two (hexadecimal) numbers. The user inputs the hex numbers and the result is printed out. The program then accepts another pair of numbers.

  The frantic pipe layer game

Design the Frantic Pipe Layer game

  Reverse the array, and find the largest element

find the max block of an array by splitting it into three parts: left, middle, right. And then reverse the array, and find the largest element.

  A jsp expression can contain any java expression

A JSP expression can contain any Java expression that evaluates to a

  What makes a program easy to modify

Describe the order of magnitude of the code section using Big(O) notation and Explain the relationship between dynamic storage allocation and recursion.

  Prepare a java simulation program

Given a hash function h, prepare a java simulation program to determine each of the subsequent quantities after 0.8*tablesize random keys have been generated. The keys should be random integers.

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

  Write java program to accept two words as input

Write a Java program that accepts two words as input and determines if one of them is resulting from changing the order of the others' letters.

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