The document describes a programming task that requires completing a convert() method to cast a double parameter to an integer by truncating decimals. The main() method will call convert() and print the returned integer value. Students are asked to write code for the convert() method to cast doubles like 19.9 to 19 and 3.1 to 3 for testing in a provided program that prints the result.
Complete the convert() method that casts the parameter from a double .pdf
1. Complete the convert() method that casts the parameter from a double to an integer and returns
the result. Note that the main() method prints out the returned value of the convert() method. Ex:
If the double value is 19.9 , then the output is: 19 Ex: If the double value is 3.1 , then the output
is: 3 begin{tabular}{l|l} LAB & 8.21.1: LAB: Write convert 0 method to cast double to int
ACTITY end{tabular} 0/10 LabProgram.java Load default template... Run your program as
often as you'd like, before submitting for grading. Below, type any needed input values in the
first box, then click Run program and observe the program's output in the second box. Enter
program input (optional) If your code requires input values, provide them here.