Answer:
import java.util.Scanner;
class Main {
public static void main(String args[]) {
Scanner scan = new Scanner(System.in);
System.out.print("Enter a decimal value (0 to 15): ");
int num = scan.nextInt();
scan.close();
if (num < 0 || num >15) {
System.out.printf("%d is an invalid input\n", num);
} else {
System.out.printf("The hex value is %X\n", num);
}
}
}
Explanation:
Hopefully this example will get you going for the other assignments.
Consumers must learn how to separate the truth from deceptive techniques.
Explanation:
Deceptive advertisements are hazardous for both consumer and advertiser. It is a misrepresentation of the nature of products or services promoted falsely by advertisers.
Professionals exploit consumers by following means:
- false or incomplete information,
- fraudulent activities
- deceptive practices.
It may involve -
- financial theft,
- health risks,
- scams, etc.
Having proper knowledge about such practices and taking legal actions against fraudsters can help claim for the damages incurred.
5
8
<u>Explanation:</u>
<u></u>
Since the number is already defined as 5, greater_than_zero holds the value true and less_than_zero holds the value false because 5 is greater than zero and not less than 0. Since there are 4 four if conditions, only two holds true i.e the first one and the last one because the in third condition we are using and logic which needs both condition to be true to make the condition true, whereas in fourth we are using or logic which can make condition true even if one condition is true. Hence the number printed will be number and number +3.