100 Days of Code Challenge Day 21

So.MUCH.TO.DO.SO.Little.TIME

Homework, pages and pages of readings.Videos to watch, Learning Bootstrap… The past 48 hours have been A LOT!

I finally sat down tonight to attempt the Free Code Camp Tribute Page project. I just sat and stared at the pen. I forgot how to use bootstrap! What!!! My brain just.STOPPED.

Java • HTML • CSS • JavaScript • Bootstrap • jQuery

As a new dev, I just felt the cacophony of a bunch of technologies that haven’t taken hold in my brain sat me down for a moment. I had to breathe, concentrate on the task and RTFM. After re-watching the FCC assignment video, reading up on the Bootstrap web site, watching a YouTube Video, it came together, bit by bit.  I did the site first in HTML then copied it to CodePen. I’m not done, but I got a lot of the elements down and I think I could finish it tomorrow.

I also read more in Java, took my 1st chapter quiz in the college CMS (20 out of 20).  What a day! I learned so much and it’s only the tip of the iceberg.

 

 

Advertisements

100 days of Code Challenge Day 9

Today I decided to face my fears with my Tip Calc app and take on the issue of input from a form element being a string and messing up just about everything. I just read in chapter 3 in Learning JavaScript that THIS IS NORMAL BEHAVIOR!

GIF of Jon Steward Mind being blown.

Mind Blown

Converting to Numbers

It’s very common to want to convert strings to numbers. When you collect input from a user, it’s usually as a string, even if you’re collecting a numeric value from them. JavaScript offers a couple of methods to convert strings to numbers.

So, here is a clear case of RTFM. All the googling in the past week didn’t drive this point home for me.

Anyway, there are 2 ways to turn those strings into numbers.

  1. Number Object Constructor
  2. parseInt or parseFloat functions

I chose the latter.  After adding the function to my variable creation, I was able to make the needed calculations on the number the user entered. No longer was the bill being concatenated into a string of numbers.  We now have math!!

Right before turning back to the JavaScript, I did more CSS work and picked a new color scheme and a few more presentation elements. It looks SOO much better.  I still haven’t figured out the split check part. I removed the text input for the number of ways to split the bill, instead I added a drop down to have the user select the number of ways to split the bill.  The problem now is, when I enter a string or leave it blank the if statement that checks what was entered doesn’t work on this page. After toying around, making sure the id reflected the element on this page, nothing worked.

I’m glad I got something figured out. I’ll turn back to Free Code Camp and make some progress there. I may even become inspired! Time to push the new changes to the site and GitHub.

screen print of tipcalc app