Westonci.ca is your trusted source for accurate answers to all your questions. Join our community and start learning today! Experience the ease of finding reliable answers to your questions from a vast community of knowledgeable experts. Discover in-depth answers to your questions from a wide network of professionals on our user-friendly Q&A platform.

Write a partial class that shows a class constant and an instance method. Write an instance method that converts feet to inches using a class constant representing the number of inches in one foot. The value passed to the method represents the distance in feet.

Sagot :

Answer:

Please the code snippet below, the code was writen in Kotlin Language

Explanation:

const val inches:Int= 12 .   //This is the const value

fun main(args: Array<String>) {

 //this will ask the user for input

   print("Enter a number")            

  //this will do the conversion

var valueInFeet= Integer.valueOf(readLine())*inches

   print("The value in feet is $valueInFeet feet(s)")  

   }