Professional Documents
Culture Documents
Submitted By:
NAME
Enrollment No
Submitted To:
package com.mycompany.lab4;
import java.util.Scanner;
int a, b;
a=input.nextInt();
b=input.nextInt();
s.add(a,b);
s.display();
}
class Student {
int c;
c=a+b;
System.out.println(c);
LAB-04
TASK 2
package com.mycompany.lab4;
class Calculator
{
public Calculator(double a, double b)
System.out.println(a/b);
System.out.println("Addition: "+(a+b+c));
TASK 3
package com.mycompany.lab4;
import java.util.Scanner;
double weight;
System.out.println("================================");
System.out.println("-------BICYCLE INFORMATION------");
System.out.println("================================");
name1=input.next();
location=input.next();
System.out.println("--------------------------------");
System.out.println("================================");
System.out.println("--------------CAR---------------");
System.out.println("================================");
System.out.println("");
name2=input.next();
model=input.next();
speed=input.next();
System.out.println("--------------------------------");
System.out.println("================================");
System.out.println("-------------LORRY--------------");
System.out.println("================================");
System.out.println("");
name3=input.next();
model2=input.next();
System.out.println("--------------------------------");
class Information
double weight;
this.name1=name1;
this.location=location;
this.name2=name2;
this.model=model;
this.speed=speed;
this.name3=name3;
this.model2=model2;
this.weight=weight;
TASK 5
package com.mycompany.lab4;
import java.util.Scanner;
String str;
str = sc.nextLine();
int count = 0;
if(isVowel(str.charAt(i)))
count++;
case 'a', 'A', 'e', 'E', 'i', 'I', 'o', 'O', 'u', 'U' -> true;
};
TASK 6
package com.mycompany.lab4;
import java.util.Scanner;
class Student {
String firstName,lastName;
int id;
this.firstName = firstName;
this.lastName = lastName;
this.id = id;
void setStudent() {
firstName = input.next();
lastName = input.next();
public Student(){
setStudent();
int getId(){
return id;
String getFullName(){
class Lab4
System.out.print("\n \n");