Khac-Hai / OOP-Nhom-17

0 stars 0 forks source link

main câu1 #5

Open Khac-Hai opened 1 month ago

Khac-Hai commented 1 month ago

public class Main { public static void main(String[] args) { // Tạo đối tượng tín hiệu rời rạc DiscreteSignal discreteSignal = new DiscreteSignal(10.0, 0.02, 50.0, 5.0); discreteSignal.displayDiscreteSignalInfo(); System.out.println("Value at index 1: " + discreteSignal.getValueAt(1));

    // Tạo đối tượng tín hiệu liên tục
    ContinuousSignal continuousSignal = new ContinuousSignal(15.0, 0.02, 75.0, 10.0);
    continuousSignal.displayContinuousSignalInfo();
    System.out.println("Value at t = 1.0: " + continuousSignal.getValueAt(1.0));
}

}

Khac-Hai commented 1 month ago

chạy dc rồi nha đáp án đây Discrete Signal - Amplitude: 10.0, Period: 0.02, Frequency: 50.0, Wavelength: 5.0 Value at index 1: -2.4492935982947065E-15 Continuous Signal - Amplitude: 15.0, Period: 0.02, Frequency: 75.0, Wavelength: 10.0 Value at t = 1.0: -3.8212694017216946E-13

nvmthu commented 1 month ago

ok