CS256 – EXAM 1
1 Your current directory is /home. Create a new directory under todays date (nov11) and copy the file /home/nov7/answers.txt into the new directory you created.
(3 points)
2a 2 + 3 * 4 % (5 + 2 ) = 7
(3 points)
2b 165 mod 13 = 9
3 Write the output of the programs.
(6 points)
3a n = 90
while ( n >= 10):
if ( n % 20 == 0):
print n
n = n – 10
80 60 40 20
3b a = ‘Hi’
b = a * 3
c = b + ‘How are you?’
d = c [0:6]
print d
HiHiHI
4 Write the output of the Program
(3 points)
str1 = ‘thIs exAM is onLY for practicING’
str2 = ‘Aa’
for ch in str1:
if not ch.islower() and ch not in str2 and not ch.isspace() :
‘IMLYING’
print ch
5 Write down the final contents of the list. (Hint : A is less than a)
(3 points)
planets = [‘earth’,’mercury’,’Venus’,’Mars’]
planets. append ( ‘Jupiter’)
planets. sort ( )
del planets[0]
planets. reverse ( )
print planets
mercury, earth, Venus, Mars
6 Write a program to read in 3 test scores. Take the highest two scores and calculate average score.
OR
Print all the prime numbers between 0 to 100.
(6 points)
3 input statements
a = input(“Enter score 1”);
Write if else statements to get the biggest two.
Find the average.
Or you can put them in a list , sort it and take average from last two.
7 Write a Program to generate 10 random numbers between -100 and 100
OR
Write a program to read in date of birth and make sure it is in mm/dd/yyyy format.
import random
for i in range [0,11]:
i = random.randint(-100,101)
print i
DOB program
dob = raw_input(‘’);
length is 10
dob[2] and dob[5] is ‘’
dob[0:2] and dob [3:5] and dob[6:10] isdigit()
8 Write a Program to read in a file name. Open the file in read mode and count the number of characters, words and lines in the file.
(10 points)
9 Write a program using Visual Python module to:
> Assign a background color of your choice
> Create a ball at position (x , y , z)= ( -1, 1, 0) of radius = 0.5 and color of your choice.
> Create a Wall at position (x , y , z) = ( 3, 0, 0) of any size and color of your choice.
> Set the rate to 100 and make the ball to bounce off on the wall.
OR
Write a program to define a Point Class, which has 2 attributes x-coordinate and y- coordinate. In the main function create 2 points(Instances of points) at (1.0, 1.0) and (5.0,1.0) and calculate the distance between them. (dist = sqrt( (x2-x1)^2 + (y2-y1)^2)
(10 points)
10 Bonus Question ( 5 points)
I love playing with strings and numbers. Can you understand my message?
Harry 0-2 Heaven 3-4 Gravity 2 Winnie 3-4 Advice 4-5 Doctor 0
Eat 1 Yummy 4
PLACE THIS ORDER OR A SIMILAR ORDER WITH US TODAY AND GET AN AMAZING DISCOUNT 🙂
Compelling correspondence is essential to the achievement all things considered but since of the changing idea of the present working environments, successful correspondence turns out to be more troublesome, and because of the numerous impediments that will permit beneficiaries to acknowledge the plan of the sender It is restricted. Misguided judgments.In spite of the fact that correspondence inside the association is rarely completely open, numerous straightforward arrangements can be executed to advance the effect of these hindrances.
Concerning specific contextual analysis, two significant correspondence standards, correspondence channel determination and commotion are self-evident. This course presents the standards of correspondence, the act of general correspondence, and different speculations to all the more likely comprehend the correspondence exchanges experienced in regular daily existence. The standards and practices that you learn in this course give the premise to additionally learning and correspondence.
This course starts with an outline of the correspondence cycle, the method of reasoning and hypothesis. In resulting modules of the course, we will look at explicit use of relational connections in close to home and expert life. These incorporate relational correspondence, bunch correspondence and dynamic, authoritative correspondence in the work environment or relational correspondence. Rule of Business Communication In request to make correspondence viable, it is important to follow a few rules and standards. Seven of them are fundamental and applicable, and these are clear, finished, brief, obliging, right, thought to be, concrete. These standards are frequently called 7C for business correspondence. The subtleties of these correspondence standards are examined underneath: Politeness Principle: When conveying, we should build up a cordial relationship with every individual who sends data to us.
To be inviting and polite is indistinguishable, and politeness requires an insightful and amicable activity against others. Axioms are notable that gracious “pay of graciousness is the main thing to win everything”. Correspondence staff ought to consistently remember this. The accompanying standards may assist with improving courtesy:Preliminary considering correspondence with family All glad families have the mystery of progress. This achievement originates from a strong establishment of closeness and closeness. Indeed, through private correspondence these cozy family connections become all the more intently. Correspondence is the foundation of different affiliations, building solid partners of obedient devotion, improving family way of life, and assisting with accomplishing satisfaction (Gosche, p. 1). In any case, so as to keep up an amicable relationship, a few families experienced tumultuous encounters. Correspondence in the family is an intricate and alluring marvel. Correspondence between families isn’t restricted to single messages between families or verbal correspondence.
It is a unique cycle that oversees force, closeness and limits, cohesiveness and flexibility of route frameworks, and makes pictures, topics, stories, ceremonies, rules, jobs, making implications, making a feeling of family life An intelligent cycle that makes a model. This model has passed ages. Notwithstanding the view as a family and family automatic framework, one of the greatest exploration establishments in between family correspondence centers around a family correspondence model. Family correspondence model (FCP) hypothesis clarifies why families impart in their own specific manner dependent on one another ‘s psychological direction. Early FCP research established in media research is keen on how families handle broad communications data. Family correspondence was perceived as an exceptional scholastic exploration field by the National Communications Association in 1989. Family correspondence researchers were at first impacted by family research, social brain science, and relational hypothesis, before long built up the hypothesis and began research in a family framework zeroed in on a significant job. Until 2001, the primary issue of the Family Communication Research Journal, Family Communication Magazine, was given. Family correspondence is more than the field of correspondence analysts in the family. Examination on family correspondence is normally done by individuals in brain science, humanism, and family research, to give some examples models. However, as the popular family correspondence researcher Leslie Baxter stated, it is the focal point of this intelligent semantic creation measure making the grant of family correspondence special. In the field of in-home correspondence, correspondence is normally not founded on autonomous messages from one sender to one beneficiary, yet dependent on the dynamic interdependency of data shared among families It is conceptualized. The focal point of this methodology is on the shared trait of semantic development inside family frameworks. As such, producing doesn’t happen in vacuum, however it happens in a wide scope of ages and social exchange.
Standards are rules end up being followed when performing work to agree to a given objective. Hierarchical achievement relies significantly upon compelling correspondence. So as to successfully impart, it is important to follow a few standards and rules. Coming up next are rules to guarantee powerful correspondence: clearness: lucidity of data is a significant guideline of correspondence. For beneficiaries to know the message plainly, the messages ought to be sorted out in a basic language. To guarantee that beneficiaries can without much of a stretch comprehend the importance of the message, the sender needs to impart unmistakably and unhesitatingly so the beneficiary can plainly and unquestionably comprehend the data.>