COSC236 example lab
COSC236 example lab COSC 236
Popular in Intro to Computer Science 1
verified elite notetaker
Popular in Computer science
This 2 page Class Notes was uploaded by Kelsey Voelker on Sunday October 16, 2016. The Class Notes belongs to COSC 236 at Towson University taught by Dr. Alkharouf in Fall 2016. Since its upload, it has received 2 views. For similar materials see Intro to Computer Science 1 in Computer science at Towson University.
Reviews for COSC236 example lab
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/16/16
COSC 236 Dr. Alkharouf Lab 2* 1. Write a complete Java program that produces the following output (use System.out.println() to print each line to the screen): What is the difference between a ' and a "? Or between a " and a \"? One is what we see when we're typing our program. The other is what appears on the "console." 2. Write a complete Java program that produces the following output (use System.out.println() to print each line to the screen): A "quoted" String is 'much' better if you learn the rules of "escape sequences." Also, "" represents an empty String. Don't forget: use \" instead of " ! '' is not the same as " 3. Write a program that stores the integers 62 and 99 in variables, and stores their sum in a variable called total. Print out the total to the screen. 4. Write a program that declares the following: a String variable named name an int variable named age a double variable named annualPay Store your age, name, and desired annual income as literals in these variables. The program should display these values on the screen in a manner similar to the following: My name is Joe Smith, my age is 26 and I hope to eary $100000.0 per year. 5. Write a program that has the following String variables: firstName, middleName, and lastName. Initialize these with your first, middle, and last names. The program should also have the following char variables: firstInitial, middleInitial, and lastInitital. Store your first, middle, and last initials in these variables. The program should display the contents of these variables on the screen. * Questions modified from: Starting Out with Java: From Control Structures through Data Structures. Second Edition, by Tony Gaddis and Godfrey Muganda. Deliverables: Copy and paste your code into a Word document and submit that word doc along with the .java files through Black Board.
Are you sure you want to buy this material for
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'