#JAVA

1 messages ยท Page 1 of 1 (latest)

jolly oakBOT
#

<@&987246717831381062> please have a look, thanks.

jolly oakBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

#

Here is an AI assisted attempt to answer your question ๐Ÿค–. Maybe it helps! In any case, a human is on the way ๐Ÿ‘. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.

#

Berikut adalah contoh program Java untuk menghitung pajak motor:

#
import java.util.Scanner;

public class PajakMotor {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        System.out.print("Masukkan harga motor: ");
        double hargaMotor = scanner.nextDouble();

        System.out.print("Masukkan tahun pembelian: ");
        int tahunPembelian = scanner.nextInt();

        double pajakTahunPertama = hitungPajakTahunPertama(hargaMotor);
        double pajakTahunan = hitungPajakTahunan(hargaMotor, tahunPembelian);
        double pajakLimaTahunan = hitungPajakLimaTahunan(hargaMotor, tahunPembelian);

        System.out.println("Pajak motor tahun pertama: " + pajakTahunPertama);
        System.out.println("Pajak motor tahunan: " + pajakTahunan);
        System.out.println("Pajak motor lima tahunan: " + pajakLimaTahunan);
    }

    public static double hitungPajakTahunPertama(double hargaMotor) {
        return hargaMotor * 0.1;
    }

    public static double hitungPajakTahunan(double hargaMotor, int tahunPembelian) {
        int masaKepemilikan = 2022 - tahunPembelian;
        
        if (masaKepemilikan > 5) {
            return 0;
        } else if (masaKepemilikan == 5) {
            return hargaMotor * 0.05;
        } else {
            return hargaMotor * (0.05 * masaKepemilikan);
        }
    }

    public static double hitungPajakLimaTahunan(double hargaMotor, int tahunPembelian) {
        int masaKepemilikan = 2022 - tahunPembelian;
        
        if (masaKepemilikan >= 5) {
            return hargaMotor * 0.1;
        } else {
            return 0;
        }
    }
}
#

Program di atas akan meminta pengguna untuk memasukkan harga motor dan tahun pembelian. Kemudian, program akan menghitung pajak motor tahun pertama, pajak motor tahunan, dan pajak motor lima tahunan berdasarkan rumus yang diberikan dalam artikel yang Anda berikan.

Harap dicatat bahwa program di atas hanya merupakan contoh sederhana dan tidak mencakup semua aturan perpajakan yang mungkin berlaku di negara Anda. Pastikan untuk mengacu pada peraturan perpajakan yang berlaku di wilayah Anda saat menghitung pajak motor.

abstract fiber
#

@stable dagger sorry but this server is english only

stable dagger
#

from the BOT

abstract fiber
#

just use the /chatgpt command