#Variable Declaration
i=4
j=i+7
c='A'
x=9.087
x=x*4.5
#Result
print i,c,j,x
#Result
print "C++ programming is fun!"
#Declaration
tax_rate=0.08
sale=22.54
#Calculation
tax=sale*tax_rate
#Result
print "The sales tax is :" ,tax
#Declaration
PI=3.14159
radius=5
#Calculation
area=radius*radius*PI
#Result
print "The area is ",area
radius=20
#Calculation
area=radius*radius*PI
#Result
print "The area is ",area
#Get input
#first=raw_input("Enter your first name:")
#last=raw_input("Enter your last name")
first="perry"
last="greg"
#Print the Initials
print "Your initials are ",first[0],last[0]
#Declaration
AGE=28
MESSAGE="Hello, world"
i=10
age=5
# 'AGE' is different from 'age'
i=i*AGE
#Result
print i," ",age," ",AGE,"\n"
print MESSAGE
#Result
print "Kelly Jane Peterson\n"
print "Apartment #217\n"
print "4323 East Skelly Drive\n"
print "New York, New York\n"
print " 10012\n"
source = "This is fun!"
#source is copied to message
import copy
message=copy.copy(source)
#Result
print message
MYNAME="Phil Ward"
name=MYNAME
#Result
print "My name is ",name,"\n"
print "My name is ",MYNAME,"\n"
#function definition
def X4(b,c,d):
return 2*b+c+3*b+c+b+c+4*b+c+b+c*c+b+c-d
b=2
c=3
d=4
e= X4 (b,c,d)
#Result
print e,",",b+c,",",b+c+b+c,",",b+c+b+c*c+b+c-d,",",X4(b,c,d)
#Declaration
first='E'
middle='W'
last='C'
age=32
dependents=2
salary=25000.00
bonus=575.25
#Result
print "Here are the initials: "
print first,middle,last
print "The age and number of dependents are "
print age," ",dependents
print "The salary and bonus are "
print salary," ",bonus
#table of team names and hits for three weeks
print "Parrots\tRams\tKings\tTitans\tChargers"
print "3\t5\t3\t1\t0"
print "2\t5\t1\t0\t1"
print "2\t6\t4\t3\t0"
# Computes and prints payroll data properly in dollars and cents.
emp_name="Larry Payton"
pay_date="03/09/92"
hours_worked=43
rate=7.75 #pay per hour
tax_rate=.32 #Tax percentage rate
#Compute the pay amount
gross_pay=hours_worked*rate
taxes=tax_rate*gross_pay
net_pay=gross_pay-taxes
#Results
print "As of: ",pay_date
print emp_name," worked ",hours_worked,"hours"
print "and got paid",round(gross_pay,2)
print "After taxes of: ",round(taxes,2)
print "his take-home pay was $",round(net_pay,2)
#getting total sale as float number.
#print "What is the total amount of the sale?"
#total_sale=float(raw_input())
total_sale=50
#Compute sales tax
stax=total_sale*0.07
#Results
print "The sales tax for",float(round(total_sale,2)),"is",round(stax,2)
#request user's name and print it as it would appeat in a phone book
#get name
#first=raw_input("What is your first name?\n")
#last=raw_input("What is your last name?\n")
first="perry"
last="greg"
print "\n\n"
print "In a phone book,your name would look like this :\n"
print last,",",first
#Simple Addition
print "*** Math Practice ***\n"
#num1=input("What is the first number:")
#num2=input("What is the second number:")
num1=10
num2=20
ans=num1+num2
#get user answer
#her_ans=input("\nWhat do you think is the answer?")
her_ans=30
#Result
print "\n",num1,"plus",num2,"is",ans,"\n\nHope you got it right!"
message="Please turn on your printer."
#Result
print message
#Declaration
first='E'
middle='W'
last='C'
age=32
dependents=2
salary=25000.00
bonus=575.25
#Result
print "Here are the initials: "
print first," ",middle," ",last,"\n"
print "The age and number of dependents are: "
print age," ",dependents,"\n"
print "The salary and bonus are: "
print "%.6f" %salary," ","%.6f" %bonus
#prompt for a sales amount and print sales tax
#getting total sale as float number
#print "What is the total amount of the sale?"
#total_sale=float(raw_input())
total_sale=10
#compute sales tax
stax=total_sale*0.07
#Result
print "The sales tax for",float(round(total_sale,3)),"is",round(stax,3)