Write a program that accepts the dimensions of a Cone and prints its corresponding base area, and, lateral surface area. PROGRAM DESIGN Create a class named ConeAreas. Only this class should exist. Within this class, are the following methods: the constructor method and the printResults method. Only this class should exist and should be coded within your file. Name your file as

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter9: Using Classes And Objects
Section: Chapter Questions
Problem 1CP: In previous chapters, you have created programs for the Greenville Idol competition. Now create a...
icon
Related questions
Question

The instructions are in the attached photos. Please use python and can you please put comments in every line of the code so that I can understand it clearly. Thank you.

 

*Here's the input code

from ConeAreas import ConeAreas

inp = input().split()
inputs = (float(x) for x in inp)
c = ConeAreas(*inputs)
c.printResults() 

Cone Areas
Write a program that accepts the dimensions of a Cone and prints its corresponding
base area, and, lateral surface area.
PROGRAM DESIGN
Create a class named ConeAreas. Only this class should exist. Within this class, are the
following methods: the constructor method and the printResults method. Only this
class should exist and should be coded within your file. Name your file as
ConeAreas.py
ConeAreas
*dimensions
+ printResults ()
The constructor should accept an arbitrary value argument called dimensions which
would two measurements: the diameter of the circular base of a cone, and the height
of a cone.
The printResults method, gets and prints the surface area and volume of the shape given
its dimensions.
However, if the user entered any number of arguments, other than 2 - then, the error
"Cone Area Error!" should be printed instead. Also note all 2 dimensions should not be
equal to zero or a negative number, otherwise, the error should be printed.
Base Area
Lateral Surface Area
r(h? + r2)
Where r is the radius of the circular base, h is the height of the cone, and r is 3.14159.
Transcribed Image Text:Cone Areas Write a program that accepts the dimensions of a Cone and prints its corresponding base area, and, lateral surface area. PROGRAM DESIGN Create a class named ConeAreas. Only this class should exist. Within this class, are the following methods: the constructor method and the printResults method. Only this class should exist and should be coded within your file. Name your file as ConeAreas.py ConeAreas *dimensions + printResults () The constructor should accept an arbitrary value argument called dimensions which would two measurements: the diameter of the circular base of a cone, and the height of a cone. The printResults method, gets and prints the surface area and volume of the shape given its dimensions. However, if the user entered any number of arguments, other than 2 - then, the error "Cone Area Error!" should be printed instead. Also note all 2 dimensions should not be equal to zero or a negative number, otherwise, the error should be printed. Base Area Lateral Surface Area r(h? + r2) Where r is the radius of the circular base, h is the height of the cone, and r is 3.14159.
INPUT
There will be no inputs for this activity, as you are only tasked to create the required
class. However, if you want to try the test cases below, you can download the inputs.py
file – and run it along with your ConeAreas.py file. Note: you are not allowed to edit the
contents of inputs.py or place the contents of inputs.py in ConeAreas.py! The sequence
of inputs are: diameter followed by height.
OUTPUT
Once the user enters the input, the program should be able to calculate and print the given
shape's surface area and volume, rounded off to 1 floating point (use %.if). If the user
decides to enter more or less than the required number of inputs, then the program should
output "Cone Area Error!" instead. The same error would be printed if the user entered
zero/negative dimension values.
SAMPLE INPUT
SAMPLE OUTPUT
45
BA: 12.6 LSA: 33.8
10 11
BA: 78.5 LSA: 189.8
1
Cone Area Error!
1111
Cone Area Error!
Cone Area Error!
O -100
Cone Area Error!
GRADING CRITERIA
Implementation of programming structures – 35%
> This entails that loops and conditionals are implemented judiciously on the appropriate
python sequences for the program specifications. Judicious implementation means that
redundancy in control structures (conditions and loops) should be avoided when these can
be simplified. Classes and methods should be properly coded, without any redundancies.
Use of Object-Oriented functionality (classes and methods) should be strictly observed.
Functionality of the program – 30%
> This entails that the program should have the proper methods that would process the data
inputs and output of the project correctly (as stated in the sample inputs and outputs). No
unhandled errors should be encountered. Brute force solutions (predefined outputs for
specific inputs) are not allowed.
Proper documentation of the program – 25%
> This entails that proper documentation was made on each functionality / structure done in
the code through proper comments within the code.
Transcribed Image Text:INPUT There will be no inputs for this activity, as you are only tasked to create the required class. However, if you want to try the test cases below, you can download the inputs.py file – and run it along with your ConeAreas.py file. Note: you are not allowed to edit the contents of inputs.py or place the contents of inputs.py in ConeAreas.py! The sequence of inputs are: diameter followed by height. OUTPUT Once the user enters the input, the program should be able to calculate and print the given shape's surface area and volume, rounded off to 1 floating point (use %.if). If the user decides to enter more or less than the required number of inputs, then the program should output "Cone Area Error!" instead. The same error would be printed if the user entered zero/negative dimension values. SAMPLE INPUT SAMPLE OUTPUT 45 BA: 12.6 LSA: 33.8 10 11 BA: 78.5 LSA: 189.8 1 Cone Area Error! 1111 Cone Area Error! Cone Area Error! O -100 Cone Area Error! GRADING CRITERIA Implementation of programming structures – 35% > This entails that loops and conditionals are implemented judiciously on the appropriate python sequences for the program specifications. Judicious implementation means that redundancy in control structures (conditions and loops) should be avoided when these can be simplified. Classes and methods should be properly coded, without any redundancies. Use of Object-Oriented functionality (classes and methods) should be strictly observed. Functionality of the program – 30% > This entails that the program should have the proper methods that would process the data inputs and output of the project correctly (as stated in the sample inputs and outputs). No unhandled errors should be encountered. Brute force solutions (predefined outputs for specific inputs) are not allowed. Proper documentation of the program – 25% > This entails that proper documentation was made on each functionality / structure done in the code through proper comments within the code.
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Adjacency Matrix
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT