12:32 HW1_4ffedfa90de418295ba0bc63... 1 of 4 College of Engineering and Applied Sciences Instructor: Arshad CSIS 130-Computer Programming...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
12:32 HW1_4ffedfa90de418295ba0bc63... 1 of 4 College of Engineering and Applied Sciences Instructor: Arshad CSIS 130-Computer Programming II Fall 2023 HW 1 Due: Sunday 8 October 2023,9 AM HW INSTRUCTIONS 1. SIMPLE CALCULATOR The SimpleCalculator class as its name implies, implements the functionality of a simple calculator (one that can add, subtract, and multiply istegens). ASiapleCalcater has to keep track of an "accumulator an integer variable that holds the value currently stored in the calculator. The initial value of the accumulator is 0. Here is a summary of the methods of SimpleCalculator add: This method takes an integer nount and increments the accumulate by getal: t takes a parameters and returns an integer which is the currently stored in the accumulator serval: It takes an integer valur , and sets the value of the accur subtract: This method takes on integer amount and decreets t accumulator by multiply: This method takes an integer amounts and multiples th accumulator byx 5G OCS510 AUK AMERICAN ESIVERITY KUWAIT 43593751 BROUND of the e of the 2. WORKING WITH NETHEANS Start then go to the "Filme and select "New In the age box that appears, select the "Ja with Ant" from the Category" list (left) then Tava Class Library from the "Penght) and dick "Next" in the next dage, type "CS130-HW as the "Project Name and choose an appropriate location to save your and click "Fid. An empty project will be created for you and it should look like the image to the right Create new by going to FileNow the selecting "T"and "Java Class" and make sure that your "CRS130-HWI" pret is selected. Click "Nest". Now type Splecalculator for the "Class Name, and type acaste for the Package Chck Tald Netbeans should up the SimpleCalculator ja fle for you to edit. It should look comething like als of the Done Apache View at Sout Services Sour Packag 12:32 HW1_4ffedfa90de418295ba0bc63... 2 of 4 Delete the comment on the top of the file and change the author to say your name. Now, we're ready to write some code, but first, let's create a test site for testing code In Netbeans 8xgo to "FileNew File" and select "Ust Tets" and "Testfor in the next dialogue, type the class name "ack.cxist.simplecalculator from the "Browse" button) and leave the other options untouched k "F" and select "Unit 4x in the next dialog In Apache Netbeans 12x when your le plecalculatorja from the left Tash Create/Update Tests. In the next dalegar choose Usit from the Framework dropdown the dick "OK". are Netbeans will create a file called simpleCalculatorfest. jaus that code for testing your code At the bottom of the file there is a method that looks like ****** ...I 56 This is called a test case. Its name is testsomethod and all it does is fall. If you g the "RunTest Project mens, Netbeans will run your tests and give you are case, it will say that "1 test failed" which is what we expect So, let's start coding and eng Let's add the method getale to our code. To do this, we first wed to declare a variable in our code that serves as the accumulator (whose til val is and defi to return the value stored in the act Add the following code to your Singdecalclater da C136 W pe N Change your test case code (above) to look like the following Pet iginal Done o 12:33 HW1_4ffedfa90de418295ba0bc63... STEW 3 of 4 Change your test case code (above) to look like the following peti all 5G What this code does is create a brand new glecalculator object and check that calling geval on this new object returns (asserttals checks that the value given to are indeed qual). If you go to the "RunTest Project" wm, Netbeanwill your and give you a reprt is this case it will say that "The test passa which is what we Now add the following test case Your code, of course, won't comple now because you have met defound the setvalue method yet. So let's do that. Add the code for setvalue (lited below and run your s Make sure everything works moothly. Now it's your turn. Implement the remaining methods and add tests for each it is recommended that you follow a Test a little. Code a little development style instead of writing all of your code and testing all C130 WI Done Your final code should contain all five methods for simplecalculator as well at least live test cases that cover these methods. Your code should also pass all tests when you dick on RunTest Projec 3. DOCUMENTATION The following parts of your code must be documented Each class mat include a doc comment that explains the purpose of the class in 12:33 HW1_4ffedfa90de418295ba0bc63... Done 4 of 4 C10W ll 5G 3. DOCUMENTATION The following parts of your code must be documented Each class must include a doc comment that explains the purpose of the class in plain English Each method mast include a doc comment that explains the purpose of the method, the parameters it takes, and what it return f something other than void) Each variable declared in the class must include a doc commenting the purpose of this variable lavadoc javadoc is a standard documentation system used by a programm document their code. It is a normal Java comment with the only difference is that t with teaterisk (**) instead of on. Basically, to document sur setal method, w wwwx Please refer to the Wikipedia article http://en.wkipedia.org/wiki/vad for more examples of using Javadoc 4. SUBMISSION INSTRUCTIONS On moodle there's a "WT link. Click it and subest your work as f Go to the folder on your drive where you created the IW project Select the arc and tast directories (2 ulders), right-click and compress (create a sip-folder) with the name "CSS- HWL.pt your ip felder. After the deadline your work is accepted for the next 12 hours only with a 10% penalty of your total grade Submissions past this point will not be accepted. Make sure you start working as soon as possible on the W If you go to the line above your class, method, or variable declaration, type and be enter. Netbeans will automatically make a three-ine comment stub, close the cont and place the cor in the place where you should type the comment. Try C130 WI 12:32 HW1_4ffedfa90de418295ba0bc63... 1 of 4 College of Engineering and Applied Sciences Instructor: Arshad CSIS 130-Computer Programming II Fall 2023 HW 1 Due: Sunday 8 October 2023,9 AM HW INSTRUCTIONS 1. SIMPLE CALCULATOR The SimpleCalculator class as its name implies, implements the functionality of a simple calculator (one that can add, subtract, and multiply istegens). ASiapleCalcater has to keep track of an "accumulator an integer variable that holds the value currently stored in the calculator. The initial value of the accumulator is 0. Here is a summary of the methods of SimpleCalculator add: This method takes an integer nount and increments the accumulate by getal: t takes a parameters and returns an integer which is the currently stored in the accumulator serval: It takes an integer valur , and sets the value of the accur subtract: This method takes on integer amount and decreets t accumulator by multiply: This method takes an integer amounts and multiples th accumulator byx 5G OCS510 AUK AMERICAN ESIVERITY KUWAIT 43593751 BROUND of the e of the 2. WORKING WITH NETHEANS Start then go to the "Filme and select "New In the age box that appears, select the "Ja with Ant" from the Category" list (left) then Tava Class Library from the "Penght) and dick "Next" in the next dage, type "CS130-HW as the "Project Name and choose an appropriate location to save your and click "Fid. An empty project will be created for you and it should look like the image to the right Create new by going to FileNow the selecting "T"and "Java Class" and make sure that your "CRS130-HWI" pret is selected. Click "Nest". Now type Splecalculator for the "Class Name, and type acaste for the Package Chck Tald Netbeans should up the SimpleCalculator ja fle for you to edit. It should look comething like als of the Done Apache View at Sout Services Sour Packag 12:32 HW1_4ffedfa90de418295ba0bc63... 2 of 4 Delete the comment on the top of the file and change the author to say your name. Now, we're ready to write some code, but first, let's create a test site for testing code In Netbeans 8xgo to "FileNew File" and select "Ust Tets" and "Testfor in the next dialogue, type the class name "ack.cxist.simplecalculator from the "Browse" button) and leave the other options untouched k "F" and select "Unit 4x in the next dialog In Apache Netbeans 12x when your le plecalculatorja from the left Tash Create/Update Tests. In the next dalegar choose Usit from the Framework dropdown the dick "OK". are Netbeans will create a file called simpleCalculatorfest. jaus that code for testing your code At the bottom of the file there is a method that looks like ****** ...I 56 This is called a test case. Its name is testsomethod and all it does is fall. If you g the "RunTest Project mens, Netbeans will run your tests and give you are case, it will say that "1 test failed" which is what we expect So, let's start coding and eng Let's add the method getale to our code. To do this, we first wed to declare a variable in our code that serves as the accumulator (whose til val is and defi to return the value stored in the act Add the following code to your Singdecalclater da C136 W pe N Change your test case code (above) to look like the following Pet iginal Done o 12:33 HW1_4ffedfa90de418295ba0bc63... STEW 3 of 4 Change your test case code (above) to look like the following peti all 5G What this code does is create a brand new glecalculator object and check that calling geval on this new object returns (asserttals checks that the value given to are indeed qual). If you go to the "RunTest Project" wm, Netbeanwill your and give you a reprt is this case it will say that "The test passa which is what we Now add the following test case Your code, of course, won't comple now because you have met defound the setvalue method yet. So let's do that. Add the code for setvalue (lited below and run your s Make sure everything works moothly. Now it's your turn. Implement the remaining methods and add tests for each it is recommended that you follow a Test a little. Code a little development style instead of writing all of your code and testing all C130 WI Done Your final code should contain all five methods for simplecalculator as well at least live test cases that cover these methods. Your code should also pass all tests when you dick on RunTest Projec 3. DOCUMENTATION The following parts of your code must be documented Each class mat include a doc comment that explains the purpose of the class in 12:33 HW1_4ffedfa90de418295ba0bc63... Done 4 of 4 C10W ll 5G 3. DOCUMENTATION The following parts of your code must be documented Each class must include a doc comment that explains the purpose of the class in plain English Each method mast include a doc comment that explains the purpose of the method, the parameters it takes, and what it return f something other than void) Each variable declared in the class must include a doc commenting the purpose of this variable lavadoc javadoc is a standard documentation system used by a programm document their code. It is a normal Java comment with the only difference is that t with teaterisk (**) instead of on. Basically, to document sur setal method, w wwwx Please refer to the Wikipedia article http://en.wkipedia.org/wiki/vad for more examples of using Javadoc 4. SUBMISSION INSTRUCTIONS On moodle there's a "WT link. Click it and subest your work as f Go to the folder on your drive where you created the IW project Select the arc and tast directories (2 ulders), right-click and compress (create a sip-folder) with the name "CSS- HWL.pt your ip felder. After the deadline your work is accepted for the next 12 hours only with a 10% penalty of your total grade Submissions past this point will not be accepted. Make sure you start working as soon as possible on the W If you go to the line above your class, method, or variable declaration, type and be enter. Netbeans will automatically make a three-ine comment stub, close the cont and place the cor in the place where you should type the comment. Try C130 WI
Expert Answer:
Answer rating: 100% (QA)
Lets break down the instructions and provide accurate explanations Simple Calculator Implementation ... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
One of those macro factors is the competition. For each of the 3 types of competitive advantages, identify a company you believe utilizes that advantage and explain why you believe that to be true....
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
The reaction illustrated by the equation below is a very general one that can be catalyzed by acid, base, and some enzymes. It therefore needs to be taken into consideration when planning syntheses...
-
Mario and Kaitlin are married and file a joint tax return. They have adjusted gross income of $385,000 that includes $4,700 of investment income ($3,000 short-term capital gains and $1,700 of...
-
A board of weight W1 is placed across the channel and a boy of weight W2 attempts to walk across. If the coefficient of static friction at A and B s, determine if he can make the crossing; and if...
-
Jeremiah Jams sold $2,500 worth of Jam to a customer and received the payment in cash. What would be the correct journal entry for this transaction?
-
Gender in the Rock and Roll Hall of Fame From its founding through 2015, the Rock and Roll Hall of Fame has inducted 303 groups or individuals. Forty-seven of the inductees have been female or have...
-
Why is the statement of cash flows a useful document?
-
At the end of December 31, 2012, Centennial Company's accounts are as follows. Purchases $175,000 Salaries 80,000 Advertising 3,000 Travel 2,000 Revenue 350,000 Finance costs 10,000 Freight-in 2,000...
-
Construct a rough retirement budget. Adjust the average social security check of $1,422 at 2% inflation until your retirement date. Do the same with your expenses. Determine the difference between...
-
Consider the following income statement and balance sheet information. Income Statement (in millions) Net sales Cost of products sold Amortization of intangible assets Research & development Selling,...
-
In the game of blackjack, also known as twenty-one, the player and the dealer are dealt one card face-down and one card face-up. The object is to get as close as possible to the score 21, without...
-
Percentage of a cars surface which is rusted Determine whether the quantitative variable is discrete or continuous.
-
Number of pieces of lumber used to make a deck Determine whether the quantitative variable is discrete or continuous.
-
Air pressure in pounds per square inch in an automobile tire Determine whether the quantitative variable is discrete or continuous.
-
Distance between sides of a street Determine whether the quantitative variable is discrete or continuous.
-
The Charpy Impact test is used in materials testing to determine the energy absorption characteristics of a material during impact. This test is performed by releasing a 60 lb pendulum and allowing...
-
The following cost information was provided to you for analysis: September 12,000 Units Produced Costs: TIC TAC TOE TING August 10,000 P80,000 70.000 60.000 50,000 How much is the fixed cost per...
-
Kent Pham, CPA, is a 45-year-old single taxpayer living at 169 Trendie Street, La Jolla, CA 92037. His Social Security number is 865-68-9635. In 2012, Kent's W-2 as the controller of a local...
-
During 2012, Tom sold Sears stock for $10,000. The stock was purchased 4 years ago for $13,000. Tom also sold Ford Motor Company bonds for $35,000. The bonds were purchased 2 months ago for $30,000....
-
Harold Conners (Social Security number 785-23-9873) lives at 13234 DeMilo Drive, Houston, TX 77052, and is self-employed for 2012. He estimates his required annual estimated tax payment for 2012 to...
-
What effect does having public health insurance have on the number of doctor visits a person has during a year? Using 1988 data,rwm88_small, from Germany we will explore this question. The data file...
-
Specify a variance function and use it to test for heteroskedasticity with (a) a Breusch-Pagan test and (b) a White test.
-
How much of an incumbency advantage do winners in U.S. House elections enjoy? This is the topic of a paper by David S. Lee (2008) "Randomized experiments from nonrandom selection in U.S. House...
Study smarter with the SolutionInn App