Answered step by step
Verified Expert Solution
Question
1 Approved Answer
hello I was having a hard time with this practice assignment .I was stuck on what constructor to use. java programming Instructions The Software Development
hello I was having a hard time with this practice assignment .I was stuck on what constructor to use.
java programming
Instructions The Software Development Process as presented by Cay Horstmann [1] will be used as the basis for this lab assignment. 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 Rectangular Snip 1) Understand the problem A client (a person who wants a program developed) who owns a car rental company wants a program developed that will estimate the litres of gas needed to drive a car a given distance in kilometers on a highway for a road-trip. Currently staff at the rental desk need to ask the customer the estimated mileage the car will be driven on the highway, they then need to look up the fuel efficiency of the car to be rented and use that within the math needed to determine the amount of gasoline in litres the customer will need for their road-trip. A typical fuel economy for the rental company's cars is 6.8L/100Km, most customers have round trips of 900Km on the highway, for example from Ottawa to Toronto. The program should allow the entry of the distance to drive, the litres per 100Km for efficiency, and output the Litres of gasoline needed, rounded up to a whole number when producing the result. You would only need to input 6.8 for the efficiency, work with 100Km internally in the program as part of your math. Write out briefly how you would do each step, as if you were the staff member. Including examples of math calculations you would perform either by hand, or with the assistance of a calculator. Type this into your MS Word document as part of your submission. 2) Develop and Describe an Algorithm including Classes Determine what objects, the properties of the objects, and behaviors would be required for an object oriented program, start with simple UML class diagrams and as you work out more details document the design with a detailed UML class diagram. Write pseudo-code as the basis of your algorithm, as well as create a flowchart. You should reference the lecture notes, as well as your textbook by Joyce Farrell [2] as learning resources for this part of the assignment. You should show object instantiation in the flowchart as variable declarations, then use method calls to methods. Note, you are not required to document get/set accessor, mutator methods in your algorithm or flowchart in detailed step-by-step, only method main and any method(s) that perform math calculations. You may hand-draw the flowchart and UML class diagram for this assignment instead of using software, just use a ruler and print legibly. | 3) Test Algorithm with Simple Inputs As per the lecture notes, use a table within your MS Word document to test the algorithm. Consider picking numbers that might be expected as input and work through the algorithm documenting expected outputs, you may use a calculator. If there is a problem with the algorithm based on this desk-check correct the pseudocode and flowchart, UML class diagram(s) and repeat this step again. diagram(s) and repeat this step again. 4) Translate the Algorithm into Java You are to use the Eclipse IDE to create your Java program, use a project name like Assignment 02. Don't forget to comment your code files, with the expected code header. You are not required to copy and paste code into the MS Word document, however your.java file(s) must be submitted. 5a) Compile and Run Your Program Compile and run your program, using your documented test values. Take a screen shot of Command prompt window, or a rectangular selection of the Eclipse Console View depending on your development environment, ensure your name as output by the program is captured in the image. Instructions The Software Development Process as presented by Cay Horstmann [1] will be used as the basis for this lab assignment. 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 Rectangular Snip 1) Understand the problem A client (a person who wants a program developed) who owns a car rental company wants a program developed that will estimate the litres of gas needed to drive a car a given distance in kilometers on a highway for a road-trip. Currently staff at the rental desk need to ask the customer the estimated mileage the car will be driven on the highway, they then need to look up the fuel efficiency of the car to be rented and use that within the math needed to determine the amount of gasoline in litres the customer will need for their road-trip. A typical fuel economy for the rental company's cars is 6.8L/100Km, most customers have round trips of 900Km on the highway, for example from Ottawa to Toronto. The program should allow the entry of the distance to drive, the litres per 100Km for efficiency, and output the Litres of gasoline needed, rounded up to a whole number when producing the result. You would only need to input 6.8 for the efficiency, work with 100Km internally in the program as part of your math. Write out briefly how you would do each step, as if you were the staff member. Including examples of math calculations you would perform either by hand, or with the assistance of a calculator. Type this into your MS Word document as part of your submission. 2) Develop and Describe an Algorithm including Classes Determine what objects, the properties of the objects, and behaviors would be required for an object oriented program, start with simple UML class diagrams and as you work out more details document the design with a detailed UML class diagram. Write pseudo-code as the basis of your algorithm, as well as create a flowchart. You should reference the lecture notes, as well as your textbook by Joyce Farrell [2] as learning resources for this part of the assignment. You should show object instantiation in the flowchart as variable declarations, then use method calls to methods. Note, you are not required to document get/set accessor, mutator methods in your algorithm or flowchart in detailed step-by-step, only method main and any method(s) that perform math calculations. You may hand-draw the flowchart and UML class diagram for this assignment instead of using software, just use a ruler and print legibly. | 3) Test Algorithm with Simple Inputs As per the lecture notes, use a table within your MS Word document to test the algorithm. Consider picking numbers that might be expected as input and work through the algorithm documenting expected outputs, you may use a calculator. If there is a problem with the algorithm based on this desk-check correct the pseudocode and flowchart, UML class diagram(s) and repeat this step again. diagram(s) and repeat this step again. 4) Translate the Algorithm into Java You are to use the Eclipse IDE to create your Java program, use a project name like Assignment 02. Don't forget to comment your code files, with the expected code header. You are not required to copy and paste code into the MS Word document, however your.java file(s) must be submitted. 5a) Compile and Run Your Program Compile and run your program, using your documented test values. Take a screen shot of Command prompt window, or a rectangular selection of the Eclipse Console View depending on your development environment, ensure your name as output by the program is captured in the imageStep 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