CHEATSHEET2[1]

CHEATSHEET2[1] - 1. Who invented the general purpose...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
1. Who invented the general purpose digital computer? Charles Baggage 2. Who was the inventor’s assistant, sometimes considered to have been the computer programmer? Ada Augusta Bryon List all of the primitive types of the Java computer language. \Byte, short, int, long, float, double, char, boolean What is a portable computer program? portable program is one that will run on any computer that supports that language, with no change or with few changes. iX = 9 % 5 would mean 5/ 9 and its remainder is the answer equaling 4, (goes in the box) % (outside the box) iX = 5 % 9 would mean 9/5 and since it won’t fit the answer would be zero yet remainder of 5 iX = 0 % 5 would mean 5/0 and since it equals zero 5 times zero equals zero and 0 – 0 is zero iX = 5 % 0 doesn’t make sense, how can zero divide to 5, that means that it would be an error Error would read like , “Error: Can’t use % followed by zero” Another thing is that when the equation is complicated such as the following: iX = 7 -3 + 14 / 5 * 2 – 0.0; then it can’t be done since there is a 0.0 and this isn’t a double variable on the left Remember that on double variables there are like the following: 0.0 This class doesn’t have any remainders also just the straight answer If the number 9/5.0 is like this, it would want the exact amount which would be 1.8 In this section they will ask you about the invalid and valid types…. First off, if its like int static , this would be invalid because it is a RESERVED KEYWORD int staticItem is valid because its all right double 3FrenchHens is invalid because it starts with a number double one$Bill ; is valid but remember that $ is not so great because it would be poor practice int LGL MOV ; is bad because it has a embedded blank Read Following: System.out.print(“Row, row”); Row, row, row, your boat System.out.println(“, row, your boat”); Friends, \n means a new line System.out.print(“Friends,\n Romans,\n”); Romans, System.out.println(“countrymen”); countrymen Remember on Strings that 0 is a number for example on the following string…. (d) String str5 = “Election returns”; char cc = str5.charAt(4); this would be ‘t’ since it is the 4 th character after zero Below this remember that you pick the letters that are within the range from the letter | N you count to 4 then go to 7 and you stop right before e so the answer is ‘pap’ (e) String str6 = “Newspaper column”; String str7 = str6.substring(4, 7); There would be a question concerning writing two Java statements that would read A value type int into the int variable, look below at dataVal, when you use the scanner class (such as one after you write a promt for println) This code would declare the scanner object and then use it int dataVal Scanner scan = new Scanner(System.in); dataVal = scan.nextin(); Another question concerns the int variables that place iA and doubles that would ask to to a Prompt question but link it with a number The Value of iA is 7 The Value of dB
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/22/2008 for the course CS 1113 taught by Professor Chandler during the Spring '08 term at Oklahoma State.

Page1 / 5

CHEATSHEET2[1] - 1. Who invented the general purpose...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online