Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Using Java, Prompt the user to input a character and a real number, and output them. 2. If the character is A and the

1. Using Java, Prompt the user to input a character and a real number, and output them.

2. If the character is A and the number is positive, calculate the area of a circle using the number as the radius, format to 2 decimal places.

3. If the character is C and the number is positive, calculate the circumference of a circkle using the number as the radius, format to 2 decimal places.

4.If the character is not A or C or the number is not positive, print error message.

image text in transcribed

(1) Prompt the user to input a character and real number, and output therm. (1 pts) Enter a character: Enter a number: S.2 The inputs are A and 5.2 and the number is positive, calculate the area of a circle using the number as the radius, format to 2 decimal places (3 pts) Area with radius 5.2 i 84.95 (2) if the character is and the number is positive, calculate the circumference or a circle using the number as the radius, romat to 2 decimal places (3 pts) circumference with radius 5.2 1 32.67 (3) if the character is not A. or 'C', or the number is not positive, print error message (3 pts) Invalid ontEy

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Solaris 11.2 System Administration (oracle Press)

Authors: Harry Foxwell

1st Edition

007184421X, 9780071844215

More Books

Students also viewed these Databases questions

Question

what are the provisions in the absence of Partnership Deed?

Answered: 1 week ago

Question

1. What is called precipitation?

Answered: 1 week ago

Question

1.what is dew ?

Answered: 1 week ago

Question

How will the members be held accountable?

Answered: 1 week ago

Question

a. Do team members trust each other?

Answered: 1 week ago