write a program to display the gift items delivered by a shop to its customers for purchasing products from the shop according to the following
Purchase amount. Gift item
<=1000 Coffee Mug
<=3000 wall clock
<=5000 wrist watch
>5000 Micro - oven
purchase amount to be entered by the user and the program will display the gift item to be delivered based on the input purchase amount
print out the program along with the output
Answers
Answer:
Java:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Enter purchase amount: ");
int purchaseAmount = scanner.nextInt();
if(purchaseAmount <= 1000) {
System.out.println("The gift item is Coffee Mug");
} else if(purchaseAmount <= 3000) {
System.out.println("The gift item is Wall Clock");
} else if(purchaseAmount <= 5000) {
System.out.println("The gift item is Wrist Watch");
} else if(purchaseAmount > 5000) {
System.out.println("The gift item is Micro-Oven");
}
}
}
Python:
purchase_amount = int(input("Enter purchase amount: "))
if purchase_amount <= 1000:
print("The gift item is Coffee Mug")
elif purchase_amount <= 3000:
print("The gift item is Wall Clock")
elif purchase_amount <= 5000:
print("The gift item is Wrist Watch")
elif purchase_amount > 5000:
print("The gift item is Micro-Oven")