Answered step by step
Verified Expert Solution
Question
1 Approved Answer
JAVA LANGUAGE Instructions Review the Notes - Arrays, Notes - Loops, etc., and the Code Conventions, Template, and previous comments and discussion posts. Start with
JAVA LANGUAGE
Instructions
- Review the Notes - Arrays, Notes - Loops, etc., and the Code Conventions, Template, and previous comments and discussion posts.
- Start with your program from the A4a - Calculator - Two Numbers submission. Make sure you have a backup copy before you get started.
- Fix it based on the previous assignment comments, including A3 - Simple Calculator. If you have yet to receive feedback for A4a - Calculator - Two Numbers, please e-mail me immediately and politely ask me to review your A4a submission. Please keep in mind, the sooner you get started, the sooner I will be able to provide you with feedback, so you will be able to complete this assignment by the due date.
- Change your previous Calculator program as follows:
- The following items must be completed or you will automatically get a zero for this assignment!
- Fix any issues as per the comments for A3 and A4a
- Use only the concepts covered through Module 5; see the Module Overviews, videos, and notes; do NOT user-defined methods other than main(), etc.
- Create at least one fixed array declared at the top of main() with a size of three to hold the numbers inputted by the user
- Nest for loops into your code to process the array appropriately, for example:
- If the user selects from the menu to add the numbers, the numbers in the array get added together, e.g., 1.5 + 2 + -3 = 0.5
- Note: When it comes to things like subtraction or division, it will work like this: 1.5 - 2 - -3 = 2.5 or 1.5 / 2 / -3 = -0.25
- Then, the numbers and the result will get displayed to the user based on the following format:
Answer: 1.500 + 2.000 + -3.000 = 0.500
- The above is not quite as simple as you might think, so make sure you really think about how the computer/program processes an array to achieve the correct results
- Keep in mind, if there is an error, your program should stop processing the array, and then, just display the appropriate error message, for example:
- If the user enters: 1 0 3, and selects division from the menu, the array should only be processed up to 0
- At that point, the error message would be displayed
- Then, the program would continue by displaying the menu again
- Hint: Use a logical operator in the condition of the for loop, but be careful you use the correct logical operator and put the conditions in the correct order
- Since you can use loops and arrays now, you shouldn't need any stacked if or if-else constructs
- All other aspects should work as previously indicated in A4a - Calculator - Two Numbers, except using loops and arrays as appropriate; if you think you figured out a more efficient way to process a menu item, discuss it with me
- Make sure your comments and code completely follow the Code Conventions, are well-organized and easily readable, follow good programming practices, etc.
- Make sure your output is professionally written.
- When thoroughly testing your program change the size of the array at the top of main() to a larger number of elements.
- Copy and paste your comments and code into a Microsoft Word document. Do NOT change it inside the Word document except as follows: If you comments and code are not completely visible inside of Word, select all of your comments and code, and change the font color to black.
- Save and close the Word document.
- Attach and submit the Word document via this assignment.
- Verify what you submitted is the correct document.
- E-mail me if you would like feedback, so you can fix any issues before the due date. Keep in mind, you will need to give me a few days before the due date to complete this process.
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