Assessment 3 notes.docx

3 Pages
Unlock Document

Information Sciences And Technology
IST 240
Sherry Corneal- Pennsylvania State University

• Console object has a series of functions that read and write data, most common are writeline and readline • There are “ + I + “ seconds in a year”; //works in javascript //works in c# too • String.Format() is used to format strings for display to the user. Takes an argument which is the string you want to write out along with data that you want to put into that string • {} Curly braces with an integer is a placeholder. Then increment the number • I is gonna be a sub • /* uses to comment out until certain lines. • If statement, if true, the code in the statement is executed. • Else case if it’s not true, but is OPTIONAL • One equal sign does assignment, 2 equal signs tests for equality • If the if statement is only one line, you don’t have to use curly braces but its better so its more readable • || - Or operator • && - means and • Can chain using if, else if and else. • Switch statement, bunch of if else’s statements but different ways of writing it. • Switch ( value) { Case value 1 • Also can have a default case. • Every case must have a break command at the end, Or ti will fail. • Expression – A collection of operators and operands that produce a result. • 5 + 2 * abs(x) • Operators – Symbols and functions that determine how expressions are evaluated. • % - remainder or modulus operator. – leftover result of a division problem • Assignment operator = • Can use distance += 10 • Equailty check operators – A==b , a!= b • Comparison testing operators : <= • Logical Operators allow you to combine more than one condition: and or || or not. If • Increment a++, that’s postfix , ++a that’s prefix • Decrement a--, --a • Type testing operators : is, returns true if a given object is a certain type • As : Converts a given object to another type(if possible) if can’t be done, it would turn null. • Ternary operators, it has three operands, and you use the question mark and the colon. Operates like a very compact if –else statement o (Condition) ? true : false o LowPrice = (price1 < price2) ? price1 : price
More Less

Related notes for IST 240

Log In


Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.