[CMSC 437] | [Syllabus] | [Lecture Notes] | [Homework] | [Projects] | [Files] | [Notes, all]

CS437 Details of homework assignments and Quiz

You will demonstrate homework to the instructor in class.
Homework grade is recorded based on demonstration.

Homework must be demonstrated when due.  You loose 10%, one grade,
the first class homework is late. Then 10% each class thereafter.
Max 50% off.

Do your own homework!

You can discuss homework with other class members but DO NOT COPY!

All parties involved in copying get zero on that assignment.

Contents

  • Homework 1
  • Homework 2
  • Quiz 1
  • Homework 3
  • Homework 4
  • Quiz 2
  • Homework 5
  • Homework 6
  • Quiz 3
  • Other Links
  • HW1 Compile and Execute, 25 points

    This homework is to be sure you have a chance to pass the course:
    You get to choose the operating system, programming language
    and graphics library for your homework and project. The
    purpose of the homework is to demonstrate GUI tasks that
    may be used in your project. 
    
    You need to do any two of the following letters a) through i).
    You may do more.
    
    On some Microsoft windows system, yours or UMBC,
    a) compile and execute w1gl.c        a basic OpenGL program
    b) compile and execute W1frame.java  a basic Java program
    
    On some Linux (or in general Unix) system, yours or UMBC,
    d) compile and execute w1gl.c        a basic OpenGL program
    e) compile and execute W1frame.java  a basic Java program
    f) compile and execute w1.c          a basic X windows program
    
    On a Mac or any platform, in any language,
    g) compile and execute a program that brings up a window,
       draws lines (not using forms) and draws text in the same
       window as the lines. Make it similar to any w1* .
    
    h) compile and execute an equivalent program to w1* in Python
    or some other language with a graphics library.
    
    i) make some change to the JavaScript in a HTML5 .html file
       and view it in your browser
    
    Turn in one piece of paper when demonstrating, your name and
    name of operating system and the command you used
    to do any two (2) of a) through  i)
    (It is OK, but not necessary, to say what setup you did.)
    Run the two programs for the instructor in class.
    
    Get detailed help from  GUI help on Windows and Linux
    
    The source code and libraries are available in many places,
    e.g. WEB download
    
    If you could not do any of the nine a) through i)  by the second
    class, you should consider dropping the course. It is OK if it
    took you four to eight hours to get the basic process working.
    Results are what is important so that you will be able to
    do your project.
    
    

    HW2 File, Open, 25 points

    Combine the concepts of Lecture 5 Menu and Lecture 6 Input Text.
    Write and demonstrate a program that has the user enter a
    file name into your graphics window and then read that file
    and display the file in a graphics window.
    
    Typically, but not required, there would be a "File" menu and
    an item on this menu would be "Open" that asked for a file name.
    The area for inputting the file name may be fixed or can popup.
    
    This may be a small stand alone program in any language
    on any platforms. For your benefit it should be the same
    language and graphics you are planning to use in your project.
    
    Just demonstrate to instructor in class.
    
    

    Quiz 1. 12.5% of course grade

    See Lecture 9
    

    HW3 Graphical Selection, 25 pts

    In the language of your choice, on the platform of your choice,
    show the code that provides for the user to select some item
    in the GUI. Graphical item selection, not menu selection.
    The selection may change the color or provide some other
    feedback to the user, showing what was selected..
    
    This can be a small stand alone program or the beginning of
    your project that is now providing the ability to select an item.
    You may, yet do not have to, do anything with
    the selected item. (Well, you should somehow clue the user about
    which item was selected.)
    The selection may change the color or provide some other feedback
    to the user, showing what was selected.
    
    This is not intended to be buttons. It is about getting and using
    mouse coordinates and mouse buttons.
    
    e.g rubber2gl.c  Rubber2.java  Select2.java)
    
    Just demonstrate to instructor in class.
    
    

    HW4 Display Fonts, 25 pts

    In the language of your choice, on the platform of your choice,
    write the code that displays at least two fonts in the GUI.
    The fonts may be, yet do not have to be, user selectable.
    
    This can be a small stand alone program or the beginning of
    your project that is now providing the ability to display
    more than one font..
    
    Just demonstrate to instructor in class.
    
    

    Quiz 2. 12.5% of course grade

    See Lecture 19
    

    HW5 Clock, 25 pts

     
    In the language of your choice, on the platform of your choice,
    write the code that displays a clock in the GUI.
    The clock can be analog or digital.
    
    The analog clock must have a second hand that moves reasonable
    accurately, the minute and hour hand are optional. The numbers
    from 1 to 12 are optional, the motion is the point of this
    homework.
    
    The digital clock must display at least  hh:mm:ss  and
    the seconds must be reasonably accurate. Yes, this is as
    simple as getting the date and time string and just writing
    it to the GUI display like any other text.
    
    This can be a small stand alone program or the beginning of
    your project that is now providing the ability to display
    time.
    
    The demonstration program for getting time in "C" is:
    time_of_day.c with sample output:
    
     0 CPU time 
     10 / 8 / 104 
     23 : 57 : 16 
     ascii string Tue Aug 10 23:57:16 2004
     
    waste time 0.035529 
     0.31 CPU time 
    
    
    For X Windows Motif analog clock,
    the classic program is xclock.c ,
    yet, it is designed to update once a minute and needs a second hand.
    
    For Java, date and time is obtained in the sample program:
    time_of_day.java with sample output:
    
    time_of_day from Java
    
    java.util.GregorianCalendar[time=1092208960278,areFieldsSet=true,
    areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id=
    "America/New_York",offset=-18000000,dstSavings=3600000,useDaylight=true,
    transitions=235,lastRule=java.util.SimpleTimeZone[id=America/New_York,offset
    =-18000000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=3,
    startMonth=3,startDay=1,startDayOfWeek=1,startTime=7200000,startTimeMode=0,
    endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=7200000,endTimeMode=0]],
    firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2004,MONTH=7,
    WEEK_OF_YEAR=33,WEEK_OF_MONTH=2,DAY_OF_MONTH=11,DAY_OF_YEAR=224,
    DAY_OF_WEEK=4,DAY_OF_WEEK_IN_MONTH=2,AM_PM=0,HOUR=3,HOUR_OF_DAY=3,
    MINUTE=22,SECOND=40,MILLISECOND=278,ZONE_OFFSET=-18000000,DST_OFFSET=3600000]
    
    7/11/2004
    3:22:40
    278 milliseconds
    
    t1=1.092208960278E12
    t2=1.092208960325E12  t2-t1=47.0 milliseconds
    
    Sample code to get time and output at 5 second intervals:
    (You must display in a graphics window for homework.)
    time_test.c
    time_test.java
    time_test.py
    time_test.f90
    
    

    HW6 "Splash" or motion, 25 points

     
    In the language of your choice, on the platform of your choice,
    write the code that displays a "Splash" for three (3)
    seconds in the GUI. e.g. What some games do when you win or loose.
    This may start automatically or in response to a user action.
    Or, do something with motion that uses timing to control
    the speed, and stops after some reasonable, pre programmed time.
    
    (Use the information from samples in HW5 to get time.)
    
    This can be a small stand alone program or the beginning of
    your project that is now providing the ability to display
    an event for a fixed time.
    
    

    Quiz 3. 15% of course grade

    (Also known as a final exam.)
    See Lecture 29
    

    Other Links

    Many web sites on Java GUI, AWT, Swing, etc.
    Many web sites on Python wx, tk, qt, etc.
    

    Go to top

     Last updated 6/15/2016