Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAyaz Sadiq
Courses Plus Student 5,361 PointsCan someone please help me with the third objective please? When I clicked on the get help button nothing happened.
I'll write out my code for the objectives. var salesTotal = 9.99 * 47; var profit = 9.99 * 47 - 5.45 * 47; var profitPerUnit = 9.99 * 47 - 5.45 * 47 / 47; I used the / for division, but the computer thinks that I'm not.
var wholesalePrice = 5.45;
var retailPrice = 9.99;
var quantity = 47;
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JavaScript Basics</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>
5 Answers
Ayaz Sadiq
Courses Plus Student 5,361 PointsTim I added the parenthesis and a bummer message popped up. I was able to figure it out though. I typed var profitPerUnit = profit / quantity;
Ayaz Sadiq
Courses Plus Student 5,361 PointsThank you. I'm apprehensive when it comes to learning how to code because it's really hard for me. I want to do the Tech Degree certificate, but I don't know if I can. I answered the questions at the beginning of the page, and based on my responses Treehouse recommended I do the Full Stack Java Script Tech Degree.
Tim Renner
11,163 PointsAyaz, you are well along the way. It's hard for everybody. No matter what you already know there is more. Keep trying and don't be shy about asking for help! I've looked at many training materials and Treehouse is very well designed because each video just covers a few new things and then the quizzes and challenges require you to demonstrate them. So make sure you feel solid at every step before moving on. Keep calm and carry on!
Tim Renner
11,163 PointsUse parenthesis when you want to divide after performing the inside subtraction. Like this: var profitPerUnit = (9.99 * 47 - 5.45 * 47) / 47
.
Ayaz Sadiq
Courses Plus Student 5,361 PointsThank you Tim.
Tim Renner
11,163 PointsAyaz, Good job. You are really taking advantage of the language by expressing the profit per unit in the variables that were already defined! That is definitely the point of this exercise. Understanding the order of operations is more of a background task.
Keep up the good work, Tim