Logical Operators Example Statement • && and • || Or • ! Not Problem : if else if • Input grade , determine if grade is 100-99 to avail 100% discount, 96-98 to avail 50% discount 94-95 25% discount otherwise no discount. Compute and display discount and amount due. 1. Input name, grade , tuition 2. Determine the discount : if grade is 100-99 to avail 100% discount, 96-98 to avail 50% discount 94-95 25% discount otherwise no discount. 3. Compute and display discount and amount due. package ifelseif_scholarship; import java.io.*; import javax.swing.*; public class IfElseIf_Scholarship { public static void main(String[] args) { //declare global variables double grade, discount,tuitionFee ,amountDue; String name,scholarship_grant; name=JOptionPane.showInputDialog(null, "Enter your name"); grade =Double.parseDouble(JOptionPane.showInputDialog(nu...
Comments
Post a Comment