Write a Java program to count the average of two integer numbers.
Write a Java program to count the average of two integer numbers. Q.4 Write a Java program to count the average of two integer numbers. Solution :-Â import java.util.Scanner; public class AverageCalculator {public static void main(String[] args) {Scanner scanner = new Scanner(System.in); System.out.print(“Enter the first integer: “);int num1 = scanner.nextInt();System.out.print(“Enter the second integer: “);int num2 […]
Write a java program to convert second to hours.
Write a java program to convert second to hours. Q.3 Write a java program to convert second to hours. Solution :-Â import java.util.Scanner; public class SecondsToHoursConverter {public static void main(String[] args) {Scanner scanner = new Scanner(System.in);System.out.print(“Enter the time in seconds: “);int seconds = scanner.nextInt();int hours = seconds / 3600;int remainingSeconds = seconds % 3600;int minutes […]
Write a Java Program to convert meter to centimetre.
Write a Java Program to convert meter to centimetre. Q.2 Write a Java Program to convert meter to centimetre. Solution :- import java.util.Scanner; public class MeterToCentimeterConverter {public static void main(String[] args) {Scanner scanner = new Scanner(System.in);System.out.print(“Enter the measurement in meters: “);double meters = scanner.nextDouble();double centimeters = meters * 100;System.out.println(meters + ” meters is equal to […]
Write a java program to convert the money. From rupee to paisa.
Write a java program to convert the money. From rupee to paisa. Q.1 Write a java program to convert the money. From rupee to paisa. Solution :- import java.util.Scanner; public class RupeeToPaisaConverter {public static void main(String[] args) {Scanner scanner = new Scanner(System.in);System.out.print(“Enter the amount in rupees: “);double rupees = scanner.nextDouble();int paisa = (int) (rupees * […]
JAVA_KOMPOZER_PRACTICAL
JAVA QUESTION. Q.1 Write a java program to convert the money. From rupee to paisa. Q.2 Write a Java Program to convert meter to centimetre. Q.3 Write a java program to convert second to hours. Q.4 Write a Java program to count the average of two integer numbers. Q.5 Write a Java Program to enter […]
Create a table with Sub queries
Create a table with Sub queries Q.1 Create a table Employees. Solution :- CREATE TABLE Employees (EmployeeID INT PRIMARY KEY,EmployeeName VARCHAR(50),Department VARCHAR(30),Salary INT,Age INT); Q.2 Create a table Projects. Solution :- CREATE TABLE Projects (ProjectID INT PRIMARY KEY,ProjectName VARCHAR(50),EmployeeID INT,Budget INT,FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID)); Q.3 Insert into table Employees. Solution :- INSERT INTO Employees […]
SET C 1,2
SET C 1,2 create database student; use student; create table students( studentID int primary key, studentName varchar (100), age int, class varchar (10), marks float ); insert into students values(1,”Alice Johnson”,17,”12th”,85); insert into students values(2,”Bob smith”,18,”12th”,92); insert into students values(3,”Charlie Brown”,17,”11th”,74); insert into students values(4,”Diana Prince”,18,”12th”,88); insert into students values(5,”Edward Wilson”,17,”11th”,64); ———————————————————————————————– create database product; […]
SET B 1,2
def create_and_write_file(): Â Â with open(“myself.txt”, “w”) as file: Â Â Â Â file.write(“Hello, my name is Alex.n”) Â Â Â Â file.write(“I am passionate about programming and technology.n”) Â Â Â Â file.write(“I enjoy learning new skills and solving challenges.n”) def append_and_display_file(): Â Â additional_content = ( Â Â Â Â “I believe in […]
SET A 1
Bookstack=[] def stack_create(): Â Â A=input(“Enter Book Name”) Â Â B=input(“Enter Book’s Author Name “) Â Â C=input(“Enter The Book’s publication year”) Â Â data=[A,B,C] Â Â Bookstack.append(data) def pop_book(): Â Â if len(Bookstack)==0: Â Â Â Â print(“Stack IS IN UNDERFLOW “) Â Â else: Â Â Â Â C=Bookstack[-1] Â Â Â Â […]
Chapter 1 – Introduction to Computers and Java Programming
Chapter 1 – Introduction to Computers and Java Programming 1.1 Introduction to Computers Definition of a Computer A computer is an electronic device that performs computations, processes data, and makes logical decisions. It relies on hardware and software to execute tasks efficiently. Main Hardware Components. Central Processing Unit (CPU) Role: Executes instructions and processes data. […]