subject

Write a program in JAVA to perform the following operator based task: Ask the user to choose the following option first: If User Enter 1 - Addition If User Enter 2 - Subtraction If User Enter 3 - Division If User Enter 4 - Multiplication If User Enter 5 - Average Ask the user to enter the 2 numbers in a variable for first and second(first and second are variable names) for the first 4 options mentioned above and print the result. Ask the user to enter two more numbers as first and second 2 for calculating the average as soon as the user chooses an option 5. In the end, if the answer of any operation is Negative print a statement saying "Oops option X(1/2/3/4/5/) is returning the negative number" NOTE: At a time users can perform one action at a time.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:30
What does a cascading style sheet resolve a conflict over rules for an element? a. the rule affecting the most content wins b. the rule affecting the most content loses c. the rule with the most specific selector loses d. the rule with the most specific selector wins
Answers: 2
question
Computers and Technology, 23.06.2019 00:30
Which one of the following is the most accurate definition of technology? a electronic tools that improve functionality b electronic tools that provide entertainment or practical value c any type of tool that serves a practical function d any type of tool that enhances communication
Answers: 1
question
Computers and Technology, 23.06.2019 10:00
How do i delete my account on this because i didn't read this agreements and also i put age at xd
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
File account.java (see previous exercise) contains a definition for a simple bank account class with methods to withdraw, deposit, get the balance and account number, and return a string representation. note that the constructor for this class creates a random account number. save this class to your directory and study it to see how it works. then write the following additional code: 1. suppose the bank wants to keep track of how many accounts exist. a. declare a private static integer variable numaccounts to hold this value. like all instance and static variables, it will be initialized (to 0, since it’s an int) automatically. b. add code to the constructor to increment this variable every time an account is created. c. add a static method getnumaccounts that returns the total number of accounts. think about why this method should be static - its information is not related to any particular account. d. file testaccounts1.java contains a simple program that creates the specified number of bank accounts then uses the getnumaccounts method to find how many accounts were created. save it to your directory, then use it to test your modified account class.
Answers: 3
You know the right answer?
Write a program in JAVA to perform the following operator based task: Ask the user to choose the fol...
Questions
question
Arts, 14.05.2021 17:30
Questions on the website: 13722367