tynation.com

Monday, April 25, 2011

IT104

So today in Intro to Programming we had a test. I was the first one done. They also handed out awards for honors and perfect attendance. I got one for highest honors and perfect attendance. Anyway here's the code that I wrote for the test today:


               #Program Start
secA = 15          #Variables Start
secB = 12          #Tyler Cooper
secC = 9          #4-25-11
seatedA = 0
seatedB = 0
seatedC = 0
profitsA = 0
profitsB = 0
profitsC = 0
totalProfits = 0
profitGoal = 3000          #Variables End
print "How many seats were sold in section A?"     #Input Start
seatedA = input()
print "How many seats were sold in section B?"
seatedB = input()
print "How many seats were sold in section C?"
seatedC = input()          #Input End
profitsA = secA * seatedA     #Processing Start
profitsB = secB * seatedB
profitsC = secC * seatedC
totalProfits = profitsA + profitsB + profitsC     #Processing End
print "Todays sales profits were $", totalProfits     #Output Start
if (totalProfits >= profitGoal):
     print "Sales profit exceeds goal of $3000"
else:
     print "Sales profit below goal of $3000"          #Output End
               #Program End


Notes


Loops: 2 Types

Determinant

Loop where you know the exact number of repitions.

Indeterminate

Loop where you dont know how many times code will loop


Determinate loop: usually called for loop

for x in range(1, 10):

numbers in parenthensis are called arguments

x controls how many times the code loops

this for loop will start at 1 and go to 9


x = 0
for x in range(1,10):
     print x

this will print 1 through 10

counter = 0
endcount = 0
print "Enter a number for code to repeat:"
endcount = input() + 1
for counter in range (1, endcount):
     print counter

When dealing with user input for loops add 1 to their input so they get the actual amount they need

counter = 0
endcount = 0
tgrades = 0
newgrade = 0
average = 0
print "Enter number of grades"
endcount = input()
for counter in range (1, endcount + 1):
     print "Enter a grade"
     newgrade = input()
     tgrades = tgrades + newgrade
average = tgrades / endcount
print "Your average is", average

tgrade is a cumulative total.
you can use this code to find the average of all the values put in witout a lot of variables

counter = 0
for counter in range (0, 26, 5,):
     print counter

will print 0, 5, 10, 15, 20, 25

counter = 0
for counter in range (50, 4, -5):
     print counter

will print 50, 45, 40, 35, 30, 25, 20, 15, 10, 5
Lab Code:

bugTotal = 0               #Tyler Cooper
counter = 0               #Variables
day = 0
for counter in range (1, 8):
     day = day + 1
     print "How many bugs did you collect on day", day
     bugTotal = bugTotal + input()          #Bug total is cumulative
print "over", day, "days you collected", bugTotal, "bugs"

Homework Code:

calories = 3.9          #Tyler Cooper
counter = 10          #Calories Burned!
calBurn = 0%nbsp;          #Variables End
for counter in range (10, 31, 5):%nbsp;%nbsp;%nbsp;%nbsp;%nbsp;%nbsp;%nbsp;%nbsp;#for loop
     calBurn = counter * calories
     print "You burn", calBurn, "calories in", counter, "minutes"

Other News


I was contacted by a new potential employer today. I'm thinking this may be the one to hire me. The company is Rooftop Digital Imaging.

Tuesday, April 19, 2011

Rest of the Guru web page Instructions

Due:Unit 4 Part 4:

Modify your pages so that they comply with various standards.

Tasks:

  1. Add an HTML 4.01 transitional DOCTYPE to each page in the project. Validate the pages and fix any errors or warnings.
  2. Convert the DOCTYPE on each page to strict HTML 4.01 and validate. Fix any errors or warnings.
  3. Convert the home page DOCTYPE to XHTML 1.0 and validate. Fix any errors or warnings. TIP: The content of a element in strict XHTML must be enclosed in block elements.
  4. Prepare a short document describing whether or not there are advantages to converting the remaining pages to XHTML. Justify your decision.
  5. Submit the document and a copy of your current project pages.

Due: Unit 5 Part 5:

Create and link a CSS style sheet.

Tasks:

  1. Each team member should create an external style sheet that defines the font style and colors for the site. Define a class named topten and apply it to the heading for your top 10 list. Apply the style sheet to your TopTen.html page.
  2. Team members should review each style sheet and select one to apply to the home page.

Due: Unit 6 Part 6:

Create a style that defines a box.

Tasks:

  1. As a group, decide how best to add impact to your home page through the use of font characteristics and boxes. Guru quotes, at minimum, should be enclosed in boxes. Create a style sheet and link the style sheet that applies the formatting to the home page.
  2. Modify the style sheet you created in the last part of the project to include borders, margins, and padding for the img element.
  3. Prepare a Word document describing how style sheets would differ for print and mobile devices.

Due: Unit 7 Part 7:

Create a Game of the Week review page.

Tasks:

  1. Each guru should create a Game of the Week review page. The page should include a picture of the game, a paragraph reviewing the game, a list of great features, a list of things that can be improved, a hyperlink to your Top Ten page, and a hyperlink to the home page. Link the .css file you created to the page.
  2. Add a sidebar that shows your top five games for three different categories—you can select the categories. To the sidebar, apply a style that is distinct from that used on the rest of the page.
  3. Add a hyperlink to the home page for each Game of the Week review page.
  4. Gurus should add a hyperlink to their own TopTen.html page that links to the Game of the Week review page.

Due: Unit 8 Part 8:

Reformat the Game of the Week review page.

Tasks:

  1. Reformat each Game of the Week review page so that the features and list of things that can be improved are displayed as a table. Use the color of your choice for the table heading.
  2. Use the Microsoft Paint program to create a custom bullet. Reformat the Top 5 lists to use your graphic as custom bullets.

Due: Unit 9 Part 9:

Add a Game Review form.

Tasks:

  1. Your instructor will provide the server-side script named postreview.asp. Copy it to the C:\InetPub\Scripts folder on the virtual machine.
  2. Create a page in your folder that allows users to post their own review of a game. The page should include fields for the user’s name; the name of the game; the platform, selected from a menu; a rating between 1 and 5; and a descriptive review. The server-side script named postreview.asp expects the following field names, sent using a GET:
  • name
  • game
  • platform
  • rating
  • review

3. Copy your project to the virtual machine and test to ensure that it works correctly with the postreview.asp script. 4. Style the form using a table and CSS. Test to make sure the form looks the way you want it to look.

Due: Unit 10

Tuesday, April 12, 2011

CS110

So today we learned some CSS border tricks and how to use images. It's always nice to see things from a different perspective. Even though I know these subjects quite well it's given me some new insight.

Project time


Due: Unit 3 Part 3:

Add graphics to your Web site.

Tasks:

  1. Create a logo for your Web site. Add the logo to the default page of your site.

  2. Navigate the manufacturer’s Web site to locate at least three games in your top 10 list. Save the graphic showing the game to your images folder. Add the graphics to your TopTen.html page either above or below the list of games. Define alternate text. Set the height and the width so that all images are the same height.

if (IT104 == class)

In Intro to Programming we learned how to properly use if statements in python and how to compare various values against each other. This is fun stuff.

Also, I made the CSS to display the code as a uniform spaced text. Good times.

First code: Rewards determiner

books = 0
points = 0
print "How many books has the customer purchased this month?"
books = input()
if (books == 0):
    points = 0
if (books == 1):
    points = 5
if (books == 2):
    points = 15
if (books == 3):
    points = 30
if (books >= 4):
    points = 60
if (books < 0):
    print "There was an error: " print "You have", points, "award points."


Second code: Massiveness determiner

mass = 0
weight = 0
print "WHAT IS THE MASS OF YOUR OBJECT?"
mass = input()
weight = mass * 9.8
if (weight >= 1000):
    print "MASS IS TOO GREAT, FAILURE IMMENENT"
if (weight <= 10):
    print "MASS IS TOO SMALL, OVERCOMPENSATION ERROR"
if (weight < 1000 and weight > 10):
    print "MASS WITHIN ACCEPTABLE BOUNDS; PROCEED"


Third code: Hindu-Arabic Numerals to Roman Numeral Converter

num = 0
print "Enter number between 1 and 10"
num = input()
if (num == 1):
    print "I"
if (num == 2):
    print "II"
if (num == 3):
    print "III"
if (num == 4):
    print "IV"
if (num == 5):
    print "V"
if (num == 6):
    print "VI"
if (num == 7):
    print "VII"
if (num == 8):
    print "VIII"
if (num == 9):
    print "IX"
if (num == 10):
    print "X"
if (num <= 0 or num > 10):
    print "Invalid input"


Final Code: Rectangle Comparison

rectL1 = 0
rectW1 = 0
rectL2 = 0
rectW2 = 0
rectArea1 = 0
rectArea2 = 0

print "enter first rectangle length"
rectL1 = input()
print "enter first rectangle width"
rectW1 = input()
print "enter second rectangle length"
rectL2 = input()
print "enter second rectangle width"
rectW2 = input()
rectArea1 = rectL1 * rectW1
rectArea2 = rectL2 * rectW2
if (rectArea1 > rectArea2):
    print "First rectangle is bigger"
if (rectArea1 < rectArea2):
    print "Second rectangle is bigger"
if (rectArea1 == rectArea2):
    print "Rectangles are of equal size"

Tuesday, April 5, 2011

CS110 and IT104

IT104


So yesterday we finally jumped into Python. We wrote a few really simple codes. It was incredibly easy to pick up too. Partially thanks to the tutorials I've been watching.

I'll post some of the codes below. I'll add a style to make my code look like code later when I'm not in class

First Code:
print "Tyler Cooper"
print "514 Stalkerz Ave, Henderson, NV, 89015"
print "(702)555-1359"
print "My Major is Software Development Technology"

Next Code:
item1 = 0
item2 = 0
item3 = 0
item4 = 0
item5 = 0
subTotal = 0
tax = .06
taxAmount = 0
total = 0

print "Enter value of first item"
item1 = input()
print "Enter value of second item"
item2 = input()
print "Enter value of third item"
item3 = input()
print "Enter value of fourth item"
item4 = input()
print "Enter value of fifth item"
item5 = input()

subTotal = item1 + item2 + item3 + item4 + item5
taxAmount = subTotal * tax
total = taxAmount + subTotal

print "Your subtotal is $",subTotal
print "the tax rate is",tax * 100,"%"
print "Your sales tax is $",taxAmount
print "Your total is $",total

Final code:
time1 = 5
time2 = 8
time3 = 12
speed = 60
dist1 = 0
dist2 = 0
dist3 = 0

print "How far will speed racer go?"

dist1 = time1 * speed
dist2 = time2 * speed
dist3 = time3 * speed

print "In", time1, "hours he will travel", dist1, "miles."
print "In", time2, "hours he will travel", dist2, "miles."
print "In", time3, "hours he will travel", dist3, "miles."

CS110


Today we are learning how to use CSS. I'm already quite familiar with CSS, but I'm still learning new things to be aware of when using it.

Another Interview


I had another interview today. It was for a mostly 3d modeling position. I have to complete a test and then I'll know if I'm hired or not. Just the potential starting pay is enough to excite me. I'll be able to afford all the things I want (which is not a lot) and live like I want. So I must finish the test tomorrow in the best way I can. I hope this all goes well, it looks like it would be an excellent place to work.

-Ty