Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions q1/q1.java
Original file line number Diff line number Diff line change
@@ -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");
}
}
}