Answered step by step
Verified Expert Solution
Question
1 Approved Answer
WRITE IN JAVA Question 1 : Write a Java program that takes an input in feet and converts it to inches. If the input is
WRITE IN JAVA
Question : Write a Java program that takes an input in feet and converts it to inches. If the input is less than print "Invalid input," otherwise, print the equivalent length in inches.
Example:
If feet : Print Invalid
If feet : Print inches
Question : Take numbers as input from the user and print the biggest and the smallest numbers.
Example:
Input:
num
num
num
Output:
Biggest number
Smallest number
Question : Write a Java program that takes an integer number from the user and prints "Positive" if the number is greater than "Negative" if the number is less than and "Zero" if the number is
Example:
Input: num Output: Positive
Input: num Output: Negative
Input: num Output: Zero
Question : Create a Java program that assigns a grade based on the score of a student. If the score is above print A If the score is between and inclusive print B If the score is between and inclusive print C If the score is between and inclusive print D Otherwise, print F
Example:
Input: score Output: A
Input: score Output: B
Input: score Output: C
Input: score Output: D
Input: score Output: F
Question : Develop a Java program that acts as a simple calculator. The program takes three inputs: two double values a and b and a char operator. Depending on the value of operator the program should print the result of the operation between a and b If the operator is not one of the specified characters, print "Invalid operator".
Example:
Input: a b operator Output:
Input: a b operator Output:
Input: a b operator Output: Invalid operator
Question : Create a Java program for a retail store that applies discounts based on the purchase amount. If the purchase amount is greater than $ apply a discount. For amounts between $ and $inclusive apply a discount. Otherwise, no discount is applied. Print the final amount after applying the discount.
Example:
Input: purchaseAmount Output: Final Amount: $
Input: purchaseAmount Output: Final Amount: $
Input: purchaseAmount Output: Final Amount: $
Question
: Develop a Java program that acts as a simple calculator. The program takes three inputs: two double values a and b and a char operator. Depending on the value of operator the program should print the result of the operation between a and b If the operator is not one of the specified characters, print "Invalid operator".
Example:
Input: a b operator Output:
Input: a b operator Output:
Input: a b operator Output: Invalid operator
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started