11-03-2011, 09:46 PM
[FONT="]Instructions[/FONT]
[FONT="]Please read the following instructions carefully before solving & submitting assignment:[/FONT]
[FONT="]It should be clear that your assignment will not get any credit (zero marks) if:[/FONT]
[FONT="]o [/FONT][FONT="]The assignment is submitted after due date.[/FONT]
[FONT="]o [/FONT][FONT="]The submitted assignment does not open or file corrupt.[/FONT]
[FONT="]o [/FONT][FONT="]The assignment is copied (from other student or ditto copy from handouts or internet).[/FONT]
[FONT="]o [/FONT][FONT="]Student ID is not mentioned in the assignment File or name of file is other than student ID.[/FONT]
[FONT="]Uploading instructions[/FONT]
[FONT="]Your Submission must include:[/FONT]
Note: Use Notepad for coding and JDK package for java source code compilation and running (JDK is also available on download section of VULMS)
[FONT="]Objective[/FONT]
The objective of this assignment is
[FONT="]o [/FONT]To give you some practice exercise of GUI and understanding use of it.
[FONT="][EMAIL="cs506@vu.edu.pk"]
[/EMAIL][/FONT]
[FONT="]GOOD LUCK[/FONT]
[FONT="]Marks: 15 [/FONT]
Question:
Write the ideal weight calculator so that height in inches is entered by using a slider. Use the approximate formula:
W = H2 / 30 , for female![[Image: cs504.jpg]](http://1.bp.blogspot.com/-yJ1RMAmiHSA/TrJ-hXrPHJI/AAAAAAAAATg/GjWP77wAyMg/s1600/cs504.jpg)
W = H2 / 28 , for male
where W is the ideal weight in pounds,
H is the height in inches
Set an action command for each radio button using [FONT="]setActionCommand(String)[/FONT].
Add an action listener for each button using [FONT="]addActionListener()[/FONT].
Add a change listener for the slider using [FONT="]addChangeListener()[/FONT].
The ideal weight should be displayed in a text field when the user changes either a radio button or the slider.
Pick initial settings for the buttons and slider. When the program starts up display the ideal weight for those settings.
Note: Your code must justify enough for 15 marks.
[FONT="]Lectures Covered: This assignment covers Lecture # 10-13[/FONT]
[FONT="]Deadline[/FONT]
[FONT="]Your assignment must be uploaded/submitted at or before 15/11/2011. [/FONT]
[FONT="]Please read the following instructions carefully before solving & submitting assignment:[/FONT]
[FONT="]It should be clear that your assignment will not get any credit (zero marks) if:[/FONT]
[FONT="]o [/FONT][FONT="]The assignment is submitted after due date.[/FONT]
[FONT="]o [/FONT][FONT="]The submitted assignment does not open or file corrupt.[/FONT]
[FONT="]o [/FONT][FONT="]The assignment is copied (from other student or ditto copy from handouts or internet).[/FONT]
[FONT="]o [/FONT][FONT="]Student ID is not mentioned in the assignment File or name of file is other than student ID.[/FONT]
[FONT="]Uploading instructions[/FONT]
[FONT="]Your Submission must include:[/FONT]
- All the Source Code (.java files) and other if necessary files to compile and run your program.
- If and only if there are multiple files to submit place all the files in a Zip file and Upload it on VULMS else only source code file is required to be submitted.
Note: Use Notepad for coding and JDK package for java source code compilation and running (JDK is also available on download section of VULMS)
[FONT="]Objective[/FONT]
The objective of this assignment is
[FONT="]o [/FONT]To give you some practice exercise of GUI and understanding use of it.
[FONT="][EMAIL="cs506@vu.edu.pk"]
[/EMAIL][/FONT]
[FONT="]GOOD LUCK[/FONT]
[FONT="]Marks: 15 [/FONT]
Question:
Write the ideal weight calculator so that height in inches is entered by using a slider. Use the approximate formula:
W = H2 / 30 , for female
![[Image: cs504.jpg]](http://1.bp.blogspot.com/-yJ1RMAmiHSA/TrJ-hXrPHJI/AAAAAAAAATg/GjWP77wAyMg/s1600/cs504.jpg)
W = H2 / 28 , for male
where W is the ideal weight in pounds,
H is the height in inches
Set an action command for each radio button using [FONT="]setActionCommand(String)[/FONT].
Add an action listener for each button using [FONT="]addActionListener()[/FONT].
Add a change listener for the slider using [FONT="]addChangeListener()[/FONT].
The ideal weight should be displayed in a text field when the user changes either a radio button or the slider.
Pick initial settings for the buttons and slider. When the program starts up display the ideal weight for those settings.
Note: Your code must justify enough for 15 marks.
[FONT="]Lectures Covered: This assignment covers Lecture # 10-13[/FONT]
[FONT="]Deadline[/FONT]
[FONT="]Your assignment must be uploaded/submitted at or before 15/11/2011. [/FONT]
