prog3 - CSE 114 Spring 2011 Programming Assignment 3(HW 3...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 114 Spring 2011 Programming Assignment 3 (HW 3) Due Date: Submit before 11am on Mon March 28, 2011. Late programs will not be accepted. Important: Write plenty of comments in your code. Some points are reserved for that. Also include your name, ID number ,Lab-section number ,and HW number in every file that you submit. This information should be right at the top. Again some points are reserved for this as well. Youare sup- posed to use ECLIPSE environment for this assignment. You will write 2 classes. The second class will have a main method. Youare supposed to hand in twoJav a files from your sparkyaccount. Create a submit directory in your hw3 folder .Using SSH, copy2source (Java)files from your PC to your account (submit directory of hw3) on sparky. You must submit both files at the same time by executing command handin114 hw3 submit Note: handin114 command will be activated on Mon March 21, 2011 at 5pm. Nowweare expect- ing hw3. So do not submit hw1 or hw2. Grading: No credit if your program does not evencompile. If your programs work on some cases bu tnot all, then you should hand in whateveryou have toget some credit. Let TAknowwhat works and what does not. Overview: Forthis assignment you will write twoclasses. The first class will be .This has instance variables and methods for objects of Amount class. The main method will be in main method will demonstrate howthe Amount class can be used. Develop your Amount class one step at a time. Write a method, and test it from the main ( ). Once it starts working, add another and so on. This class has twoinstance variables; dollars and cents, both of type integer. Constructor: Write a constructor that uses twointeger parameters, one for dollars and the other for cents. If dollar value is less than zero, then set it to zero. Similarly ,the cent value should be between 0and 99. If not, set it to zero. Note that in addition there is a default constructor which will con- struct the object and initialize integer instance variables to zero (0). Write twoaccessor methods, one for dollars and the other for cents. Write twomutator methods ,again one for dollars and the other for cents. Perform checks similar to those done in constructor. Write several methods to manipulate objects of class Amount. These are as follows. 1. add: This method needs twoAmount objects as parameters and returns their sum as an Amount
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/29/2011 for the course CSE 114 taught by Professor Tashbook during the Spring '08 term at SUNY Stony Brook.

Page1 / 6

prog3 - CSE 114 Spring 2011 Programming Assignment 3(HW 3...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online