Free Essay

Shakespear

In:

Submitted By allangalli
Words 457
Pages 2
Name____________________________________ APCS A (Pre-Lab Exercises – 2.3-2.5)

1. What is the difference between a variable and a constant? What reserved word is required to declare a constant?

2. Explain what each of the lines below does. Be sure to indicate how each is different from the others. a. int x;

b. int x = 3;

c. x = 3;

3. The following program reads three integers and prints the average. Fill in the blanks so that it will work correctly.

// ******************************************************************* // Average.java // // Read three integers from the user and print their average // *******************************************************************

import java.util.Scanner; public class Average { public static void main(String[] args) { int val1, val2, val3; double average; Scanner scan = new Scanner(System.in) ;

// get three values from user System.out.println("Please enter three integers and " + "I will compute their average");

____________________________________

____________________________________

____________________________________

//compute the average

____________________________________

//print the average

____________________________________

} } 4. Given the declarations below, find the result of each expression.

int a = 3, b = 10, c = 7; double w = 12.9, y = 3.2;

a. a + b * c _______________

b. a - b – c _______________

c. a / b _______________

d. b / a _______________

e. a - b / c _______________

f. w / y _______________

g. y / w _______________

h. a + w / b _______________

i. a % b / y _______________

j. b % a _______________

k. w % y _______________

5. Carefully study the following program and find and correct all of the syntax errors.

// File: Errors.java // Purpose: A program with lots of syntax errors // Correct all of the errors (STUDY the program carefully!!)

#import java.util.Scanner;

public class errors { public static void main (String[] args) { String Name; / Name of the user int number; int numSq; Scanner scan = new Scanner(System.in);

System.out.print ("Enter your name, please: ") Name = scan.nextInt();

System.out.print ("What is your favorite number?); number = scan.nextInt();

numSq = number * number;

System.out.println (Name ", the square of your number is " numSquared);

}

6. Trace the execution of the following program assuming the input stream contains the numbers 10, 3, and 14.3. Use a table that shows the value of each variable at each step. Also show the output (exactly as it would be printed).

// FILE: Trace.java // PURPOSE: An exercise in tracing a program and understanding // assignment statements and expressions.

import java.util.Scanner;

public class Trace { public static void main (String[] args) { int one, two, three; double what; Scanner scan = new Scanner(System.in);

System.out.print ("Enter two integers: "); one = scan.nextInt(); two = scan.nextInt();

System.out.print("Enter a floating point number: "); what = scan.nextDouble();

three = 4 * one + 5 * two; two = 2 * one; System.out.println ("one " + two + ":" + three);

one = 46 / 5 * 2 + 19 % 4; three = one + two; what = (what + 2.5) / 2; System.out.println (what + " is what!"); } }

Similar Documents

Premium Essay

Shakespear

...A Shakespearean Tragedy Romeo and Juliet by William Shakespeare is an all time favorite by many people in the world, it is and timeless classic tragedy for over four hundred years. It contains the six tragic elements, such as a tragic hero with a tragic flaw, external and internal conflicts; last but not least, it contains revenge. These elements are what make “Romeo and Juliet” a true Shakespearean tragedy. A tragic hero with a tragic flaw is a noble figure and a leader whose death or downfall affects the plot of the story. In Romeo and Juliet, Romeo is the tragic hero with a tragic flaw. Romeo Montague’s flaw is that he falls in love to swiftly. For example, he’s in love with Rosaline, but she does not love him back. He attends the Capulet’s mask party, and falls in love at first sight of Juliet. Romeo say’s to himself “or I ne’er saw true beauty” (Act 1, scene 5) and wants to marry her immediately. Another flaw that Romeo acquires is that he reacts too quickly. In many of the acts, you will always see him reacting to something so soon. If Romeo was not included in this play, it would take away the universal theme, which is the message that occurs. Moreover, it would take away the suspense; the uncertain events and chance happenings in this classic tragedy. An internal conflict is within a character and him or her. In act 2, scene 2 where Romeo states ”shall I hear more, or shall I speak at this?” he is contemplating if he should just listen to Juliet’s thoughts about him...

Words: 566 - Pages: 3

Free Essay

Shakespear

...Shakespeare We do not know much about Shakespeare’s life. He is from the little province town of Stratford on The Avon. The father was a tradesman and a member of the city council: for tree years he was also the mayor. Shakespeare has probably gone to Stratford Grammar School, which can still be seen in the city, but we do not know much about what he learned in school. In 1582 when he was 18 years of age he married Ann Hathaway, who was 7-8 years older: she was the oldest daughter of a wealthy agriculturalist. Their first child was born the year after, only six months after their wedding; later they also had twins. There are several explanations of why Shakespeare traveled to London, but most explanations are anecdotes from a later time. Some scholars think that he became a member of a theatre company, which was visiting Stratford. The first time we hear about him again is in 1592 and at this point he is a known public figure in London. He is mostly known as an actor and a playwright but he was also the owner of the Globe Theater. Shakespeare wrote 37 plays: comedies, tragedies and historical dramas. His plays have something for every taste; there is exciting action, strong emotions, color and comedy. Shakespeare’s themes are love, nature, power and its responsibility. The central theme is man, and especially after year 1600 one feels the bitterness against mankind. About 1611 he returns to Stratford, maybe same year as he wrote the Storm, which can...

Words: 310 - Pages: 2

Free Essay

Shakespear

...function Begin($action, $method='post', $name='', $id='', $style='', $class='') The parameters all have preset default values except for the first one ($action). Some of these parameters are empty and therefore generally unused. Actually, you don’t even have to list these optional parameters in the method call if you don’t want to; they are optional in the sense that they have preset values. In this case, you must provide the $action parameter, because it does not have a preset value. It is always good practice to have the required elements at the beginning of the parameter list. In fact, PHP won’t work very well (if at all) if the required elements are not at the front of the list. If you find your parameter lists getting too long, consider using an array or two to send them over. When looking at the generated HTML tag in the web page’s HTML, it looks like this: , so, at the very least, we will always have the required action parameter and a POST method on our tags. Public, Protected, and Private Just as you can set scope in procedural PHP, you can also set it in the OOP aspect of PHP. You can identify your properties and your methods as either public, protected, or private. An entity with public scope is open to use and access outside the class definition itself. An entity with protected scope is only accessible within the class in which it is defined and its parent or inherited classes. Finally, an entity with private scope is only accessible within the...

Words: 460 - Pages: 2

Premium Essay

Shakespear

...6/14/14 05 A Midsummer Night's Dream. Love can be known to be crazy and complicated. love has many different aspects to it and it can be understood to be magical and a beautiful thing, as well as vise versa. love is known to have many powers and Shakespeare is very interested in both magic itself and love. These two things in A Midsummer Night's Dream are greatly connected. This is why I think that the magical and surreal world Shakespeare creates in his play, reflects the almost supernatural power of love. The things that he creates within his text to embody this are the love potion, the "dreams", the double worlds, and the forests. the love potion and magic itself that are woven within the play makes some characters feel love drunk, confused, or under the influence. the first example of this is when Demetrius thinks he's in love with Helena while under the potions powers, when you can tell from the beginning of the play he really is not. "O Helena, goddess, nymph, perfect, divine! To what my love shall I compare thine eyne." (3.2.137-138) This piece of text evidence shows exactly the powers of this plant. The potion on Demetrius makes him think that he is in love with Helena, but he doesn't realize that he is under the influence of this potion, leaving him confused and not sure of his real feelings for Hermia. Another thing that involves the love potion and reflects the actions of being drunk is when Oberon orders puck to put the love potion onto Tatania's...

Words: 1330 - Pages: 6

Premium Essay

Shakespear

...Shakespeare’s sonnet 18- Shall I compare thee to a summer’s day Shakespeare’s use of diction, design, form and tone affect the manner in which the reader and the hearer perceive the poem and understand the argument put forward by the poet which states that comparing his beloved’s beauty to a summer’s day is not a correct comparison. Shakespeare’s choice of words and imagery provides the reader with extensive ground to diverge between two genres of poetry. It is unclear whether sonnet 18 is a love poem or it is in fact a poem about poetry, the poem is expansive in its meaning. The sonnet is structured in an argumentative form whereby the first quatrain introduces and idea, the second quatrain discusses the idea and the final quatrain expresses the poet’s views on what true beauty entails. The use of punctuation in the poem affects how the argument moves form one quatrain to the other. The tone of the poem shifts as the argument progresses. Sonnet 18 is extensive in its meaning; it may be easy to conclude that the poem is the poet’s declaration of love to his beloved. But it could also be argued that the poet’s intention for writing the sonnet may be to express that his poem will live on as long as men have eyes to see it. If the poem is defined as a love poem then the intended effect of the poem to the hearer would be to emphasize that...

Words: 1179 - Pages: 5

Premium Essay

Shakespear

...Shakespeare in Love is a fictional story about the writing of William Shakespeare's Romeo and Juliet. Shakespeare, played by Joseph Fiennes, is in the middle of what could be a disastrous writer's block. His idea for the play, which should be completed, is a pirate comedy entitled Romeo and Ethel, the Pirate's Daughter. But Will is stuck, his shrink asks him how long it has been since he has been with a woman and advises him that that is what he needs. Auditions are held since the players' troup is out on tour. All the not so actors are pitiful. Except for Thomas Kent, the alias given by Viola, played by Gwyneth Paltrow. Women at this time are not allowed on stage in public. After Shakespeare shows interest, this character runs away to her estate where a party is being held. He follows Thomas into this party to later find love at first sight in Viola. Thomas once again shows up to receive her part in the play as Romeo. While Will and Thomas are talking, Shakespeare pours his heart out, telling about this wonderfully beautiful woman, Thomas's cousin. Somehow, they end up kissing. Now that Will has this woman, his writers block is cured, he goes on to write Romeo and Juliet through his true-life actions in his affair with Viola. At the end of the movie they put on the play through all the hardships, in the company of Queen Elizabeth. I greatly enjoyed this movie, even though it is not a typical movie of my preference. The truth is that I would have never...

Words: 430 - Pages: 2

Premium Essay

William Shakespear

...William Shakespeare: Love and Tragedy The Elizabethan era (1500-1600) was a great age fro poets, artists, and writers to become illustrious around the country and be fortunate enough to entertain Queen Elizabeth. A man from a family of farmers and glove makers didn’t know that his entertain plays for Elizabeth I would one day become a masterpiece in English literature. It was in the 1500 when the Renaissance was in its initiation. The entire world was going through this moment where the rebirth of cultural ideas such as the study of literature and ancient values brought interest to the people living in this era. William Shakespeare became one of the most respected playwrights for his famous plays such as Romeo and Juliet and Macbeth among other respected and famous works. (www.britannica.com/ebc/article-9376718, www.britannica.com/shakespeare) Born the 23rd of April 1564 in Stratford-upon-Avon, England, Shakespeare has captivated reader’s hearts by his romantic, humerous, and historic plays. During the 1500s, the Renaissance was a massive curiosity for everyone. Renaissance era was a period where everyone was interested in the affairs of the Greek and Roman cultures and when William Shakespeare was born. Being the middle brother of the Shakespeare’s, William son of John Shakespeare and Mary Arden was interested in writing since he was a child. Baptized in the Holy Trinity Church, William was raised in a family of seven children in the town of...

Words: 2013 - Pages: 9

Premium Essay

William Shakespear

...William Shakespeare was great English playwright, dramatist and poet who lived during the late sixteenth and early seventeenth centuries. Shakespeare is considered to be the greatest playwright of all time. No other writer’s plays have been produced so many times or read so widely in so many countries as his. William Shakespeare was born in Stratford in 1564. He was one of eight children. When William Shakespeare was about seven years old, he probably began attending the Stratford Grammar School with other boys of his social class. Students went to school year round attending school for nine hours a day. The teachers were strict disciplinarians. Stratford was an exciting place to live. Stratford also had fields and woods surrounding it giving William the opportunity to hunt and trap small game. The River Avon, which ran through die town, endowed him the title the Bard of Avon. Shakespeare’s poems and plays show love for nature and rural life which reflects his childhood. In London, Shakespeare’s career took off. It is believed that he may have become well I known in London theatrical life by 1592. By that time, he had joined one of die city’s repertory theatre companies. These companies were made up of a permanent cast of actors who presented different plays week after week. The companies were commercial organisations that depended on admission from their audience. Scholars know that Shakespeare belonged to one of the most popular acting companies in London called...

Words: 510 - Pages: 3

Free Essay

William Shakespear

...One of William Shakespeare’s great advantages as a writer was that, as a dramatist working in the public theater, he was afforded a degree of autonomy from the cultural dominance of the court, his age’s most powerful institution. All over Europe, even if belatedly in England, the courts of the Renaissance nation-states conducted an intense campaign to use the arts to further their power. The theater, despite its partial dependency on court favor, achieved through its material products (the script and the performance) a relative autonomy in comparison with the central court arts of poetry, prose fiction, and the propagandistic masque. When Shakespeare briefly turned to Ovidian romance in the 1590’s and, belatedly, probably also in the 1590’s, to the fashion for sonnets, he moved closer to the cultural and literary dominance of the court’s taste—to the fashionable modes of Ovid, Petrarch, and Neoplatonism—and to the need for patronage. Although the power of the sonnets goes far beyond their sociocultural roots, Shakespeare nevertheless adopts the culturally inferior role of the petitioner for favor, and there is an undercurrent of social and economic powerlessness in the sonnets, especially when a rival poet seems likely to supplant the poet. In short, Shakespeare’s nondramatic poems grow out of and articulate the strains of the 1590’s, when, like many ambitious writers and intellectuals on the fringe of the court, Shakespeare clearly needed to find a language in which to speak—and...

Words: 4547 - Pages: 19

Premium Essay

Villians of Shakespear

...n many stories there is a hero and a villain. There are also some stories where one person is both the hero and the villain. In the story of Hamlet there are multiple villains and no heroes. Everybody has a fault that leads to something tragic or dramatic during the story the main villain in this story is Hamlet, Prince of Denmark. In Shakespeare’s play The Tragedy of Hamlet, Prince of Denmark the main character Hamlet goes through a series of very unfortunate events throughout his life, and mostly negative things come out of them. During the beginning of the play we find out that Hamlet loses his father the King of Denmark. This causes a great depression to Hamlet. Soon after Hamlet becomes even more upset due to the fact that he finds out that his uncle Claudius will be marrying his mother Gertrude and be the new King of Denmark. This causes Hamlet to go crazy, insane, and mad. Over the course of the play Hamlets madness continues to build due to everything that happens between the beginning and the end. At the end Hamlet has gone completely and incredibly mad. This madness ends up breaking out of him and spread throughout the ending scene of the play. The main reason for Hamlets madness is due to his father passing away and him having to deal with his uncle Claudius. He soon finds out that his uncle will be marrying his mother. These events only get him upset, sad, and gloomy. Later in the story one of his friends and the guards of Elsinore confront a mysterious creature...

Words: 1136 - Pages: 5

Free Essay

The Value of Shakespear Today

...The Value of Shakespeare Today What makes Shakespeare stand out from other playwrights of his era is his deep understanding of human nature and the human condition, the timelessness of his works, and hi exquisite mastery of the English language. The Renaissance (during which he wrote) was a particularly transformative time in English history, initiating a sense of English nationalism and pride in English as a language of art. Some critics continue to challenge his authenticity and relevance making the future of Shakespeare within the curriculum of both secondary school and higher education at stake. Shakespearean Literature still speaks to modernity and is therefore important in the schools. Humanism, mastery of the English language, English nationalism, and pride in English Language as an art is brought forth in works such as, As You Like It, King Henry V, and The Tragical History of Hamlet Prince of Denmark. Students need to learn these works in order to have a broadened understanding of the English Language, culture, and history. William Shakespeare has provided the world with guidelines to the English Language, an understanding of human nature, and the ability to deal with a wide variety of emotional situations through his performative literature. Students will continue to benefit from his works of art for centuries to come. Therefore, a 446-year-old playwright is our children’s best resource and greatest teacher. During the Renaissance, the English Language was undergoing...

Words: 1515 - Pages: 7

Free Essay

"You All Know" by William Shakespear

...As You Like It will be for many of you a rather difficult play to appreciate and interpret simply on the basis of a reading. The reasons for this are not difficult to ascertain. The play is, as I have observed, a pastoral comedy, that is, a comedy which involves a traditional literary style of moving sophisticated urban courtiers out into the countryside, where they have to deal with life in a very different manner from that of the aristocratic court. This play, like others in the Pastoral tradition, freely departs from naturalism, and in As You Like It (certainly by comparison with the History plays) there is little attempt to maintain any consistently naturalistic style. This can create problems for readers unfamiliar with the conventions of pastoral, especially those who find it just too artificial and incredible to grasp imaginatively. After all, how are we to understand the unmotivated family hatreds which launch the action? We are simply not given any sufficiently detailed look at why Oliver hates Orlando (he himself does not understand the reason) or why Duke Frederick hates Duke Senior and turns on Rosalind so suddenly or, what is most surprising of all, why the nasty people whose animosities have given rise to the plot so suddenly and so conveniently convert and become nice people just in time to wind the plot up happily under the supervision of the goddess Hymen, the Greek deity of marriage, who arrives as an unexpected but welcome guest. But these...

Words: 922 - Pages: 4

Free Essay

Shakespear Act1 Scene 3 Analysis

...Reread Act 1 Scene 3. How does Shakespeare make this such a dramatic and significant moment in the play? Support your answer by close reference to Shakespeare’s writing At the start of Act 1 Scene 3, we understand that Don John is a very sad, discontent and evil man. From previous scenes, we have already learnt that Don John is not a man of many words. In this scene, Shakespeare further develops Don John as a character allowing us to learn more about him and we learn that Don John will wreak havoc on Don Pedro and Claudio making this a dramatic scene. Also, important themes are introduces in this scene making it significant. In the scene, the melancholy of Don John is noted by Conrad who says, "why are you thus out of measure sad?". Sadness, a recurring theme in the book is represented by Don John. This makes this scene significant as a important theme sadness is introduced. Further into the scene, we learn that there is no real motive for the evil Don John commits and is due to his bad nature something he willingly admits, “though I cannot be said to be a flattering honest man, it must not be denied but I am a plain-dealing villain” Yet, Don John being Don Pedro’s bastard brother serves as a reason for his evil nature as he has a much lower social status then his brother and has no chance of rising in society due to his “bastard” status. Although Don John has just became reconciled with Don Pedro it is obvious that he does not acknowledge it at all. Even after Conrad’s...

Words: 597 - Pages: 3

Premium Essay

How Do Shakespear and Miller Present Human Weakness in Their Protagonists?

...Throughout Scene 1-4 Macbeth is portrayed as a heroic and valiant man, however with sly and manipulative characteristics brought out by the Witches. The use of structure and language allows Shakespeare to present both Macbeths flaws and weaknesses to the audience. The arrangement of the meeting place for the witches, in act 1 upon hill in dark and destructive weather, symbolises the witches as a representation for temptation, foreshadowing Macbeth’s potential human weakness to be susceptible to temptation, before we are even introduced to Macbeth himself. Shakespeare presents Macbeths character as brave and fearless in Scene 2; without Macbeth being present. “Till he unseamed him from the nave to th’chaps and fixed his head upon our battlements”, this quotation is said by the captain, who is commending Macbeth for defeating the leader of the rebel army. We can see from this, how Macbeth posesses a merciless attitude and has no problem boasting his achievements in such a crude manner. The use of vivid imagery depicts Macbeth’s bravery in slaughtering the enemy, despite the brutality of the death. The gratitude proclaimed by the Captain also highlights Macbeth’s loyalty and devotion to the King, placing Macbeth on a pedestal to highlight Macbeth’s vast downfall later on in the play. In addition to this the Captain uses a simile, “Like Valour’s minion carved out his passage till he faced the slave”. Again, this depicts Macbeth as a courageous hero who used his ruthless bravery...

Words: 613 - Pages: 3

Free Essay

Opening Scene of as You Like It

...the play,as you like it,written by shakespeare during the Elizabethan age,belongs to the literary tradition known as Pastoral which typically involves exits from urban or court life to the world of nature. In the opening scene of this play,we are firstly exposed to the main hero,Orlando who is describing his plight to the servant,Adam. This whole scene deals with the theme of primogeniture that corrupts the brotherly love. Hence,this particular part of the play is important for us as readers to understand to what extent who is loyal and who is not as we are provided with a clear insight on the Elizabethan society during Shakespear’s time. Therefore,it is also crucial to note that shakespeare uses dramatic techniques such as the themes of usurpation and jealousy,the main characters,Orlando and Oliver,pastoral setting of the play and the language in order to mark the significance of this opening scene. in the opening scene,orlando introduces one of the play’s important themes : primogeniture,a policy whereby the eldest son inherits everything. Orlando, being the youngest brother in his family, faces the problem that he has received a meager inheritance as a result of this rule. ‘’..it was upon this fashion bequeathed me by will but a poor….and there begins my sadness.’’ Hence we see that the system of hierarchy was not a fair system as where the elder brother usurps everything for himself. Yet,a stronger aspect that takes over is jealousy. ‘’..for my part he keeps me rustically...

Words: 1128 - Pages: 5