๐Ÿ”’ Closed Pa tulong naman ๐Ÿ˜ญ

Status
Not open for further replies.

Exconvict99

Grasshopper
Patulong naman kung ano ang kulang sa mga codes ๐Ÿ™
 

Attachments

  • B0885E91-6F60-4D65-BD6F-92E07DFF5A5C.webp
    B0885E91-6F60-4D65-BD6F-92E07DFF5A5C.webp
    39 KB · Views: 22
  • 7AB16F09-D53D-4C80-B46D-C87EC3C3D796.webp
    7AB16F09-D53D-4C80-B46D-C87EC3C3D796.webp
    41.3 KB · Views: 14
  • 99B33FC1-1AC2-43F8-AB8A-1165A2903C04.webp
    99B33FC1-1AC2-43F8-AB8A-1165A2903C04.webp
    47.6 KB · Views: 14
eto paps, pagaralan mo sana to,

Lab 08

Java:
class Employee {
    double salaray = 25000;
}

class Programmer extends Employee {
    int bonus = 10000;
   
    public static void main(String[] args) {
        Programmer p = new Programmer();
        System.out.println("Teacher Salaray is: "+p.salaray);
        System.out.println("Teacher Bonus is: "+p.bonus);
    }
}

Lab 09
Java:
import java.util.*;
    //class name is your choice
public class test2 {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int minuend, subtrahend, difference;
        System.out.println("Enter Minuend: ");
        minuend = s.nextInt();
        System.out.println("Enter Subtrahend: ");
        subtrahend = s.nextInt();
        try {
            difference = minuend - subtrahend;
            System.out.println(minuend + " - " + subtrahend + " = " + difference);
        } catch (ArithmeticException ex) {
            // Im not sure kung anong dapat ilagay dito, as your professor didnt say any
            System.out.println(ex.getMessage());
            System.out.println("Try again.");
        }
        finally {
            System.out.println("Thank you.");
            s.close();
        }
    }
}

Lab 10
Java:
import java.util.Scanner;
//class name your choice
public class test2 {
    public static void main(String[] args) {
        //Not sure kung anong nakalagay sa line na to, ikaw na bahala
        Scanner scan = new Scanner(System.in);
        String name;
        System.out.println("Enter your name: ");
        name = scan.nextLine();
        System.out.println("Welcome, "+name);
        System.out.println("You will pass the prelim");
        scan.close();
    }
}
 
ito pa paps pa tulong naman po. gumana lahat na code na bininigay mo sobrang thank you tlaga..
 

Attachments

  • lab07.webp
    lab07.webp
    17 KB · Views: 18
ito pa paps pa tulong naman po. gumana lahat na code na bininigay mo sobrang thank you tlaga..
Java:
public double weight, height, BodyMassIndex;
            //Your choice kung anung name ng void method
    public void setValue(double weight, double height) {
        this.weight = weight;
        this.height = height;
    }
    public void calculate() {
        BodyMassIndex = weight / (height * height);
    }
    public Boolean isOverWeight() {
        return (BodyMassIndex > 25);
    }
 
Status
Not open for further replies.

About this Thread

  • 20
    Replies
  • 988
    Views
  • 3
    Participants
Last reply from:
Exconvict99

Online now

Members online
1,036
Guests online
727
Total visitors
1,763

Forum statistics

Threads
2,276,975
Posts
28,973,480
Members
1,229,674
Latest member
Mjivo
Back
Top