Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assignment 2 Before attempting this project, be sure you have completed all of the reading assignments, non-graded exercises, discussions, and assignments to date. Write a
Assignment 2 Before attempting this project, be sure you have completed all of the reading assignments, non-graded exercises, discussions, and assignments to date. Write a Java program that: (1) Prompts a user to enter two numbers between 200 and 1000 and a symbol for operation such as ' + ', ' ', '"', and ' f (use Scanner for input). (2) Code uses nested if statement or switch to perform the operation on the two numbers (3) If the provided symbol is valid, displays the input data along with the result of the calculationto the console. Otherwise displays an error message For example, for input: 700950+ the calculation is addition and the result will be 1650 Note 1: To read a single character by Scanner, you can read in as a string and then use the first character. For example: Scan.next(). charAt(0) Note 2: Be careful you do not have integer division Note 3: If the user inputs an invalid symbol, print an error message only Test program: A minimum of 5 test cases (one for each valid operation and one for invalid operation) should besupplied in the form of a table with columns indicating the input values, expected output, actual output, and if the test case passed or failed. This table should contain 4 columns with appropriate labels and a row for each test case. An example template is shown below. Note that the actual output should be the actual results you receive when running your program and applying the input for the test record. Make sure your Java program is using the recommended style such as: - Javadoc comment upfront with your name as author, date, and brief purpose of theprogram - Comments for variables and blocks of code to describe major functionality - Meaningful variable names and prompts - Identifiers are written in upper CamelCase - Class name starts with upper case letter and variables in lower case letter - Constants are written in All Capitals - Use proper spacing and empty lines to make code human-readable Capture execution: You should capture and label screen captures associated with compiling your code and runningeach of your 5 test cases. Here are a couple of sample runs: Enter two integer numbers between 200 and 1000 separated by a space: 200650 Enter operation symbol (+,,, or /) : + Evaluation: 200+650 =850.0 Enter two integer numbers separated by space: 550800 Enter operation symbol (+, - , ", or /): ( Not valid operation symbol Example test cases: Submission requirements Deliverables include a Java program (.java) and a single Word (or PDF) document. The Java andWord/PDF files should be named appropriately for the assignment (as indicated in the SubmissionRequirements document. The word (or PDF) document should include screen captures showing the successful compilingand running of each of the test cases. Each screen capture should be properly labeled to indicate what the screen capture represents. The test cases table should be included in your Word or PDF document and properly labeled as well. Submit your files to the Assignment 2 submission area no later than the due date listed in the online classroom calendar
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