Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started