bit has to be moved over one bit slot left, and a zero is added at the empty rightmost space. For
After a one position left shift: 0001101011101001 will become: 0011010111010010
In your own words, explain how your algorithm works.
As a minimum, your completed project shall
a movable friendly
fighter aircraft which shall defend itself against a squadron of enemy fighters
using weapons which can be fired by the user using the keyboard.
a number of enemy
fighters which shall attempt to destroy your friendly fighter. Enemy fighters shall destroy your friendly
fighter by either crashing into it or optionally firing projectiles to hit it.
The user is the
person playing the game and will be playing the role of the friendly fighter.
The simulation will continue until all of the enemy aircraft have been
destroyed, your friendly aircraft has been destroyed, or the user decides to
quit. The user will
“communicate” with the friendly fighter by entering commands via the
keyboard. These commands will move the
defender up and down on the display and fire the projectiles. When fired, the projectiles shall provide a
display of the projectile’s path traveled and shall destroy any target they
hit. The user will determine the number
of enemy fighters via a dialog box.
You will use the
StdDraw package introduced below to provide the graphical elements of your
simulation. This software is courtesy of Robert Sedgewick and Kevin Wayne from
Princeton University’s Computer Science Department. See the following
description for details on its use, or you can find information on the
Princeton Intro to CS website.
StdDraw is used to
produce graphical output. In order to
use the class you must first add it to your project. The easiest way to do this is to download
StdDraw.java and save it to the src directory of your project.
StdDraw is similar to
the Math class in that you can’t create a StdDraw object. Everything you need is accessed via static
methods and static variables. Documentation for the class can be found here, or
at http://www.cs.princeton.edu/introcs/15inout/ under the Standard Drawing
heading along with multiple examples.
Some of the methods you’ll use in this project are:
x0, x1) – used to set the dimensions for the display area. For example setXscale(-20, 20) creates a
display area where x ranges from -20 to 20.
y0, y1) – same as above, except it sets the y dimensions.
c) – set the color that will be drawn.
The colors can be accessed as static variables in StdDraw. Ex: setPenColor(StdDraw.BLUE).
x, double y, double r) – draws a solid circle with the center at position x, y
and a radius of r.
void show(int t) –
shows the drawing and pauses for t milliseconds.
from the StdDraw package may be needed and can be discovered by reading the
Your project must
include the following classes which are derived from class AerialObject (which
you also shall provide): an EnemyAircraft class, a FriendlyAircraft class, a
Projectile class. In addition, should
you choose to add any moveable GroundObjects to your project (for extra
credit), you should include an additional DogfightObject class from which
classes AerialObject and GroundObject inherit.
In addition, your project shall include a class Pos to define the
coordinates of your objects in the x-y coordinate space, as well as a class
BattleSpace to hold all of the objects in your BattleSpace (EnemyAircraft,
FriendlyAircraft, Projectile). It shall
also include an execution class AerialDogfight used to control the execution of
your simulation. You will need to import the StdDraw.java code into your
project so you will actually have at least nine classes (see me if you have an
alternate architecture in mind) in your project.
Figure 1 below
provides a partial UML Class Diagram for the above recommended
architecture. You should provide
additional classes as well as addition attributes and methods for the existing
classes as you feel necessary to meet the project specifications.
Figure 1: Project 1
“TopGun” UML Class Diagra
is a top-level class to contain all of the attributes and methods which are
common to the other entity classes in the simulation. It will contain commonly used constants as
well as attributes and methods common to both aerial and ground objects used in
Class AerialObject is
an abstract class used as the base class for creating classes EnemyAircraft,
FriendlyAircraft, and Projectile. It
will also be used for creating a reference object that will be used to invoke
polymorphic behavior of these classes when drawing an instance of these classes
in the window.
We’re going to add a
FriendlyAircraft to our dogfight to use in holding off the enemy (or to at
least zap a few of them in the process!)
Our FriendlyAircraft will be a located along the left edge of the screen
and shall be controlled using the “U” and “N” keys, indicating up and down
respectfully, to move it along the left side of the window and the ‘F’ key to
fire its Projectiles. Use StdDraw to
draw it using an appropriately sized icon.
Movement will be simulated by the right-to-left movement of the enemy
aircraft across the screen. Each time
the fire key is pressed, your FriendlyAircraft shall fire its Projectile
leaving a trail that shall travel directly to the right from its position,
disappearing when it reaches the right side of the window (hopefully hitting an
EnemyAircraft in the process!
This class should be
developed using the Figure 1 UML diagram as a basis. As a minimum, you shall display your
EnemyAircraft using an appropriately sized icon. The y location shall be
randomly generated before the EnemyAircraft object is instantiated and the x
location shall be set to the right of the display. All three of these values should be passed to
the constructor. Use StdDraw to draw
appropriately sized icons. EnemyAircraft
shall be removed from the display if hit by our FriendlyAircraft’s
Projectiles. Your life will be easier if
you use class Pos to represent the position of the objects in your BattleSpace
and make all your x and y’s that designate the location doubles rather than
ints. Your toString method should return
the location of the EnemyAircraft and obviously all EnemyAircraft should be
instantiated as alive. Your
EnemyAircraft should start at the right side of the Window and move in a
semi-random direction while moving from the right to the left side of your
screen- changing direction each time it reaches the top and bottom boundaries
of the BattleSpace (or otherwise decides it’s bored with the current direction
it’s heading!). Your directions are
either directly left, diagonally down-left, or up-left. Optionally, the EnemyAircraft may fire their
own missiles at the FriendlyAircraft, destroying it and terminating the game if
the FriendlyAircraft is hit. The
FriendlyAircraft may also be destroyed if an EnemyAircraft runs into it.
The Projectile class
shall be used to create the track of projectiles fired from the
FriendlyAircraft’s weapons each time the fire key is pressed. Projectiles shall originate at the
FriendlyAircraft’s position and travel to the right until they either hit an
invading EnemyAircraft (thereby destroying it) or travel beyond the limits of
the viewer’s window. Optionally,
Projectiles may also be fired from the Enemy aircraft, either automatically or
by the designer’s choice of key depression or mouse click. If the Enemy aircraft fires a projectile, it
shall travel in the same direction as the EnemyAircraft’s heading and it shall
destroy any object (friend or foe) to which it contacts.
I also defined a class
BattleSpace to hold all of the various components for my simulation
(EnemyAircraft, FriendlyAircraft, Projectile).
It includes methods for adding EnemyAircraft and a FriendlyAircraft to
the simulation as well for firing Projectiles when the user hits the “f”
key. A draw( ) method is also provided
to display these items in the window. To
keep track whether we’re winning the battle against the invading horde, we’ll
want to keep a count of and display the number of EnemyAircraft we’ve
Finally, you’ll want
to create an execution class that controls the whole simulation. Class AerialDogfight contains the methods
used to control the simulation operation.
Remember, the main method of your execution class should be very short
(2-3 lines maximum); it will basically rely on the run() method and its helpers
to control the execution.
The project will be
graded using the following guidelines
All source files, except StdDraw.java, must be documented using JavaDoc. You
must submit completed UML diagrams for all three classes.
You are expected to use what we’ve learned with respect to proper use of the
public and private access modifier to control access to the data members and
hide the underlying implementation as much as possible. You must also use
accessor/get and mutator/set methods to access the private data.
Style Guide (5%):Make
sure you are familiar with the style guide in terms of formatting your code and
proper use of variable and class names. See the course web page for a link to
Specifications (75%):Your project should meet the requirements as laid out in
this project description and expanded on below.
1. Project must use inheritance.
2. Project must use polymorphism.
3. Project must use Abstract classes.
4. Project must use ArrayLists to contain AerialObject
and Ground objects.
5. Project must iterate through elements
contained in ArrayListcontainer using for each loops.
6. Other requirement as called out in the
above Project specifications.
( 1 pt.) Put a counter
in the loop in the simulate method and when all targets have been destroyed
give the user his score via a JOptionPane dialog box. The score should be the number of targets the
( 3 pts.) Stop the
targets from ever overlapping each other.
( 5 pts.) Allow the
EnemyAircraft to fire their own Projectiles, ending the simulation when one of
their own Projectiles destroys the FriendlyAircraft. The Projectile’s direction of motion shall be
determined by the aircraft’s heading at the time the Projectile is fired.
( 3 pts.) In
conjunction with 3 above, EnemyAircraft Projectiles shall destroy any
EnemyAircraft or FriendlyAircraft they hit.
( 5 pts.) Allow the
FriendlyAircraft movement to be controlled in a left-to-right or right-to-left
direction as well as an up-down movement giving it full range across the entire
battlefield. When fired, the
FriendlyAircraft’s Projectiles direction of motion shall be determined by the
aircraft’s heading at the time the Projectile is fired.
( 3 pts.) Add scenery
to the Battlefield (rocks, shrubs, trees, etc.), providing an overhead
perspective of the Battlefield.
( 5 pts.) Add one or
more AirArtillery positions to the simulation.
The AirArtillery battery shall fire Projectiles in a direction that is
either controlled by the user via keyboard selection or simulated automatically
using a random number generator to fire the projectile and determine direction.
should consist of:
Paper Submission: A
printout of all files containing any source code that you either create or
modify, the complete UML diagrams for all classes, and a screen capture of the
execution. Source code shall be properly
annotated using appropriate JavaDoc notations. It is not necessary to turn in a
hard-copy of any provided source files that you did not modify.
Submission: All source code, including files provided for your use (in other
words everything we’ll need to compile and run your program). These files shall
be submitted to your instructor via BlackBoard by the deadline. You do NOT need to submit StdDraw.java.
To Wear a Mask or Not to Wear a Mask. That is the Question. Covid-19 and the fear of contracting the Coronavirus has divided our population into two very polarized groups. One side believes in the gov
That is the Question.
Covid-19 and the fear of contracting the Coronavirus has divided our population into two very polarized groups. One side believes in the government. The other side does not. One side trusts the science behind what they are told. The other side does not. One succumbs to peer-pressure. The other side just wants to live and let live… in their own way. But what makes one person choose to wear a medical mask during a worldwide pandemic while their brothers and sisters do not? Political debate? Common sense? Defiance? Fear? Which side is right? Which side is wrong?
Defend your right to choose. Are you for medical masks or against them? Be prepared to support your views with research and a strong compelling argument in a mock -email to your local councilor (i.e., you won’t be sending it).
So, choose your partner, and get ready to divide and conquer this very difficult topic.
Note: Agreed this is hot topic, but it is a valuable discussion as there are often two sides to any argument, and the trick is to learn how to argue without offending those who have contrary views and learn how to have an open discussion where both sides can learn from the other.
Part 1: Choose a side – You can either be for wearing a mask or against, no in between. Be ready to defend your own unique topic from your point-of-view.
Part 2: Research your topic – Find online resources to support your views and be ready to use them to back up your argument.
Part 3: Write a Email to your Local Councilor– Here’s a link to help you (ie where to find their email addresses to add to your mock email): https://www.toronto.ca/311/knowledgebase/kb/docs/articles/city-clerks-office/secretariat/members-of-council-finding-who-your-councillor-is-contacting-your-councillor-or-council.html Emails must be no less than one page, single-spaced, properly formatted and free of spelling, grammatical and spelling error for you to be takes seriously. Carefully consider your subject line so it will be read. Ensure you satisfy the SEE principle and state your case so it can be heard, fairly.
Part 4: Start a Discussion On Social Media– Do this on your own Facebook, Twitter or Instagram pages to see if you are part of the majority or minority when it comes to your views. Record how it went. Did you feel supported or thwarted? Count up the posts and see what won out: for or against. Write a paragraph synopsis to tell us how it made you feel.
Part 5: Prepare to Present–You will be asked to present a 5-minute presentation by video to present your topic as if you were standing down at a podium at Queens Park giving the government a piece of your mind either about why you shouldn’t have to wear a mask or why they should be doing more to enforce everyone to wear one. No PowerPoint Presentations. Just you standing up for your views.
ECON 214 Macro Christian ethics project
Does your textbook (meaning the
textbook called : Bulls, Bears and Golden Calves by John Strapleton 2nd
edition) present only positive economics and avoid any normative economics? If
not, give some examples of normative issues covered in your textbook.
2. What is the difference
between self-interest and selfishness? Why is this distinction important when
considering the competitive market economy as appropriate for a society?
3. What did Adam Smith
believe serves to curb self-interest in an economy?
4. What does it mean to
seek the kingdom of God in a democratic capitalist economy? How can it be done?
Note: please provide answers to all 4 questions
Finding a conditional Probability: Example Let’s look at a standard deck of 52 cards. What is the probability
Finding a conditional Probability:
Let’s look at a standard deck of 52 cards.
What is the probability of getting 2 kings assuming that the first one is not replaced?
4/52 * 3/51 = 1/13*1/17= 1/221
What is the probability of getting 2 kings assuming that the first one is replaced?
4/52 * 4/52 = 1/13 * 1/13 = 1/169
Now for your main post do a similar problem using with replacement and without replacement. You can use a card problem as long as it is not 2 kings. Try your best to be original. Do not solve your own problems. Leave them for your classmates to work.
For your response pick 2 classmates. On each post copy their problem, then show your work explaining how you worked each problem, and then show your answer. Of course there will be more than one comment on each person’s work. Stay positive when replying.
To earn full credit for this discussion, you must respond to at least two (2) of your peers
CLASSMATE #1 RESPOND TO:
I hope all is well and that everyone had a great weekend. Mine sure was a great one that my family and I spent at the lake. Probabilities are not something that interests me so I think that this week is going to be quite difficult. I have had to study up on them in the past so I understand how useful they can be to say a business owner or a stock trader but in my line of work and in my future career I don’t really know how I would apply them to benefit others. I hope that this week ends up making sense to me as I learn it but for the time being I just hope that everyone does well with it.
My scenario is: I went to the grocery store on a Monday morning and decided to stock up on plenty of fruit for the week. While I was in the produce aisle I decided to purchase 4 red delicious apples, 4 blood oranges, 4 ripened kiwis, and 4 black plums. When I got home I needed to separate the fruit for proper storage. Without looking in the bag and without feeling around too much, my questions are:
1) What is the probability of choosing two plums over the other fruits in the bag assuming that the first one is not replaced?
2) What is the probability of choosing two plums over the other fruits in the bag assuming that the first one is replaced?
I look forward to your responses and have a great week.
CLASSMATE#2 RESPOND TO:
Hello class, for this week’s lesson we have learned how to calculate the probabilities of events which with any luck might help some of us to win the lottery someday. For my scenario I have gone to the cookie store in the mall and bought 24 cookies. I bought 12 chocolate chip, 3sugar cookies, 4 peanut butter cookies, and 5 snickerdoodle cookies. Without looking in the bag or feeling for any specific type of cookie what are the chances of grabbing one chocolate chip and one sugar cookie when selecting two cookies if the first one was not replaced? Also, without looking in the bag or feeling for any specific type of cookie what are the chances of grabbing two snickerdoodle cookies if the first one was replaced?
Essay Writing at Proficient Essay
Review This Service