Assignment 1
Learning Outcome:
Define the basic functional components of a computer system, operation and inter-connection (3%)
Apply programming concepts to computing problems (7%) Weight: 10%
Part 1: Programming – Tin Can Mail
Problem Statement
This assignment is inspired by the mail delivery system of Niuafo’ou, the northern most island of the Kingdom of Tonga. Niuafo’ou is actually a volcano, which descends steeply into the sea and has a crater lake in its middle. Due to its steep slopes into the sea, it has no proper port or harbour, and even landing by boat on one of the few stony beaches can be dangerous.
In the 1880s, the Tin Can Mail mail delivery system was developed: Incoming mail was put into a tin can and thrown overboard close to the island from a mail boat, and outgoing mail in a tin can was shot out to sea by means of a cannon to be picked up by the mail boat.
Tin Can Mail became famous beyond Tonga, with special stamps that have become collector items all over the world. This system lasted for a hundred years until 1983, when an airfield was built, and mail could be delivered by plane.
In this assignment you are asked to determine the trajectory of the outgoing tin cans, given launch speed (muzzle speed of the cannon), launch angle and wind speed by means of Euler’s integration formula as shown in Figure 1. Your program is to simulate the trajectory and estimate the landing position of the tin can. It must take into account the air resistance and wind, since there will be usually a sea breeze blowing towards the coast. The simulation is based on classical equations for projectiles and air resistance.
Equations
The position of the tin can over time is modelled by the functions π₯(π‘) and π¦(π‘), and the speed of the tin can over time is modelled by the functions π£s(π‘) and π£y(π‘), where x is the horizontal direction and y is the vertical direction, as shown in Figure 1. The drag forces πΉs(π‘) and πΉy(π‘) slow the projectile down in x and y direction, respectively. For low speeds, this force can be approximated as growing linearly with the relative speed of the projectile with respect to the breeze. Assuming a sea breeze with constant (negative) wind speed π£ws, the drag forces are:
πΉs(π‘) = −πd(π£s(π‘) − π£ws) and
πΉy(π‘) = −πdπ£y(π‘) − π
where πd is the drag coefficient and π is the acceleration due to gravity.
Our approximation uses Euler’s integration method, which assumes that from the launch at time t=0, the projectile’s movement is simulated in many very small time steps where during each time step the projectile moves a very small distance and its speed is diminished by a very small amount as well.
During one time interval βπ‘, the tin’s position changes as
π₯(π‘ + βπ‘) = π₯(π‘) + π£s(π‘)βπ‘
π¦(π‘ + βπ‘) = π¦(π‘) + π£y(π‘)βπ‘
and during the same time interval, the speed of the tin is slowed down by the drag as
π£s(π‘ + βπ‘) = π£s(π‘) + πΉs(π‘)βπ‘
π£y(π‘ + βπ‘) = π£y(π‘) + πΉy(π‘)βπ‘
Initially we have π₯(0) = π¦(0) = 0, π£s(0) = π cos πΌ, and π£y(0) = π sin πΌ
where π is the launch speed and πΌ the launch angle.
Wind Speed
For the wind speed, the program should use the Beaufort Scale. It asks the user to enter a Beaufort number as defined in Table 1. If the number entered is between 0 and 6, the program uses the wind speed from the Table. If the number entered is 7 or above, the program is to inform the user that it is no longer safe to launch a tin can, due to the strong wind.
Approximating the Trajectory
In your C++ program, implement the equations above with suitably named variables and constants of the correct types. Implement the iteration of the many time intervals as an appropriate loop that terminates when the projectile hits the water (π¦(π‘) = 0). Make sure that it does terminate!
Use the values in Table 2 for those variables (Note that our initial speed is named c and our speed of sea breeze is named π£ws and must be negative!):
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme