Page 180 - ComputerScience_Class_11
P. 180
System.out.println("True");
else
System.out.println("False");
}
}
3. import java.util.Scanner;
class ProductPrice
{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
double DISCOUNT_RATE = 0.10;
System.out.print("Enter product price: );
double price = sc.nextDouble();
totalPrice = price - (price * DISCOUNT_RATE);
System.out.println("Total Price after discount: " + totalPrice);
}
}
Ans. import java.util.Scanner;
class ProductPrice
{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
double DISCOUNT_RATE = 0.10;
System.out.print("Enter product price:");
double price = sc.nextDouble();
double totalPrice = price - (price * DISCOUNT_RATE);
System.out.println("Total Price after discount: " + totalPrice);
}
}
Unsolved Questions
A. Tick ( ) the correct option.
1. What type of operator is used in the expression a+b?
a. Unary b. Binary
c. Ternary d. Bitwise
2. What will be printed after the execution of the following?
int a=5;
System.out.println(++a);
a. 5 b. 4
c. 6 d. 0
178 Touchpad Computer Science (Ver. 3.0)-XI

