Create the drunken calculator

Assignment Help JAVA Programming
Reference no: EM131689617

Programming Assignment: "Drunken" Calculator

Your assignment is to create the drunken calculator. This calculator has been on the sauce for a bit too long and has some trouble remembering things at times, but can still do his operations correctly. For this assignment, we will only be covering the basic mathematical operations of addition, subtraction, multiplication, division. See the full write up and sample output for more details below.

Must Haves:

1. Comments: Both at the top of the program that include your name, class, section, date, and a short description of the program and what it does and in-line comments at any point you feel is necessary.

2. Good Writing Style: Remember the programming style notes and tips we took during class? Put them into practice here with proper indentations, spacing, line breaks, etc.

3. Make sure to name your class DrunkenCalculator.

4. The calculator does "forget" one user input, but you must still take in two. Which you forget is up to you.

5. You must make use of the Math.random() function to generate the second "forgotten" input. We looked at how to use the API, all functions are now fair game. I said the calculator is forgetful, so he just comes up with a random number between 0 and 90 for the replacement.

6. Use of the if, else if, else statements to take care of all the cases of input. Assign each operation a number (For example "for addition enter a 1") and that should make it easier for the boolean tests we have gone over.

7. Include a case for doing nothing and just exiting, this shouldn't be within your "catch all".

8. Your program doesn't have to repeat operation, it can just terminate after one operation for this assignment.

Submission:

Submit ONLY your .java file on Moodle to the assignment when you are completely finished.

Make sure your program compiles and runs to completion on all operations before submitting it. If you have any questions before submission, please ask in class or in email to me.

Sample Output:

Program Start(Note the colored numbers are input from the user):
Woold you like to calcumulate somethin? *hic*
Enter a 1 for additon, 2 for subtraction, 3 for multiplication, 4 for division, or 0 to leave: 1
Whaaat too numbersssss would you like to add? Lemme have the first number now. 52
WHOA slow down, a 52 what's the other one? 10
Alrighty! Then your answer is... umm... 60! Cause your first number was 52 and your second number was 8.
What do you mean tha second numbers not right? I'm the calculator here an you told it to meh! Get out!

Reference no: EM131689617

Questions Cloud

Describe sql injection and explain how it occurs : Describe SQL injection and explain how it occurs. Describe countermeasures that can be taken to secure Java, .Net, and PHP programs/scripts from SQL injection.
Develop requirements for the warehouse design : Develop requirements for the warehouse design and to provide an organization structure to manage the warehouse in Australia.
Overview of the cryptography domain : Describe the operation of a one-time pad (OTP) and give an example of a device that uses an OTP from research.
Define the project goals in the context of change management : Explain how change management, in the context of Lewin's or Kotter's model (select only one), can help the organization.
Create the drunken calculator : Your assignment is to create the drunken calculator. This calculator has been on the sauce for a bit too long and has some trouble remembering things at times.
What is your decision rule for rejecting a null hypothesis : If you use a 0.10 level of significance in a (two-tail) hypothesis test, what is your decision rule for rejecting a null hypothesis that the population mean.
Discuss about the information system : Find recent article discuss about the Information System in our real world. Read it and answer using your own understanding.
What do you think are essential skills of project manager : What do you think are the essential skills of a project manager - plain why and how each skill is useful in fulfilling a project manager's responsibilities.
Protect information assets in a business sector : Discuss how cryptography is used to protect information assets in a business sector that you work or would like to work.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd