Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CPS 1231 SI Session: Exercise 2 Elementary Programming (Ch2) 2. Write a program that reads in the radius and length of a cylinder and computes

image text in transcribed

CPS 1231 SI Session: Exercise 2 Elementary Programming (Ch2) 2. Write a program that reads in the radius and length of a cylinder and computes the area and volume using the following formulas: area = radius * radius * pi volume = area * length --Sample Run-- Enter the radius and length of a cylinder: 5.5 12 Enter The area is 95.6339975 The volume of the cylinder is 1140.39717 2-1. How many variables would you need? (1 point) 2-2. What datatype should you assign to the corresponding variables? (1 point) 2-3. Using the Scanner class for the console input, should you invoke the .nextInt() or .nextDouble() method? Why? (1 point) 2-4. Using a flowchart, Pseudocode and/or comments, show how you will structure your program. (1 point) 2-5. Name you class (program) SISession and show your running code. (1 point)

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

More Books

Students also viewed these Databases questions

Question

4. Identify the challenges facing todays organizations

Answered: 1 week ago

Question

2. Why?

Answered: 1 week ago

Question

1. Where do these biases come from?

Answered: 1 week ago