Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Scarlet Overkill had a device built that is capable of radiating EM field and renders all electronics useless. In an attack by Scarlett and the

Scarlet Overkill had a device built that is capable of radiating EM field and renders all
electronics useless. In an attack by Scarlett and the army of Minions launched against the
Western hemisphere, the device was mounted on a surface vessel The Gru moving through
the Gulf of Mexico.
The for-mentioned ship has to be destroyed, however, none of our military assets are working
due to EM field interference. Therefore, only non-electronic assets would work.
Run Silent, Run Deep
Students from EEL4834 took possession of a WWII submarine named the Sword-Fish, which is
diesel electric with no electronics on board and a small electrical computer, then set out to sink
The Gru. The compass on the sub is worn out and only the East, North, West and South markers
are distinguishable, and hence can only navigate in those four directions.
Write a program as follows:
1- Ask the user for the amount of diesel loaded in the submarine.
2- Asks the user for the magnitude (distance), in meters, and the heading, in degrees of the
navigation to way-point one.
3- Decompose the vector into x and y components and output the magnitude and
direction (North, West, South, or East are the only reliable headings on the subs
compass) of the x component and then the y component. The x component is the
magnitude multiplied by the cosine of the angle. The y component is the magnitude
multiplied by the sine of the angle. Determine compass direction depending on weather
the vector component is positive or negative.
4- Calculate the amount of diesel spent to waypoint 1 and output it. Also output the
amount of diesel remaining. (The submarine has a fuel capacity of 175 metric tons of
diesel but was loaded with 1 ton in the example. The submarine spends 1 ton of diesel
per 51 miles traveled.)
5- This step has to be repeated for another waypoint.
6- Ask the user for the target bearing (0 to 25 degrees) and range (range in meters).
7- Output a firing solution as follows:
Range Torpedo heading will be the target bearing
increased by the percentage below.
100 to 3005%
301 to 5997%
600 to 8999%
900 to 120012%
Target bearing Torpedoes spread
0 up to 102 degrees
10 up to 154 degrees
15 up to 206 degrees
20 up to 258 degrees
No input validation is required, assume user will enter values of correct type and range.
Ignore small round off differences from test run below.
Note: Create variables to store data as needed.
Sample input/output:
Please enter the amount of diesel loaded: 1
Please enter heading for waypoint 1 in degrees: 45
Please enter distance to waypoint 1 in meters: 6000
Move on heading due East for 4242.74 meters
Move on heading due North for 4242.54 meters
Fuel spent =0.1034 Tons used.
Fuel remaining =0.8966 Tons remaining.
Please enter heading for waypoint 2 in degrees: 220
Please enter distance to waypoint 2 in meters: 4500
Move on heading due West for 3447.19 meters
Move on heading due South for 2892.54 meters
Fuel spent =0.0772 Tons used.
Fuel remaining =0.8194 Tons remaining.
Please enter target bearing in degrees: 23
Please enter target range in meters: 500
Fire torpedoes on heading 24.61 degrees with a spread of 8
degreesScarlet Overkill had a device built that is capable of radiating EM field and renders all
electronics useless. In an attack by Scarlett and the army of Minions launched against the
Western hemisphere, the device was mounted on a surface vessel The Gru moving through
the Gulf of Mexico.
The for-mentioned ship has to be destroyed, however, none of our military assets are working
due to EM field interference. Therefore, only non-electronic assets would work.
Run Silent, Run Deep
Students from EEL4834 took possession of a WWII submarine named the Sword-Fish, which is
diesel electric with no electronics on board and a small electrical computer, then set out to sink
The Gru. The compass on the sub is worn out and only the East, North, West and South markers
are distinguishable, and hence can only navigate in those four directions.
Write a program as follows:
1- Ask the user for the amount of diesel loaded in the submarine.
2- Asks the user for the magnitude (distance), in meters, and the heading, in degrees of the
navigation to way-point one.
3- Decompose the vector into x and y components and output the magnitude and
direction (North, West, South, or East are the only reliable headings on the subs
compass) of the x component and then the y component. The x component is the
magnitude multiplied by the cosine of the angle. The y component is the magnitude
multiplied by the sine of the angle. Determine compass direction depending on weather
the vector component is positive or negative.
4- Calculate the amount of diesel spent to waypoint 1 and output it. Also output the
amount of diesel remaining. (The submarine has a fuel capacity of 175 metric tons of
diesel but was loaded with 1 ton in the example. The submarine spends 1 ton of diesel
per 51 miles traveled.)
5- This step has to be repeated for another waypoint.
6- Ask the user for the target bearing (0 to 25 degrees) and range (range in meters).
7- Output a firing solution as follows:
Range Torpedo heading will be the target bearing
increased by the percentage below.
100 to 3005%
301 to 5997%
600 to 8999%
900 to 120012%
Target bearing Torpedoes spread
0 up to 102 degrees
10 up to 154 degrees
15 up to 206 degrees
20 up to 258 degrees
No input validation is required, assume user will enter values of correct type and range.
Ignore small round off differences from test run below.
Note: Create variables to store data as needed.
Sample input/output:
Please enter the amount of diesel loaded: 1
Please enter heading for waypoint 1 in degrees: 45
Please enter distance to waypoint 1 in meters: 6000
Move on heading due East for 4242.74 meters
Move on heading due North for 4242.54 meters
Fuel spent =0.1034 Tons used.
Fuel remaining =0.8966 Tons remaining.
Please enter heading for waypoint 2 in degrees: 220
Please enter distance to waypoint 2 in meters: 4500
Move on heading due West for 3447.19 meters
Move on heading due South for 2892.54 meters
Fuel spent =0.0772 Tons used.
Fuel remaining =0.8194 Tons remaining.
Please enter target bearing in degrees: 23
Please enter target range in meters: 500
Fire torpedoes on heading 24.61 degrees with a spread of 8
degrees

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Seven NoSQL Databases In A Week Get Up And Running With The Fundamentals And Functionalities Of Seven Of The Most Popular NoSQL Databases

Authors: Aaron Ploetz ,Devram Kandhare ,Sudarshan Kadambi ,Xun Wu

1st Edition

1787288862, 978-1787288867

More Books

Students also viewed these Databases questions

Question

36. He didnt have the guts to badmouth her 2 her face.

Answered: 1 week ago