Question
For Kotlin language and you can make this in IntelliJ I would like you to build BirdCage, with appropriate inits, getters and setters. Your primary
For Kotlin language and you can make this in IntelliJ
I would like you to build BirdCage, with appropriate inits, getters and setters. Your primary resource for this is theKotlinBootcampfor Programmers 4tutorial, sections 2 - 4. For this assignment, you should make an entirely new project and immediately create a new BirdCageclass (no need to create a separate package, as is covered in the tutorial, you can just put your class file directly in the srcfolder). Imagine that your bird cage is cylindrical, with bars extending regularly from the base of the cage to a point above the center fo the base;like this one. Your BirdCageclass should include:
Initialization parameters for height, radius, andbarDensity(use types you think appropriate)
An initto print a 'Constructing Bird Cage' string
Methods for:
printSize (in a form similar to the tutorial)
checkFit(a function that checks to see if a given bird will fit into the cage without escaping - pass checkFitan integer value and as long as it is greater than the space between the bars we say the bird will fit. i.e. checkFit(birdSize: Int): Boolean)
Property getters and setters for:
numberOfBars(equal to the barDensity/ circumference of the cage floor - the setter should set the barDensity)
Please check that your completed class is working by creating a main.kt file and creating a new BirdCage instance!
can you explain more about what you need?
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