diff --git a/q1/q1.java b/q1/q1.java index 17e9650..d94d0f0 100644 --- a/q1/q1.java +++ b/q1/q1.java @@ -1,47 +1,47 @@ -// FILL HERE: Import the necessary package for input operations +import java.util.Scanner; -// FILL HERE: Write the class declaration with proper naming convention +public class q1 { - // FILL HERE: Write the main method signature + public static void main(String[] args) { // Variable declarations and initialization - // FILL HERE: Declare an integer variable named 'age' and initialize it to 25 + int age = 25; - // FILL HERE: Declare a double variable named 'height' and initialize it to 5.8 + double height = 5.8; - // FILL HERE: Declare a char variable named 'grade' and initialize it to 'A' + char grade = 'A'; - // FILL HERE: Declare a boolean variable named 'isStudent' and initialize it to true + boolen isstudent = true; - // FILL HERE: Declare a String variable named 'name' and initialize it to "John Doe" + string name = "john doe"; // Output statements System.out.println("=== Student Information ==="); + + System.out.println("Name: " + name); - // FILL HERE: Print the name using System.out.println + System.out.println("Age: " + age); - // FILL HERE: Print the age using System.out.println (format: "Age: 25") + System.out.println("Height: " + height + " feet"); - // FILL HERE: Print the height using System.out.println (format: "Height: 5.8 feet") + System.out.println("Grade: " + grade); - // FILL HERE: Print the grade using System.out.println (format: "Grade: A") - - // FILL HERE: Print the student status using System.out.println (format: "Is Student: true") + System.out.println("Is Student: " + isStudent); // Data type demonstration System.out.println("\n=== Data Type Information ==="); + + System.out.println("age is of type: int"); - // FILL HERE: Print the data type of age variable (hint: use "int") - - // FILL HERE: Print the data type of height variable (hint: use "double") + System.out.println("height is of type: double"); - // FILL HERE: Print the data type of grade variable (hint: use "char") + System.out.println("grade is of type: char"); - // FILL HERE: Print the data type of isStudent variable (hint: use "boolean") + System.out.println("isStudent is of type: boolean"); - // FILL HERE: Print the data type of name variable (hint: use "String") + System.out.println("name is of type: String"); } -} \ No newline at end of file +}