Detailed examples, explanations, and tips.
Includes input and output, variable conversions, for loops, generating random numbers, if statements, switch-case, pseudocode, trace tables, Math class, etc.
-
01 -
03
Variables Compare Strings
- Asking for Input - Generate a random number
- Conversions - For loops
- Showing Output
02 04
- Calculations - If/else statements
- Math Class - Switch case statements
- Rounding off to a - Pseudocode
specifi c decimal place - Trace Tables
, - .length() tells you how long the String is
Variables Eg. name.length()
- .charAt(0) gives us the first letter.
Eg. if the name = “Bob” (String)
name.charAt(0) would give u ‘B’
Object data types have certain
name.charAt(1) would give you ‘o’
methods that we can use eg. .length()
- these are char variables now so its ‘ ‘
and .charAt(0)
Primitive data types can’t use these
methods, but we can use Math. Primitive Data Types: Object Data Types:
- They are more limited int String
Note: String starts with a capital double
letter.
char
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller cailincristiesmith. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $5.65. You're not tied to anything after your purchase.