1) For an o
it with perigee altitude of 300 km and apogee altitude of 800 km, what is the magnitude of the position vector (in km) when the spacecraft has just passed perigee by 30 deg?
2) The NPSAT-1 satellite was launched in June 2019 into a circular o
it of 720 km altitude by 24 deg inclination. What is its period in seconds?
3) For a spacecraft o
iting the earth with perigee altitude of 250 km and apogee altitude of 26,500 km, what is its specific mechanical energy (km2/sec2)?
4) (Not the same as previous question) For a spacecraft o
iting the earth with pergee altitude of 250 km and apogee altitude of 28,000 km. If the spacecraft's distance from earth's center is 30,000 km, what is its velocity in km/sec?
5) For a geosynchronous o
it (circular o
it) with period of 23 hours, 56 minutes, what is its semimajor axis in kilometers?
6) A Hohmann transfer is used to move a spacecraft from a circular o
it altitude of 225 km to a co-planar circular o
it altitude of 3500 km. What is the Total ΔV in meters per sec for the maneuver?
7) A spacecraft is in a circular o
it at 400 km altitude and 26 deg inclination. In order to make a simple plane change of the o
it to a 51.6 deg inclination, what is the magnitude in kilometers per second of the ΔV for the maneuver?
lab05-et1aikxj.pdf
Programming Fundamentals
Lab 05
Exercise 1
Exercise 1 will involve working with radio buttons, group boxes and check boxes….
Create a new C# Windows Forms App project called Lab05-1.
1. Follow the instructions below to create three group boxes containing 2 and 3 radio buttons and 3
check boxes respectively, one button, three labels and a list box on the screen and a
ange them
to appear as follows:
2. Click on the form and change its text property to Profile by changing its text property in the
properties window. Always do this for every form.
3. Drag all controls onto the form, giving each an appropriate name by changing its name property
in the properties window. For groups, drag a group box first and then drag the appropriate
controls onto it.
Remember: Use 3-letter prefixes before each name – use lbl, btn, lst, grp, chk and rad
espectively for label, button, list box, group, check boxes and radio buttons.
4. Change the text properties of the controls to read as outlined on the screen above – Ask, if you
are stuck!!!
5. Change the enabled properties to false for each of the controls:
Age group box
Replies group box
Summarise button
6. When the program runs, the user will select the Male or Female from the Gender group box, at
which point two things happen (which you must code for each radio button!)
Programming Fundamentals
a. First, either “You selected Male” or “You selected Female” appears in the Gender label.
So, for the appropriate radio button, use the line:
lblGender.Text = “You selected……”;
. Secondly, the Age group box becomes enabled on the screen (So, in the code for each
adio button, use the following line for the Age group)
grpAge.Enabled = true;
7. Now, the user selects one of the categories from the Age group box and this choice is now
copied into the Age label. Hint: For each of the radio buttons in the Age group, code a line with
text similar to:
lblAge.Text = “You are…… ”;
Also, for each radio button in the Age group box, make the Summarise button enabled using the
line:
tnSummarise.Enabled = true;
8. When the button Summarise is clicked, the text in the Gender label and the Age label should be
copied into the list box and the Replies group box should be enabled. The code for the gender
label is as follows:
lstSummary.Items.Add(lblGender.Text);
9. Finally, when the user checks any of the check boxes, the co
esponding checks text should be
copied to the Summary list box as indicated in the below image. The code for the first check box
is as follows:
if (chkDrives.Checked == true)
{
XXXXXXXXXXlstSummary.Items.Add(chkDrives.Text);
}
You might notice that by default the Male radio button is checked. To stop this from happening set the
Checked property (in the Appearance section in properties) to False for both the Male AND female
adio buttons (even if they are already false).
Programming Fundamentals
Exercise 2
Create a new C# Windows Forms App project called Lab05-2.
1. Follow the instructions below to create 4 labels, 4 text boxes an a button on the screen and
a
ange them to appear as follows:
2. Ensure to name all controls according to the co
ect convention (Labels starting with lbl, text
oxes starting with txt & buttons starting with btn).
3. Make the labels bold.
4. Make the text box for Grade read only and its background white (Highlight Text is a good
ackground colour for the text boxes).
5. When the Calculate Grade button is clicked the co
ect grade should be displayed in the Grade
text box.
The grade should be calculated as follows:
Exam Mark Entered Grade
Over 100 or Below 0 Invalid
85 or above A
70 to 84 B
55 to 69 C
40 to 54 D
39 or below E
Hint:
Get the value out of the text box first and then start by comparing it to 100 & 0.
double mark = double.Parse(txtMark.Text);
if (mark < 0 || mark > 100)
{
set Grade text to Invalid
}
else if( mark >= 85)
{
Programming Fundamentals
Exercise 3
Create a new C# Windows Forms App project called Lab05-3.
1. Follow the instructions below to create 4 labels, 4 text boxes and a button on the screen and
a
ange them to appear as follows:
2. Ensure to name all controls according to the co
ect convention (Labels starting with lbl, text
oxes starting with txt & buttons starting with btn).
3. Make the labels bold.
4. Make the text boxes for Price, Vat & Total Price read only and their background white (Highlight
Text is a good background colour for the text boxes).
When the Calculate Price button is clicked the following should occur:
1. The price before VAT should be calculated and put in the Price text box (see below for
details).
2. The VAT amount should be calculated (21% of the Price) and put in the VAT text box.
3. The total cost should be calculated (Price plus Vat) in total price text box.
Remember all prices should be in decimal format.
A copying centre charges 10c per copy for the first 100 copies, 6c for each additional copy up to and
including 200 copies and 4c for each additional copy thereafter. (These prices are before VAT).
CALCULATIONS:
If number of copies is <= 100 multiply by 0.1 to get the cost in euro & cent.
Otherwise if number of copies is less than or equal to 200 minus 100 from the number of copies and
multiply that by 0.06 and then add 10, because the first 100 copies cost 10 cent each which is a total
of €10.
Programming Fundamentals
Otherwise minus 200 from the number of copies and multiply that by 0.04 and then add 16, because
the first 100 copies cost 10 cent each which is a total of €10 and the next 100 copies cos 6c each
which is a total of €6
The code starts like this:
int copies = int.Parse(txtNumCopies.Text);
double price = 0;
if(copies <=100)
{
price = copies * 0.1;
}
else if (copies <=200)
{
copies = copies – 100;
price = copies * XXXXXXXXXX;
}
…
Programming Fundamentals
Exercise 4
Create a new C# Windows Forms App project called Lab05-4.
1. Follow the instructions below to create 4 labels, 4 text boxes and a button on the screen and
a
ange them to appear as follows:
1. Ensure to name all controls according to the co
ect convention (Labels starting with lbl, text
oxes starting with txt & buttons starting with btn).
2. Make the labels bold.
3. When the Outcome button is clicked the Outcome label (below the Outcome button) should
state the following
a. If the expenditure is greater than the income, the label should output: “You made a loss
of nnnn”, where nnnn is the amount of loss.
. If the Income is greater than the expenditure, the label should output: “You made a profit
of nnnn”, where nnnn is the amount of profit.
c. Otherwise (if the income and expenditure is the same), the label should output: “You
oke even”.
See below for examples
Programming Fundamentals
lab06-qy5oj2bn.pdf
Programming Fundamentals
Lab 06
These exercises involve working with loops.
Exercise 1
Create a new C# Windows Forms App project called Lab06-1.
Follow the instructions below to create one label, one text box, four buttons and one list box on the
screen and a
ange them to appear as follows:
1. Click on the form and change its text property to TimesTables by changing its text property in
the properties window. Always do this for every form.
2. Drag all controls onto the form, giving each an appropriate name by changing its name property
in the properties window.
Remember: Use 3-letter prefixes before each name.
3. Change the text properties of the controls so that they look like the above.
4. Change the property TextAlign (under Appearance) to right for the number text box.
5. When For button is clicked the times tables will display in the list box for the number input to the
Number text box using a for loop (see below image for sample output).
6. When While button is clicked the times tables will display in the list box for the number input to
the Number text box using a while loop (see below image