Question: please answer in Kotlin programming language For this lab, you are going to create a Kotlin class that stores photo metadata. This metadata class will
please answer in Kotlin programming language
For this lab, you are going to create a Kotlin class that stores photo metadata. This metadata class will use computed properties and as well as methods to allow users to find out data about the photo that was not previously stored in the original camera data. Your Kotlin class should include properties for the
following: aperture, Shutter Speed, ev, description, iso, lux
EV is a value that should be derived using a getter. It should be set based on the following
formula: ev=log2(a2t)+log2(iso100)
ev is exposure value, a is aperture value, and t is time (shutter speed).
lux=2.52ev
Since lux is also totally calculated via the other data, there is no reason that it should be stored. This should be a calculated property as well. One you have completed the class, create a test program to create two instances of photos from user input (the user will provide aperture, shutter speed and ISO). Set the various properties and test the output by creating print statements that output the data from the various properties.
Requirements
- The class needs to have primary constructor. You may use an init block if desired
- The constructor should accept as input: iso, aperture, and shutter speed values.
- The ev and lux values should be a calculated properties.
- The description should initialize to an empty string.
- The description should be set via a custom setter that ensures all the text is capitalized.
- The property names MUST BE named exactly as described above. Failure to follow this rule will result in a 50% grade deduction.
- You must create a program that uses user input to create two instances of the PhotoMetadata class and test the output of each of the properties for both objects using print statements.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
