CST8116 Lab Exercise 04 (225) Instructions The five parts of the Software Development Process as...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
CST8116 Lab Exercise 04 (225) Instructions • The five parts of the Software Development Process as presented by Cay Horstmann [1] will be used as the basis for this lab exercise. 1) Understand the problem 2) Develop and Describe an Algorithm 3) Test Algorithm with Simple Inputs 4) Translate the Algorithm into Java 5) Compile and Test Your Program Also refer to your textbook by Joyce Farrell [2] for help with pseucode, flowcharts, UML class diagrams. What is the problem to solve for this exercise? A tool manufacturing company needs software to verify the lengths of meter sticks as they come off the production line. The software should ask the user to enter the length of the meter stick in meters, then verify that it is within 0.0001 meters of 1 meter. (0.1 meter is decimeter, 0.01 meter is centimeter, 0.001 meter is millimeter). The program should also ask the user what type of output they wish to view, one of verifying the length of the meter stick, seeing the centimeters of the meter stick, seeing the millimetres of the meter stick, or seeing a text report that represents the meter stick. All numbers must be formatted to five decimal places for output. When verifying meter sticks the company uses a tolerance of 0.0001 meters i.e. no more than one-tenth of a millimeter off expected measure of 1.0. Part 1 Understand the Problem • Review the word problem, as well as look at the starter code provided. Outline how the main logic would flow from inputs, to processing, to output. ⚫ Outline how the verify method would flow from start to return statement including math Use a menu in method main to offer the user a selection of output choices (use constants), and use a selection structure to perform the appropriate processing before displaying the output. You may use any selection structure (select case or if then) in solving this problem. Part 2a Pseudocode Create a detailed UML Class diagram that documents the provided class(s). • Write pseudocode for the verify method of class Meter Stick • Write pseudocode for the toString method of class Meterstick Write pseucode for the main method Reminder: Please review the lecture notes for UML Class diagrams as well as your Joyce Farrell textbook [2]. ⚫ In our course typically, we will have a class with only method main, as this is a static method it should be underlined. ⚫ Local scope variables inside method main are not to be documented in the UML class diagram in the second row. • Expanding on that, we never document variables that are local scope, i.e. declared within constructors or methods. The only variables that appear in a UML Class diagram, in the second row, are class-level variables declared at a class level. E.B. The only local-scope variables that appear in a UML class diagram, at all, are the parameters for constructors, and methods, but these are in-lined within each constructor's or method's line within the third row. Exercise04 +main(args:String[]):void Feel free to reproduce this example as part of your own UML Class diagrams. Part 2b Flowchart • Write a flowchart for the verify method of class Meter Stick • Write a flowchart for the toString method of class Meter Stick ⚫ Write a flowchart for the main method • Place these into your MS Word document as images. Part 3 Test Plans for Algorithms • Create a table in your MS Word document • You can use the example below as a guide • Refer to the lecture notes in week 9 regarding boundary testing, there are more than just two tests required. Testing verify method of class MeterStick Rather than using input, we use values of the length field, to then document expected vs actual method returns. Check boundary conditions just above, below, and at the EPSILON value. (Expecting 5 tests.) length 1.0 Expected return Meter stick is within tolerance of 0.00010 1.0002 Meter stick is not within tolerance of 0.00010 Input 1.0 Actual return Meter stick is within tolerance of 0.00010 Meter stick is not within tolerance of 0.00010 Expected output Meter stick is within tolerance of 0.00010 Actual output Meter stick is within tolerance of 0.00010 Description Hand trace of method logic indicates that the method return value matches expectations. Length is in between tolerance range. Hand trace of method logic indicates that the method return value matches expectations. Length is above upper tolerance range. Part 4 Translate the Algorithm into Java Create an Exercise04 project in Eclipse Using the starter code: Update all of the comment sections as per the requirements of our course, see week 1 lecture notes Follow your algorithm design and code the toString method, verify method, as well as method main. Part 5 Compile and Test Your Program • Compile and run your program. • Be prepared to demonstrate your program in the lab period, in the week before the formal lab submission is due. Re-use your algorithm test plans and test your program code ° Also ensure that printf is correctly formatting to five decimal places for all output. Test and document invalid and valid input like: Lengths within and outside tolerance 。 Valid and invalid menu selection o Text instead of numbers for input Important: Only check for invalid inputs like text in place of numbers when testing and documenting the main method. The verify method would never be reached in the case of invalid user input so there would be no program crashes to document in the verify method testing table. Lab Demonstration Notes • Your lab professor will ask you to demonstrate your program in lab, typically the week before the formal submission • Your lab professor may also ask you a brief question on your code. Microsoft Word Document Format See the template example (from lab exercise 1) and use the suggested headings below: Understand the Problem ⚫ Pseudocode(s) and Detailed UML Class Diagram • Flowchart(s) • Test Plan Algorithm Verifying method main The focus here is to verify that the menu system works, if the user enters a menu option that does not match the expected options are they given an error message from your program logic before the program shuts down? Description Hand trace of program logic indicates that menu option for displaying verification report worked correctly. Numbers should be formatted to 5 decimal places Hand trace of program logic indicates that menu option for displaying centimeters conversion worked correctly. Test Plan Program Submission Requirements You will need to submit your MS Word document and java code files by the due date as specified in Brightspace. ⚫ Follow your lab professor's submission guidelines. 1.0 Centimeters: 100.00000 Centimeters: 100.00000 2 CST8116 Lab Exercise 04 (225) Instructions • The five parts of the Software Development Process as presented by Cay Horstmann [1] will be used as the basis for this lab exercise. 1) Understand the problem 2) Develop and Describe an Algorithm 3) Test Algorithm with Simple Inputs 4) Translate the Algorithm into Java 5) Compile and Test Your Program Also refer to your textbook by Joyce Farrell [2] for help with pseucode, flowcharts, UML class diagrams. What is the problem to solve for this exercise? A tool manufacturing company needs software to verify the lengths of meter sticks as they come off the production line. The software should ask the user to enter the length of the meter stick in meters, then verify that it is within 0.0001 meters of 1 meter. (0.1 meter is decimeter, 0.01 meter is centimeter, 0.001 meter is millimeter). The program should also ask the user what type of output they wish to view, one of verifying the length of the meter stick, seeing the centimeters of the meter stick, seeing the millimetres of the meter stick, or seeing a text report that represents the meter stick. All numbers must be formatted to five decimal places for output. When verifying meter sticks the company uses a tolerance of 0.0001 meters i.e. no more than one-tenth of a millimeter off expected measure of 1.0. Part 1 Understand the Problem • Review the word problem, as well as look at the starter code provided. Outline how the main logic would flow from inputs, to processing, to output. ⚫ Outline how the verify method would flow from start to return statement including math Use a menu in method main to offer the user a selection of output choices (use constants), and use a selection structure to perform the appropriate processing before displaying the output. You may use any selection structure (select case or if then) in solving this problem. Part 2a Pseudocode Create a detailed UML Class diagram that documents the provided class(s). • Write pseudocode for the verify method of class Meter Stick • Write pseudocode for the toString method of class Meterstick Write pseucode for the main method Reminder: Please review the lecture notes for UML Class diagrams as well as your Joyce Farrell textbook [2]. ⚫ In our course typically, we will have a class with only method main, as this is a static method it should be underlined. ⚫ Local scope variables inside method main are not to be documented in the UML class diagram in the second row. • Expanding on that, we never document variables that are local scope, i.e. declared within constructors or methods. The only variables that appear in a UML Class diagram, in the second row, are class-level variables declared at a class level. E.B. The only local-scope variables that appear in a UML class diagram, at all, are the parameters for constructors, and methods, but these are in-lined within each constructor's or method's line within the third row. Exercise04 +main(args:String[]):void Feel free to reproduce this example as part of your own UML Class diagrams. Part 2b Flowchart • Write a flowchart for the verify method of class Meter Stick • Write a flowchart for the toString method of class Meter Stick ⚫ Write a flowchart for the main method • Place these into your MS Word document as images. Part 3 Test Plans for Algorithms • Create a table in your MS Word document • You can use the example below as a guide • Refer to the lecture notes in week 9 regarding boundary testing, there are more than just two tests required. Testing verify method of class MeterStick Rather than using input, we use values of the length field, to then document expected vs actual method returns. Check boundary conditions just above, below, and at the EPSILON value. (Expecting 5 tests.) length 1.0 Expected return Meter stick is within tolerance of 0.00010 1.0002 Meter stick is not within tolerance of 0.00010 Input 1.0 Actual return Meter stick is within tolerance of 0.00010 Meter stick is not within tolerance of 0.00010 Expected output Meter stick is within tolerance of 0.00010 Actual output Meter stick is within tolerance of 0.00010 Description Hand trace of method logic indicates that the method return value matches expectations. Length is in between tolerance range. Hand trace of method logic indicates that the method return value matches expectations. Length is above upper tolerance range. Part 4 Translate the Algorithm into Java Create an Exercise04 project in Eclipse Using the starter code: Update all of the comment sections as per the requirements of our course, see week 1 lecture notes Follow your algorithm design and code the toString method, verify method, as well as method main. Part 5 Compile and Test Your Program • Compile and run your program. • Be prepared to demonstrate your program in the lab period, in the week before the formal lab submission is due. Re-use your algorithm test plans and test your program code ° Also ensure that printf is correctly formatting to five decimal places for all output. Test and document invalid and valid input like: Lengths within and outside tolerance 。 Valid and invalid menu selection o Text instead of numbers for input Important: Only check for invalid inputs like text in place of numbers when testing and documenting the main method. The verify method would never be reached in the case of invalid user input so there would be no program crashes to document in the verify method testing table. Lab Demonstration Notes • Your lab professor will ask you to demonstrate your program in lab, typically the week before the formal submission • Your lab professor may also ask you a brief question on your code. Microsoft Word Document Format See the template example (from lab exercise 1) and use the suggested headings below: Understand the Problem ⚫ Pseudocode(s) and Detailed UML Class Diagram • Flowchart(s) • Test Plan Algorithm Verifying method main The focus here is to verify that the menu system works, if the user enters a menu option that does not match the expected options are they given an error message from your program logic before the program shuts down? Description Hand trace of program logic indicates that menu option for displaying verification report worked correctly. Numbers should be formatted to 5 decimal places Hand trace of program logic indicates that menu option for displaying centimeters conversion worked correctly. Test Plan Program Submission Requirements You will need to submit your MS Word document and java code files by the due date as specified in Brightspace. ⚫ Follow your lab professor's submission guidelines. 1.0 Centimeters: 100.00000 Centimeters: 100.00000 2 CST8116 Lab Exercise 04 (225) Instructions • The five parts of the Software Development Process as presented by Cay Horstmann [1] will be used as the basis for this lab exercise. 1) Understand the problem 2) Develop and Describe an Algorithm 3) Test Algorithm with Simple Inputs 4) Translate the Algorithm into Java 5) Compile and Test Your Program Also refer to your textbook by Joyce Farrell [2] for help with pseucode, flowcharts, UML class diagrams. What is the problem to solve for this exercise? A tool manufacturing company needs software to verify the lengths of meter sticks as they come off the production line. The software should ask the user to enter the length of the meter stick in meters, then verify that it is within 0.0001 meters of 1 meter. (0.1 meter is decimeter, 0.01 meter is centimeter, 0.001 meter is millimeter). The program should also ask the user what type of output they wish to view, one of verifying the length of the meter stick, seeing the centimeters of the meter stick, seeing the millimetres of the meter stick, or seeing a text report that represents the meter stick. All numbers must be formatted to five decimal places for output. When verifying meter sticks the company uses a tolerance of 0.0001 meters i.e. no more than one-tenth of a millimeter off expected measure of 1.0. Part 1 Understand the Problem • Review the word problem, as well as look at the starter code provided. Outline how the main logic would flow from inputs, to processing, to output. ⚫ Outline how the verify method would flow from start to return statement including math Use a menu in method main to offer the user a selection of output choices (use constants), and use a selection structure to perform the appropriate processing before displaying the output. You may use any selection structure (select case or if then) in solving this problem. Part 2a Pseudocode Create a detailed UML Class diagram that documents the provided class(s). • Write pseudocode for the verify method of class Meter Stick • Write pseudocode for the toString method of class Meterstick Write pseucode for the main method Reminder: Please review the lecture notes for UML Class diagrams as well as your Joyce Farrell textbook [2]. ⚫ In our course typically, we will have a class with only method main, as this is a static method it should be underlined. ⚫ Local scope variables inside method main are not to be documented in the UML class diagram in the second row. • Expanding on that, we never document variables that are local scope, i.e. declared within constructors or methods. The only variables that appear in a UML Class diagram, in the second row, are class-level variables declared at a class level. E.B. The only local-scope variables that appear in a UML class diagram, at all, are the parameters for constructors, and methods, but these are in-lined within each constructor's or method's line within the third row. Exercise04 +main(args:String[]):void Feel free to reproduce this example as part of your own UML Class diagrams. Part 2b Flowchart • Write a flowchart for the verify method of class Meter Stick • Write a flowchart for the toString method of class Meter Stick ⚫ Write a flowchart for the main method • Place these into your MS Word document as images. Part 3 Test Plans for Algorithms • Create a table in your MS Word document • You can use the example below as a guide • Refer to the lecture notes in week 9 regarding boundary testing, there are more than just two tests required. Testing verify method of class MeterStick Rather than using input, we use values of the length field, to then document expected vs actual method returns. Check boundary conditions just above, below, and at the EPSILON value. (Expecting 5 tests.) length 1.0 Expected return Meter stick is within tolerance of 0.00010 1.0002 Meter stick is not within tolerance of 0.00010 Input 1.0 Actual return Meter stick is within tolerance of 0.00010 Meter stick is not within tolerance of 0.00010 Expected output Meter stick is within tolerance of 0.00010 Actual output Meter stick is within tolerance of 0.00010 Description Hand trace of method logic indicates that the method return value matches expectations. Length is in between tolerance range. Hand trace of method logic indicates that the method return value matches expectations. Length is above upper tolerance range. Part 4 Translate the Algorithm into Java Create an Exercise04 project in Eclipse Using the starter code: Update all of the comment sections as per the requirements of our course, see week 1 lecture notes Follow your algorithm design and code the toString method, verify method, as well as method main. Part 5 Compile and Test Your Program • Compile and run your program. • Be prepared to demonstrate your program in the lab period, in the week before the formal lab submission is due. Re-use your algorithm test plans and test your program code ° Also ensure that printf is correctly formatting to five decimal places for all output. Test and document invalid and valid input like: Lengths within and outside tolerance 。 Valid and invalid menu selection o Text instead of numbers for input Important: Only check for invalid inputs like text in place of numbers when testing and documenting the main method. The verify method would never be reached in the case of invalid user input so there would be no program crashes to document in the verify method testing table. Lab Demonstration Notes • Your lab professor will ask you to demonstrate your program in lab, typically the week before the formal submission • Your lab professor may also ask you a brief question on your code. Microsoft Word Document Format See the template example (from lab exercise 1) and use the suggested headings below: Understand the Problem ⚫ Pseudocode(s) and Detailed UML Class Diagram • Flowchart(s) • Test Plan Algorithm Verifying method main The focus here is to verify that the menu system works, if the user enters a menu option that does not match the expected options are they given an error message from your program logic before the program shuts down? Description Hand trace of program logic indicates that menu option for displaying verification report worked correctly. Numbers should be formatted to 5 decimal places Hand trace of program logic indicates that menu option for displaying centimeters conversion worked correctly. Test Plan Program Submission Requirements You will need to submit your MS Word document and java code files by the due date as specified in Brightspace. ⚫ Follow your lab professor's submission guidelines. 1.0 Centimeters: 100.00000 Centimeters: 100.00000 2
Expert Answer:
Answer rating: 100% (QA)
Introduction The given assignment required designing and creating a Java program to estimate the amount of gasoline needed for a car trip based on user input distance and a fixed fuel efficiency of Lk... View the full answer
Related Book For
An Introduction To Statistical Methods And Data Analysis
ISBN: 9781305465527
7th Edition
Authors: R. Lyman Ott, Micheal T. Longnecker
Posted Date:
Students also viewed these programming questions
-
Halemav paid $2 in dividends for each share over the past year and the company is not expected to increase its dividend distribution in the future. The risk free rate is 2% and the risk premium on...
-
Myers Corp. purchased depreciable assets costing $30,000 on January 2, 2017. For tax purposes, the company uses CCA in a class that has a 30% rate. For financial reporting purposes, the company uses...
-
Determine the magnitude of the resultant forces and its direction, measured clockwise from the positive xaxis. 50 N 30 70N 45 65 N
-
Determine the enthalpy and internal energy of \(1 \mathrm{~kg}\) steam at a pressure of \(10 \mathrm{bar}\), when (i) the dryness fraction of steam is 0.85 , (ii) the steam is superheated to...
-
CJs Pizza purchased a delivery van on January 1, 2012, for $25,000. In addition, CJs paid sales tax and title fees of $1,000 for the van. The van is expected to have a four-year life and a salvage...
-
Prepare Phillip and Claire's 2022 Federal Tax Return, and fill out the following forms: Form 1040, Schedule 1, Schedule 2, Schedule A, B, C, D, SE, Form 8949, Form 8995 TAXPAYER INFORMATION 1....
-
Ziggy's Inc. is a retailer of highly specialized clothing that opened for business on May 1, 2014, in a leased store in a strip mall. A condensed income statement for Ziggy's Inc. for its year, ended...
-
What is the concept of materiality? Is the dollar amount that matters for a company with annual sales of $10,000 the same compared to a company with annual sales of $1,000,000?
-
Stone Beauty, Inc. is a merchandiser of stone ornaments. The company sold 8,000 units during the year. The company has provided the following information: Sales Revenue Purchases (excluding freight...
-
Consider the planar manipulator given in Figure-2. Here, l, and la represent the constant link lengths and d and 8 respectively stand for the first and second joint variables. Find the Kinematic...
-
Revenues Costs and expenses Operating income Other income (expense)* $ 39,588 38,165 1,423 (77) Income before income taxes 1,346 683 $ 663 Income tax expense Net income *Includes $188 of interest...
-
. An empty elevated water tank is pulled by a steel cable by applying a 50 kN forec. The tank is pulled horizontally by 10 cm. The cable is suddenly cut and the resulting free vibration is recorded....
-
1) Write an article for evaluate the training program on goal and budget attainment. 2) Propose ways to administer, staff, and coordinate the training and development function with help of real MNC...
-
Solve the homogeneous differential equation 2.xy' = y(2x? + y?), y(2) = 1
-
Use nodal analysis to determine voltages v1, v2, and v3 in the circuit Fig. 3.76. Figure 3.76 4 S 3i, 2 A 4A
-
Refer to Exercise 19.17. Analyze the data using a computer program. Is the analysis of variance table from the output of the computer program the same as your results in Exercise 19.18? In Exercise...
-
Hansen (2006) describes a study to assess the migration and survival of salmon released from fish farms located in Norway. The mingling of escaped farmed salmon with wild salmon raises several...
-
An air conditioning company responds to calls concerning problems with air conditioners by sending a repair person to the home of the caller. There have been complaints about lengthy delays between...
-
In a large office building, there is a woman dead in her locked office, sitting at her desk. Except for the desk, chair, and contents on the desk, the office is empty and the air conditioner is...
-
How many birthdays does the average person have?
-
There are 5 different color houses, occupied by people of 5 different nationalities, who smoke 5 different cigar brands, drink 5 different types of alcohol, and have 5 different pets. The houses are...
Study smarter with the SolutionInn App