Create a class called MyAwesomeMath and add Addition, Subtraction, Multiplication and Division as methods. Also, when...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Create a class called MyAwesomeMath and add Addition, Subtraction, Multiplication and Division as methods. Also, when asking user for entering the first and the second number; store those numbers in two class variables called firstNumber and secondNumber. Make sure you create an _init___ method in your class and initialize the firstNumber and secondNumber to 0. The following is the output of your program Enter first number: 3 Enter first number: 2 1. ADDITION 2. SUBTRACTION 3. 4. DIVISION Enter your choice: 1 MULTIPLICATION 5 1. ADDITION 2. SUBTRACTION 3. MULTIPLICATION 4. DIVISION Enter your choice: 2 1. ADDITION 2. SUBTRACTION 3. MULTIPLICATION 4. DIVISION Enter your choice:3 6 1. ADDITION 2. SUBTRACTION 3. MULTIPLICATION 4. DIVISION Enter your choice:4 1.5 1. ADDITION 2. SUBTRACTION 3. MULTIPLICATION 4. DIVISION Create a class called MyAwesomeMath and add Addition, Subtraction, Multiplication and Division as methods. Also, when asking user for entering the first and the second number; store those numbers in two class variables called firstNumber and secondNumber. Make sure you create an _init___ method in your class and initialize the firstNumber and secondNumber to 0. The following is the output of your program Enter first number: 3 Enter first number: 2 1. ADDITION 2. SUBTRACTION 3. 4. DIVISION Enter your choice: 1 MULTIPLICATION 5 1. ADDITION 2. SUBTRACTION 3. MULTIPLICATION 4. DIVISION Enter your choice: 2 1. ADDITION 2. SUBTRACTION 3. MULTIPLICATION 4. DIVISION Enter your choice:3 6 1. ADDITION 2. SUBTRACTION 3. MULTIPLICATION 4. DIVISION Enter your choice:4 1.5 1. ADDITION 2. SUBTRACTION 3. MULTIPLICATION 4. DIVISION
Expert Answer:
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these programming questions
-
An extraction system has a distribution ratio of 10. If 300 mg of the substance is dissolved in 100mL of solvent A, calculate the amount of the extracted substance if carried out with 100 mL of...
-
Consider each matrix as the augmented matrix of a linear system. State in words the next two elementary row operations that should be performed in the process of solving the system. 1-6 4 2 -7 0 0...
-
Read the Case Study: Whats a Manager to Do? and answer the following questions: Identify the ethical problem(s) that face the GB members and the managers. Do similar problems face those not directly...
-
An employee received the following benefits: regular compensation income, net of P25,000 SSS, PHIC & HDMF employee share - P850,000; 13th month pay - P120,000; De minimis benefits within their limits...
-
A manufacturer estimates that its product can be produced at a total cost of C (x) =45,000+100x+x3 dollars. If the manufacturer's total revenue from the sale of x units is R(x)=4600x dollars,...
-
The accounting records of NuTronics, Inc., include the following information for the year ended December 31, 2011. Overhead is assigned to production at $192,000. a. Prepare a schedule of the cost of...
-
An unheated garage is placed on the north wall of a building to act as a thermal buffer zone. If the garage has roof area \(A_{p}\), window area \(A_{w i}\) door area \(A_{d}\), and wall area \(A_{w...
-
Brenda Kelley runs a specialty ski clothing shop outside of Boone, North Carolina. She must place her order for ski parkas well in advance of ski season because the manufacturer produces them in the...
-
A 1000 gallon holding tank that catches runoff from some chemical process initially has 800 gallons of water with 2 ounces of pollution dissolved in it. Polluted water flows into the tank at a rate...
-
Consider the situation where you just received $10,000 pre-tax income this year and you are considering whether you should contribute part of the money to IRA or an annuity account, or just put the...
-
Many companies market their products and/or services to children or teens. Identify one product and/or service that does this. Do you feel it is appropriate to market this product or service to this...
-
Discuss the drug associated with the highest percentage of juvenile arrests. Sketch a profile of juveniles who sell drugs.
-
a. Find the eigenvalues and eigenvectors of the matrix. b. Confirm the results of (a) in MATLAB. \(\mathbf{A}=\left[\begin{array}{cc}5 & -2 \\ 2 & 0\end{array} ight]\)
-
An engineer planning a weld from manufacturer specifications realizes that the units for temperature have been accidentally omitted. The specifications say, "The temperature of the weld should be no...
-
A municipal bond and a corporate bond of equal risk, liquidity, and maturity yield 6% and 10%, respectively. For which values of marginal tax rates would you prefer to buy the municipal bond?
-
Consider the valuation of Nike given in Example 10.1. Example 10.1. Recall our example of Nike, Inc., from Chapter 7. Nike had sales of \($36.397\) billion in 2018. Suppose you expected its sales to...
-
Why companies hold cash? Explain the properties of Baumol model (i.e. inventory model) and Miller-Orr model (i.e. stochastic model) for management of cash? Please determine the optimal/aceptable...
-
How has the globalization of firms affected the diversity of their employees? Why has increased diversity put an additional burden on accounting systems?
-
Write a program to play the rock-paper-scissor game. Each of two users types in either P, R, or S. The program then announces the winner as well as the basis for determining the winner: paper covers...
-
Repeat the previous programming project, but read the input data from a file and send the output to another file. If you have covered binary files, use binary files; otherwise, use text files. Read...
-
Write a program that demonstrates the approximate nature of floating point values by performing the following tasks: Use Scanner to read a floating-point value x. Compute 1.0 / x and store the result...
-
If rp is positive in Equation 14.9, then foreign assets are perceived as being more risky than domestic counterparts. In that case, according to Equation 14.9, what will happen to the exchange rate...
-
Consider the monetary approach to exchange rates (MAER) model given in Equation 15.19. Suppose that each of the domestic hat variables in that equation is growing at exactly the same rate as its...
-
Philip and Lance have decided to form a partnership by investing \($100000\) and \($80000\) respectively. The following plans for dividing profits and losses are under consideration. Sharing profits...
Study smarter with the SolutionInn App