CS 101-E: IntroductionAssumptionsDifferences with 101A bit of humor: Review of last timeComputing units of measureA marketing trickSoftwareA bit of humor: Input methodsTranslationJava translationTaskDisplayForecast.javaSample outputJava DocumentationGood CommentingBad commentingJava and the InternetEngineering softwareSoftware engineeringPrinciples of software engineeringA bit of humor: 1989 Computer AdvertisementObject-oriented designProgrammingSlide 24Problem SolvingSlide 26Slide 27Problem Solving ProcessSlide 29Slide 30Slide 31Slide 32Slide 33Slide 34Problem Solving MethodologiesSlide 36Slide 37TipsSlide 39Slide 40Slide 41Slide 42Slide 431CS 101-E: IntroductionAaron BloomfieldMEC 205MEC 215Clark G004 (really)2AssumptionsThe following is assumed for students in 101-EYou have taken a course-equivalent in programmingThus, you know the basics of programmingYou did not get a 4 or a 5 on the AP computer science exam (AB level)3Differences with 101Labs must be done by all 101-E students on their own timeIf you miss more than 2, you are subject to failureLabs due 8:30 p.m. on SundayLab session for 101-E students Sunday at 7 p.m.Pace through the textbook is the sameWe’ll go into more detail, thoughToday’s class will be a high-level overview4A bit of humor: Review of last time5Computing units of measureKilo (K) = 1,000 (thousand)Mega (M) = 1,000,000 (million)Giga (G) = 1,000,000,000 (billion)Tera (T) = 1,000,000,000,000 (trillion)= Kibi (Ki)= Mebi (Mi)= Gibi (Gi)= Tebi (Ti)Kilo = 210 = 1,024Mega = (1024)2 = 1,048,576Giga = (1024)3 = 1,073,741,824Tera = (1024)4 = 1,099,511,627,7766A marketing trickThis hard drive has 250,059,350,016 bytes=250.06 Gigabytes=232.89 GibibytesGuess which one they use to advertise the drive?7SoftwareProgramSequence of instruction that tells a computer what to doExecutionPerforming the instruction sequenceProgramming languageLanguage for writing instructions to a computerMajor flavorsMachine language or object codeAssembly languageHigh-levelProgram to which computer can responddirectly. Each instructionis a binary code thatcorresponds to anative instructionSymbolic languagefor coding machinelanguage instructionsDetailed knowledge ofthe machine is notrequired. Uses avocabulary andstructure closer to theproblem being solvedJava is a high-levelprogramminglanguageFor program to beexecuted it must betranslatedProgramSequence of instruction that tells a computer what to doExecutionPerforming the instruction sequenceProgramming languageLanguage for writing instructions to a computerMajor flavorsMachine language or object codeAssembly languageHigh-levelProgramSequence of instruction that tells a computer what to doExecutionPerforming the instruction sequenceProgramming languageLanguage for writing instructions to a computerMajor flavorsMachine language or object codeAssembly languageHigh-levelProgramSequence of instruction that tells a computer what to doExecutionPerforming the instruction sequenceProgramming languageLanguage for writing instructions to a computerMajor flavorsMachine language or object codeAssembly languageHigh-level8A bit of humor: Input methods9TranslationTranslatorAccepts a program written in a source language and translates it to a program in a target languageCompilerStandard name for a translator whose source language is a high-level languageInterpreterA translator that both translates and executes a source program10Java translationTwo-step processFirst stepTranslation from Java to bytecodesBytecodes are architecturally neutral object codeBytecodes are stored in a file with extension .classSecond stepAn interpreter translates the bytecodes into machine instructions and executes themInterpreter is known a Java Virtual Machine or JVM11TaskDisplay the forecastI think there is a world market for maybe five computers. Thomas Watson, IBM, 1943.12DisplayForecast.java// Authors: J. P. Cohoon and J. W. Davidson// Purpose: display a quotation in a console windowpublic class DisplayForecast { // method main(): application entry point public static void main(String[] args) { System.out.print("I think there is a world market for"); System.out.println(" maybe five computers."); System.out.println(" Thomas Watson, IBM, 1943.");}}Three statements make up the action of method main()Method main() is part of class DisplayForecastA method is a named piece of code that performs some action or implements a behaviorAn application program is required to have a public static void method named main().13Sample output14Java DocumentationFamiliarize yourself with the Java documentationIt will save you lots of time!15Good CommentingNecessary so others can re-use your codeAnd so the graders can understand it!A well commented program:// Authors: J. P. Cohoon and J. W. Davidson// Purpose: display a quotation in a console windowpublic class DisplayForecast { // method main(): application entry point public static void main(String[] args) { System.out.print("I think there is a world market for"); System.out.println(" maybe five computers."); System.out.println(" Thomas Watson, IBM, 1943.");}}16Bad commenting// Thomas J. Watson (February 17, 1874 - June 19, 1956) is// considered to be the founder of IBM. He was one of the// richest men of his time and called the world's greatest// salesman when he died.// Watson was born in Campbell, New York. His formal// education consisted of only a course in the Elmira// School of Commerce. His first job was at age 18 as// a bookkeeper in Clarence Risley's Market in Painted// Post, New York. Later he sold sewing machines and// musical instruments before joining the National Cash// Register Company as a salesman in Buffalo. He eventually// worked his way up to general sales manager. Bent on// inspiring the dispirited NCR sales force, Watson// introduced the motto, "THINK," which later became// a widely known symbol of IBM.// Although he is well known for his alleged 1943 statement: // "I think there is a world market for maybe five computers"// there is no evidence he ever made it. The author Kevin // Maney tried to find the origin of the quote. He has been // unable to locate any speeches or documents of Watson's// that contain this, nor is it present in any
View Full Document