CS112 Computer Programming I, Fall 2017

  • Syllabus 
  • Course Policies
  • Code in classroom: click here
  • Assignments. Requirements: For programming assignments, use proper comments and format for the code and its detailed I/O examples; BOTH of the programs and the I/O (for file I/O, only the output file) copied to ONE document named as CS112assignment#_FirstnameLastname.doc (ALL projects should be copied into one document). Email the document as attachment to the instructor (usvwccs@gmail.com). The email subject is the same as the file name.
    • Assignment 1 (Due: Wed. 9/13) Project a) write a program to draw three BIG letters, "VWU". Each letter of the letters  is composed of many of the same character. For example, the big letter 'V' consists of many v's. Project b) write a program to prompt a message and let the user to input the length of a square, and then the program outputs the area of the square to the monitor.
    • Assignment 2 (Due: Mon. 9/18) Project a) write a program that prompts a message, reads three real numbers (from the keyboard), and then outputs their average value (to the monitor). Project b) your program will read the radius (r) and height (h) of a cylinder and output its surface area (2πr2 + 2πhr) and volume (πhr2). Project c) your program will "interview" 4a traveler at the Beach on his/her nickname, job, hobby and other topics, and at last, the program lists the facts on the traveler by displaying: "In conclusion, the traveler's nickname is ____; he/she is a ____; he/she is interested in ____; he/she come here (Virginia Beach) because ____, ...".
    • Assignment 3 (Due: Wed. 9/20) Project a) You program will read the radius (r) of a sphere and output its surface area (4πr2) and volume (4/3πr3). Display the results to two decimal places. Project b) Your program will read a temperature in Fahrenheit (TF) and output its corresponding value in Celsius (TC). The conversion formula is TC = 5/9(TF-32). Display the result to two decimal places.
    • Assignment 4 (Due: Mon. 9/25) Project a) write a program to collect the basic info (student id, first and last name) and his/her three test scores (integers) and then display a summary for the student including all of the above data as well as the average score (display to two decimal places). Project b) You program will read the radius (r) and the height (h) of a cone and output its surface area (πrs + πr2) and volume (1/3πr2h). Display the results to two decimal places. Project c) Your program will read a distance in mile (Dmi) and output its corresponding value in kilometer (Dkm). The conversion formula is Dkm = Dmi 1.609344. Display the result to two decimal places. 
    • To be updated
  • Topics covered:
    • 8/28 Syllabus; intro
    • 8/30 Simple java codes: Hello, Trangle; Greeting. Special characters: '\n', '\t'
    • 9/6 String concatenation operator +; variables; input a decimal from keyboard
    • 9/11 Read a word from keyboard; interactive I/O 
    • 9/13 Read an integer from keyboard. Calculate the area and volume of a prism
    • 9/18 Java methods for Math formula. Display decimals
    • 9/20 Java for math expressions. Calculation of a cone and square based pyramid
    • 9/25 More on Java for math expressions 
    • 9/27 Test 1A 

  • Code in the past years
    • Fall'16 (click here)
    • Fall'15 (click here)
    • Fall'13 (click here)
    • Fall'12 (click here)
    • Fall'11 (click here)

  • Download and install Java (click here) to C:\Program Files(x86): following the steps (for Windows OS that is recommended) - 

    • Find and click version 8 or older version - JDK (be careful - NOT JRE) Download
    • Download and save the file for Windows x86 (be careful - NOT Windows x64) that is similar to jdk-***-windows-i586.exe  (i.e. jdk-8u101-windows-i586.exe)
    • Run the downloaded file jdk-***-windows-i586.exe  and install it to C:\Program Files (x86)
  • AFTER Java IS installed, download and install TextPad 4 or 5 (click here. Choose 32-bit for TextPad 6 or 7), and configuration will be done automatically. Both Java and TextPad should be on C:\Program Files (x86). 
  • Java 6 documentation

Note: Tutoring schedue for CS 112 (no charge) at Learning and Writing Centers at Clarke 223. MW 10am-12pm (Tutor: Mr. Chris McTague), 3pm-6pm (Tutor: Mr. Kevin Murray), Thur. 11am-12pm and Fri. 8:30am-10am (Tutor: Mr. James Ficklin)

Copyright Since 2000, Dr. John Wang, Virginia Wesleyan University, 5817 Wesleyan Drive, Virginia Beach, VA 23455 
Updated on Wednesday, September 20, 2017  by zwang@vwu.edu