1/11
This set of flashcards covers key concepts and coding practices discussed in CS 170 lecture notes, specifically focusing on algorithms, JavaScript syntax, and functions.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What is an algorithm in computer science?
A systematic method for producing a specified result.
What does a flowchart represent in programming?
A visual representation of the steps in a process or algorithm.
How to declare a variable correctly in JavaScript?
Remove illegal characters and ensure the variable starts with a letter or underscore.
What is the JavaScript syntax for checking if a variable 'age' is greater than 21?
if (age > 21) { alert('Access Granted!'); }
What will Math.round(2.73) return?
It will return 3.
What is the result of evaluating: (b == 15 && d > 15) || (c != 23) with b=3, d=15, c=23?
The result is false.
What is the formula to convert Kelvin to Fahrenheit in JavaScript?
F = K * 9/5 - 459.67.
How do you access the first element in an array declared as var cars = new Array(9);?
You can access it with cars[0].
What is the purpose of the function largeNums in JavaScript?
To return the count of numbers greater than 50 in an array.
What should be the order of execution for calculating and alerting shipping charges, sales tax, and total cost?
K O L N M J.
What error occurs when using a percentage in tax calculations like 8% in JavaScript?
It cannot be used as part of a calculation without defining it correctly.
How does the function findCharacter determine if a character is found in a string?
It checks each character in the string and returns 'Character found' if a match is found.