Here is my assignment that I need help on and it is challenging for me to get th
ID: 3628473 • Letter: H
Question
Here is my assignment that I need help on and it is challenging for me to get the right output, so here is what it is about. Thanks for your help!iLab 3 of 7: Class Composition and Static Methods / Variables (60 points)
Submit your assignment to the Dropbox located on the silver tab at the top of this page.
(See Syllabus/"Due Dates for Assignments & Exams" for due dates.)
i L A B O V E R V I E W
Scenario/Summary
The objective of the lab is to practice creating a standard UML Class diagram using Visio and then taking the UML Class to code. In addition, by using the class to create objects, overloaded and static methods will be learned.
Deliverables
Step
Deliverable
Step 6
Screen shots of running program results
Step 7
Zip file with entire Lab files
Lab Steps
Preparation:
If you are using the Citrix remote lab, follow the login instructions located in the iLab tab in Course Home.
Locate the Visual Studio 2008 icon and launch the program.
i L A B S T E P S
STEP 1: Analyze UML Diagrams
Analyze the following class diagram for the Airplane and Position classes: a UML diagram for the Airplane class. Note the following key points:
The airplane "planePosition" attribute is an object of type Position.
The airplane GetNumberCreated is a static method.
The position MAX_Speed is a constant
STEP 2: Code the Classes
Create a new Windows Form project called "CIS247A Week 3 Lab-LastName".
Using the UML Diagrams from Step 1, code the Airplane and Position classes in the new project using the following specifications:
Note: recall from the UML diagram that the Airplane class contains a Position object (planePosition) that holds all the position information. Thus in order to get to the Position information for any airplane object you must use the transitive "dot" notation, to drill down into the planePosition object. For example, if the name of the Plane object is "myPlane", to get to the direction attribute, you would use the notation "myPlane.PlanePosition.Direction" (where PlanePosition is the name of property that retrieves the "planePosition" object). Use this technique for each of the Plane Position attributes referenced below.
Add the following line to each of the constructors (in addition to setting default or given values):
numberCreated++; // increment the numberCreated each time an Airplane object is created.
Add the following code to the Move( ) method:
// convert degrees to radians since C# uses radians for Sine and Cosine functions
double radians = direction * Math.PI / 180.0;
// change the x location by the x vector of the speed
x += (int)(speed * Math.Cos(radians)); // notice typecasting to int
// change the y location by the y vector of the speed
y -= (int)(speed * Math.Sin(radians)); // notice the -= operator (minus equals)
Add the following code to the TurnRight( ) method:
// turn right relative to the airplane
if( direction > 0 )then
direction = direction – 1; // or direction -= 1;
else
direction = 359; // reset direction to fit within 0 - 359 degrees
end if
Add the following code to the TurnLeft( ) method:
// turn left relative to the airplane
if( direction < 359 ) then
direction = direction + 1; // or direction += 1;
else
direction = 0; // reset direction to fit within 0 - 359 degrees
end if
Add the following code to the Accelerate( ) method:
// increase the speed of the airplane
if( speed < MAX_SPEED ) then
speed = speed + 1; // or speed += 1;
end if
Add the following code to the Decelerate( ) method:
// decrease the speed of the airplane
if( speed > 0 ) then
speed = speed - 1; // or speed -= 1; end if
Add the following code to the GetNumberCreated ( ) static method:
// return the total number of airplanes created using the class as the blueprint
return numberCreated; // returns the number of airplanes created
STEP 3: Create the Windows Interface Form
For a refresher on how to create Windows Form applications see the "GUI Refresher" tab in the Week 3 content area.
Add a new form called "frmAirplane" to the project.
Provide textbox input fields for each of the attributes in the Airplane and Position classes. Ensure that each input is appropriately validated and the program shall only store valid inputs.
Ensure that each textbox has a label describing the purpose of the input field (called a label, field pair).
Add command buttons that correspond to each of the operations in the Airplane class, and include event handlers that invoke the associated method.
The event handler for each operation should display the position information before the action is taken, then display the information after the action is taken.
Add a command button that allows the user to create a airplane using the provided information, display the newly created airplane information in a label on the form, and display in a label how many airplanes have been created.
Add a command button that will clear all input fields.
Add a command button that will exit the application.
There are several ways to exit an application, but one popular way is to add a method to your code and then invoke the method from the Exit click event handler:
public void TerminateApplication()
{
MessageBox.Show("Thank you. Click OK to Terminate",
"Exit Application",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
Application.Exit();
}
STEP 4: Compile and Test
When done, compile your code by clicking on Build, Build Application Name. Then debug any errors in the Error Window until your code is error-free.
To execute your code, click Start and then Start Debugging. Check your output to ensure that you have the desired output. If you need to fix anything, close your execution window, modify your code as necessary, and rebuild.
STEP 5: Execution Screen Prints
Capture the results of each test and paste it into a Word Document.
STEP 6: Submit Deliverables
Put all of the Visual Studio files into a zip file.
Put the zip file and execution screen shots (Word document) in the Dropbox.
Submit your lab to the Dropbox located on the silver tab at the top of this page. For instructions on how to use the Dropbox, read these Step-by-Step Instructions or watch this Dropbox Tutorial.
See the Syllabus/"Due Dates for Assignments & Exams" for due date information
Explanation / Answer
Dear...
Please follow the instruction in the solution carefully and make sure if any changes made to program does not effect the entire project.
The above program is working perfectly. check your namespace. if you have created your project with different name other than Airplane then try this --open file Program.cs and change the namespace to the name with which your project is saved.
for ex: if project was saved as CIS312XXX then change the namespace in Program.cs to
namespace CIS312XXX
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.