Question 1
a) Write a program in Java to assign 5769 in a variable. Find and display the following:
i) Double the number
ii) Half the number
iii) 2/7th of the number
b) State the data types for the following constants:
i) "SPS"
ii) 'Z'
iii) false
Question 2
a) Write a program in Java that will allow the cashier to input the marked price for a product. The shopkeeper offers successive discounts as 50% + 75% on the marked price. Calculate and display the successive discount amounts and the selling price.
b) Give the size in bytes for the following data types in Java:
i) int
ii) double
iii) char
Question 3
a) Write a program in Java to enter the length and the breadth for a rectangular field. Calculate and display its area, perimeter and diagonal.
Area = Length x Breadth
Perimeter = 2(Length + Breadth)
Diagonal = √(Length x Length + Breadth x Breadth)
b) Write the output of the following program code in Java:
class Output{
public static void main(String args[]){
int a = 94, b = 18;
System.out.println("Result - 1 = " + (a + b));
System.out.println("Result - 2 = " + (a % b));
System.out.println("Result - 3 = " + (a / b));
}
}
plz give me those answers
Answers
Answered by
1
It looks like there aren't any great matches for your search
Tip: Try using words that might appear on the page you’re looking for. For example, "cake recipes" instead of "how to make a cake."
Answered by
2
Explanation:
bsusujwuwixjxnsbbsu, nxnxz
Similar questions