Question
CODE IN PYTHON. ALL SAMPLE INPUTS MUST RUN !!!!!! Posting this question for the second time, in the last answer, the driver code was changed
CODE IN PYTHON.
ALL SAMPLE INPUTS MUST RUN !!!!!! Posting this question for the second time, in the last answer, the driver code was changed and the output didn't match(Had to give a thumbs down).
PLEASE READ THE INSTRUCTIONS FIRST !!! Do not change the driver code !!!
Write the Smartphone class with the required methods to give the following outputs as shown.
# Write your codes here.
# Do not change the following lines of code. s1 = Smartphone() print("=================================") s1.addFeature(Display, 6.1 inch) print("=================================") s1.setName(Samsung Note 20) s1.addFeature(Display, 6.1 inch) s1.printDetail() print("=================================") s2 = Smartphone(Iphone 12 Pro) s2.addFeature(Display, 6.2 inch) s2.addFeature(Ram, 6 GB) print(=================================") s2.printDetail() s2.addFeature(Display, Amoled panel) s2.addFeature(Ram, DDR5) print("=================================") s2.printDetail() print("=================================") | OUTPUT: ================================= Feature can not be added without phone name ================================= Phone Name: Samsung Note 20 Display: 6.1 inch ================================= ================================= Phone Name: Iphone 12 Pro Display: 6.2 inch Ram: 6 GB ================================= Phone Name: Iphone 12 Pro Display: 6.2 inch, Amoled panel Ram: 6 GB, DDR5 ================================= |
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