LAB 2NEWTON'S METHOD V1.1
For this lab, you are to again assume that you are a junior programmer. Your has boss returns and asks for a modification of the program that you wrote forLab 1 - Newton's Method v1.0. ( This means that you will build upon what you did in Lab1, modifying your program further, making it version v1.1).
Your boss explains the assignment like this:
ASSIGNMENT
Your boss didn't like the ten separate variables,x0throughx9,. She would like you to only declare and use one variable, calledx.
- You must use a counter-controlled loop to iterate 10 times, updatingxwith its new value each iteration.
- Rather than print the value ofxfor each iteration, the program will only print out the final answer.
- PrintSand the final value ofxin a single printf() statement.
- The value ofxafter all iterations are complete, i.e. your final answer, should be four places past the decimal.
- Remember to update your javadoc to version 1.1
EXAMPLE OUTPUT
The output below shows three separate runs:
Run 1 -The user entered a negative number, and the program quit.
Enter an integer, S: -25
This program con not take the square root of a negative number.
Run 2 - The user entered a number that wasn't within [20, 400], and the program quit.
Enter an integer, S: 987654
This value is out of range.
Run 3 - The user entered a number in range, and the program printed the results.
Enter an integer, S: 25
The square root of 25 is 5.0000
HEADER COMMENT
Your java file, should have the following javadoc header. Remember that your name isn't "Your Name", so you should change that.
/**
* Newton.java - Calculates the square root of a number with Newton's Method.
* CMSY166 Fall 2021
* @author Your Name
* @version 1.1
*/
EXTRA CREDIT
None
SUBMISSION
You need to submit your Java file, and screenshots of its output in each of the three cases above.
- Click the "Submit Assignment" button in the upper right-hand corner of this screen
- Under the File Uploads tab click the "Choose File" button
- Locate the saved Java file and click "Open"
- Under the File Uploads tab click the "Choose File" button
- Locate the saved screenshots of your output, and click "Open"
- Lastly, click the "Submit Assignment" button
- Submissions will be checked for plagiarism.
Rubric
Rubric - Newton V1.1Rubric - Newton V1.1
Criteria |
Ratings |
Pts |
---|
This criterion is linked to a Learning OutcomeHeader CommentingYou added and correctly modified the javadoc header |
6ptsFull Marks |
0ptsNo Marks |
|
6pts
|
This criterion is linked to a Learning OutcomeIndentation and WhitespaceYou have proper (consistent) indentation and have spaced the program for reasonable readability. ( i.e. not smashed together.) |
6ptsFull Marks |
0ptsNo Marks |
|
6pts
|
This criterion is linked to a Learning OutcomeIt WorksYour program compiles, runs, and prints the numbers correctly. You can prove this with the screenshot and java file submission. |
30ptsFull MarksThe task is complete and clearly correct. |
20ptsSatisfactoryYou've done the task, with partial success, but there are minor errors. |
10ptsMarginalYou have attempted the task, but it is clearly incorrect. |
0ptsNo MarksYou either did not attempt the task, or you did it in such a way that demonstrates no understanding of the task. |
|
30pts
|
This criterion is linked to a Learning OutcomeInteger VariableYou correctly declared S to be an integer value between 20 and 400 |
6ptsFull Marks |
0ptsNo Marks |
|
6pts
|
This criterion is linked to a Learning OutcomeDouble VariableYou declared a single variable for x |
6ptsFull Marks |
0ptsNo Marks |
|
6pts
|
This criterion is linked to a Learning OutcomeJava ConventionsClasses are named with UpperCamelCase Methods are lowerCamelCase Constants are ALL_CAPS |
6ptsFull Marks |
0ptsNo Marks |
|
6pts
|
Total Points:60 |