CIS 35A: Introduction to Java Programming

Home | Green Sheet | Lectures | Assignments | FAQ | Grades | Students

Assignment #15

Configure a computer purchase

Due Date: Monday of Week 6
20 points

This project uses combo boxes, check boxes, option buttons, borders, and the Grid Bag layout. It also uses a class to define the available options. It is somewhat complicated because of the number of controls and options that are required.

Console

Operation

  • The user configures the components of a computer system by selecting items from the combo boxes, radio buttons, and check boxes.
  • When the user clicks the Calculate button, the application calculates the price of the system by adding the cost of each selected component to a base price.
  • When the user closes the frame or presses the Exit button, the application exits.

Specifications

  • You are free to use whatever layouts and panels you need to duplicate the layout shown in the figure. You can also create any classes you think might be helpful to solve this problem.
  • The base price of the computer is $500.
  • The user can select one of three processors:
  • P4 2.2GHz	included in base price
    P4 2.4GHz	add $50.00
    P4 2.6GHz	add $150
     	
  • The user can select one of four memory configurations:
  • 256MB	included in base price
    512MB	add $50.00
    1GB	add $100.00
    2GB	add $150.00
     	
  • The user can select one of three disk configurations:
  • 80GB	included in base price
    120GB	add $50.00
    170GB	add $150.00
     	
  • The user can select one of two operating systems:
  • Windows XP Home Edition	included in base price
    Windows XP Professional	add $100.00
     	
  • The user can select any or all of the following three software packages:
  • Office package	add $400.00
    Accounting package	add $200.00
    Graphics package	add $600.00
     	

Hints

  • Consider using a separate class to represent each of the configuration options.
  • Don't forget to calculate the initial price ($500) when the program starts.

Enhancements

  • Add a feature that indicates how changing each selection will affect the price. For example, if Windows XP Professional is currently selected, change the text for the Windows XP Home Edition label to "Windows XP Home Edition (subtract $100)." However, if the home edition is currently selected, the check box for the professional edition should read "Windows XP Professional (add $100)."
  • Print a summary of the configuration on the console when the user clicks the Calculate button.
  • If you've already covered file handling, retrieve the configuration options from a file rather than having them hard coded in the program.
Include in your program the following comments:
  • Name of program
  • Programmer's name
  • Current Date
  • Computer system and compiler you are using
  • Brief description of the program

Compile and run the Java program.

Take a screen capture by hitting simultaneously the keys Alt and Print Screen (Prt Sc) of the output results (console) and paste it in MS Paint. Save it as a gif file.

When you are ready, upload the java program and the gif file by clicking the link below:

Upload Assignment

I cannot grade if I don't get the files and receive your email.