#
# Author    :   Patrice Koehl
# Student ID:   None!
# Date      :   11/19/13
#
#
# Problem 1
# ----------
#
#  We start with the string: GENE1="ATGTTGATGTG"
#
GENE1="ATGTTGATGTG"
#
# GENE2: Last two letters of GENE1
#
nlength=len(GENE1)
GENE2=GENE1[nlength-2:]
#
# GENE3: First two letters of GENE1
#
GENE3=GENE1[0:2]
#
# GENE4: Letters at position 2,4,6,8,10 of GENE1
#
GENE4=GENE1[1:10:2]
#
# GENE5: First 3 and last 3 letters of GENE1
#
string1=GENE1[0:3]
string2=GENE1[nlength-3:]
GENE5=string1+string2
#
# Now print all strings:
#
print "\n"
print "GENE1 : ",GENE1
print "GENE2 : ",GENE2
print "GENE3 : ",GENE3
print "GENE4 : ",GENE4
print "GENE5 : ",GENE5
print "\n"
#
# Problem 2
# ----------
#
# Enter the string that will be scrambled
#
string=raw_input("Enter the string to scramble -> ")
#
# Enter the scrambling key:
#
key=int(raw_input("Enter the scrambling key     -> "))
#
# Length of the string
#
nlength=len(string)
#
# Scrambling at the beginning of the string:
#
# We break down the string into 2 parts:
# Part 1: the first "key" characters
# Part 2: the remaining characters
#
string1=string[:key]
string2=string[key:]
#
# Reverse string1:
#
string3=string1[::-1]
#
# Now reconstitute full string
#
string=string3+string2
#
# Scrambling at the end of the string:
#
# We break down the string into 2 parts:
# Part1: from the start to nlength-key
# Part2: from nlength-key to the end
#
string1=string[:nlength-key]
string2=string[nlength-key:]
#
# Reverse string2
#
string3=string2[::-1]
#
# Now reconstitute the full string
#
string=string1+string3
#
# print final string
#
print "\n"
print "The scrambled string is :",string
print "\n"
#
# Problem 3
#
# First enter the total change to be given; we will assume that this number
# is between 0 and 99
#
change=int(raw_input("Enter change to be given -> "))
#
# Compute number of quarters
#
nquarter = change/25
#
# Computer number of dimes
#
change=change-25*nquarter
ndime = change/10
#
# Compute number of nickels
#
change=change - 10*ndime
#
nnickel = change/5
#
# Finally get numbers of pennies
#
npennies = change -5*nnickel
#
# print results
#
print "\n"
print "Change :"
print nquarter," quarters"
print ndime," dimes"
print nnickel," nickels"
print npennies," npennies"
print "\n"
