Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

Code HS Final Test Review (2022/2023) Rated A+

Rating
-
Sold
-
Pages
7
Grade
A+
Uploaded on
10-03-2023
Written in
2022/2023

Code HS Final Test Review (2022/2023) Rated A+ For Loop for(var i = 0; i COUNT; i++){ } While Loop while(boolean expression){ /* Repeat code betweeen brackets while * 'boolean expression' is true */ } If Statement if(BOOLEAN_EXPRESSION){ // code to execute if true } If/Else if(BOOLEAN_EXPRESSION){ // code if true } else { // code if false } Functions / Functions can take in values, called parameters. // The function below takes in a parameter called // 'input' and prints it. function printText(input) { println(input); } Functions using return function addTwo(number) { return number + 2; } Returns the width of the canvas getWidth(); Returns the height of the canvas getHeight(); Returns the x coordinate of the center of the canvas getWidth() / 2; Removes all objects from the canvas removeAll(); Create a Circle var circle = new Circle(radius); Position(x, y); Color(color); Create a rectangle var rect = new Rectangle(width, height); Position(x, y); Color(color); Get radius of a circle Radius(); Change the radius of a circle Radius(radius); Get the position of the center of the circle var x = X(); var y = Y(); Add objects to your screen add(obj); Get location of the upper left corner of the rectangle var x = X(); var y = Y(); Create an Arc var myArc = new Arc(radius, start, end, unit); More specifically, the parameters are: 1. radius of the arc 2. starting angle of the arc 3. ending angle of the arc 4. angle unit (0 for degrees, 1 for radians) Create a line To draw a line from (x1, y1) to (x2, y2) var line = new Line(x1, y1, x2, y2); Set the line color to green Color(C); Set the line width to 10 pixels LineWidth(10); Create an oval var oval = new Oval(width, height); Position(x, y); Color(color) Create a graphical text object var txt = new Text(label, font); Position(x, y); Color(C); Comparison Operators x == y // is x equal to y x != y // is x not equal to y x y // is x greater than y x = y // is x greater than or equal to y x y // is x less than y x = y // is x less than or equal to y Math Operators + Addition - Subtraction * Multiplication / Division % Modulus (Remainder) () Parentheses (For order of operations) Random Numbers RInt(low, high); RBoolean(); RFloat(low, high); RColor(); Read a string var str = readLine(prompt); Read an integer var num = readInt(prompt); Read a float var cost = readFloat(prompt); Read a boolean var bool = readBoolean(prompt); Declare a variable var myVarName; Initialize a variable var myVarName = 5; Assign to an existing variable myVarName = 10; Increment (add one) x++ Decrement (subtract one) x--

Show more Read less
Institution
Code HS
Course
Code HS









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Code HS
Course
Code HS

Document information

Uploaded on
March 10, 2023
Number of pages
7
Written in
2022/2023
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$10.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF


Also available in package deal

Thumbnail
Package deal
Code HS Bundled Exams Questions and Answers (2022/2023) (Passed with 100%)
-
2 18 2023
$ 25.99 More info

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
BrilliantScores Chamberlain College Of Nursng
View profile
Follow You need to be logged in order to follow users or courses
Sold
2898
Member since
4 year
Number of followers
2238
Documents
16205
Last sold
4 days ago
latest updated documents, correct, verified & graded A study materials

get bundles, documents, test banks, case studies, shadow health's, ATIs, HESIs, study guides, summary, assignments & every kind of study materials.

3.8

784 reviews

5
392
4
120
3
118
2
38
1
116

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions