New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

CSE 110 - 2nd set of Notes

by: RianMartins

CSE 110 - 2nd set of Notes CSE 110

GPA 4.0
Prin of Programming with Java Lecture
Justin Selgrad

Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Here is the second set of notes for the class. The material is a revised version of previous semesters, focused on what was taught in class. Content: - Constants and Comments - Common Error...
Prin of Programming with Java Lecture
Justin Selgrad
Class Notes
25 ?




Popular in Prin of Programming with Java Lecture

Popular in ComputerScienence

This 5 page Class Notes was uploaded by RianMartins on Thursday October 15, 2015. The Class Notes belongs to CSE 110 at Arizona State University taught by Justin Selgrad in Fall 2015. Since its upload, it has received 94 views. For similar materials see Prin of Programming with Java Lecture in ComputerScienence at Arizona State University.

Similar to CSE 110 at ASU

Popular in ComputerScienence


Reviews for CSE 110 - 2nd set of Notes


Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 10/15/15
CSE 110 PRINCIPLES OF PROGRAMMING IN JAVA WEEKLY NOTES 2 Constants and Comments Constant use the reserved keyword final final lttypegt ltvaiabenamegt ltvauegt final double CANVOLUME O 3555 Comment line comment use The following text are ignored block comment use All lines between the and are ignored Common Errors Undeclared Variables You must declare a variable before you use it ie above in the code double canVolume 12 literPerOunce quot6 Wrong double literPerOunce 00296 Uninitialized Variables You must initialize ie set a variable s contents before you use it int bottles int bottleVolume bottles 2 Wrong InputOutput Step 1 Add the following line at the beginning to import the Scanner class library import javautilScanner Step 2 Create a variable of Scanner type in the main block Scanner in new Scanner Systemin Step 3 Get the value from the typed keys The nextlnt reads the integer input the nextDouble read the double real number and the next reads the String input int aaa innextInt double bbb innextDouble String 000 innext Arithmetic Operations Addition subtraction multiplication division I and remaindermodulus are arithmetic operations in Java The parenthesis is used to specify the order of calculations x y 5 and x y 5 return differentanswers Table 5 llntsgsi Division an Remainder lEii TESEl l i Wham n 1 1 Mg 1s Tallue C xmment n1 is ill 9 H s 141 is always the LIEit di it sin n E 1i HE This is eilwsys m tsquoti1 i ti1 it digit m ii 1le 2 9 Tl uzlssttssrs digits mi N n 339 ii i 1 E s l 3J3 is s Hosting pm int stumbles tl isimsti nsl part is notdisssrdsd n1 is l s Bsssussrzhst irsisrgumsm isnsgstiss His rsmsi dsr isslss Iisgsiisvs i1 2 1 n s 2 iin is sssn I sir 1 if n is tidlsii In Java a modulus operator is used to calculate the remainder of division eg 152 9 1 15 divide by 2 is 7 and the remainder is 1 Examples 84O 752 575 532 3842 9 639 1094 12O 10912415 10912421 1091246 CastingConverting Any arithmetic operation with int integer type variables return an integer value eg int a 100 int b 24 Systemoutprinta b94 You can convert the floatingpoint numbers to integers lttypegt ltvariabenamegt int ltdoubevariabegt eg double balance 12098 int dollars int balance Now the dollars has a value of 120 instead of 12098 Mathematical Methods Basics The mathematic methodsfunctions are defined in Math class which is under the javalang package Basic use is lttypegt ltvariabegt Math ltmethodgt ltinputsgt eg double squareRoot4 Mathsqrt4 double fouquuared Mathpow4 2 Taile Mathematical Methods Methnd Hhth5qrtfr Hathpuwri y Mathisintn Math we fit Hathitan r Hathtn adinnsi i Hathntn egrEEEix Mathenpir Enthiugit Hathqiegl ix Hathuroumdixj Mathiabeixj Hath manta y Hathnminfx F Returns Square innit111 CI r3 w ii nr U and J in J nr I r and j is an i nteg i Sine clef it in i eidint isi Engine til 1 Tangentnfx Convert degrees in radians inn returns if mquot 13H Clamerr 3 radans to degrees ital returns if 1 l i iin x E39 Natural log inle A T Ell Decimal log ilogmirj j Bil El i ii t integer til I as a long b lnlute value The larger ref 3 and y ETHESHHUETQFI de String is an object data type to store a set of characters Strings Data Type Declaration you can declare the variable of String type in the same way of primitives String vname Declaration and Initialization Need a new memory space for object with a keyword new such as String mynamel String myname2 String myname3 Concatenation empty value John regular value John We use this way but this is special only for String new String new String You can concatenate multiple String objects using operation eg String myname John Jones Methods The length charAtint substringint int are the methods of String length returns the length of characters It is used by calling the method to the objectvariable as String name Harry int num namelengthnumis charAtint returns a character primitive of char at the input position The position index starts from 0 String name char start Harryll namecharAtO a ti char last namecharAt4kmty substringint int returns a new String object with characters from the first input position to the second input position String greeting Hello String sub Worldl greetingsubstring0 5a Hs Hde


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

Jennifer McGill UCSF Med School

"Selling my MCAT study guides and notes has been a great source of side revenue while I'm in school. Some months I'm making over $500! Plus, it makes me happy knowing that I'm helping future med students with their MCAT."

Bentley McCaw University of Florida

"I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"

Parker Thompson 500 Startups

"It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.