Cosc 1046 (sf14) – introduction to computer science

COSC 1046 (SF14) – Introduction to Computer Science  

Assignment #6

NOTE:  You must include commenting in all of these assignments.  The code must be neatly

formatted – marks will be deducted.

Part A:  These questions are to be submitted to the instructor in the form of a Word (or Open

Office) document containing the Java code and appropriate screen capture(s) of the output.

Put both questions in the same word file.  The file name must be in the form

ASSIGN6A_YourName   where ‘YourName’ is your last name followed by your first name with

no space.  Upload the file to CMS.

Question 8.11, page 333:

10 marks for the class and test program.  Another 10 marks for the UML diagram.

 

Question 9.29, page 368:

Test the program using: i) 978013213080; ii) 978013213079; and iii) 978013293652

 

Part B:  Write code and test the solutions for the following problems from the textbook.

Submit the .java files for each question to CMS. 

 

Question 8.7, page 331

Make sure you provide the test class to demonstrate the operations as described.

 

Question 9.5, page 363

 

Question 10.5, page 401

 

Programming 5

In programming exercise 2, the class Date was designed implemented to keep track of the date, but it has very limited operations. Redefine the class Date so that, in addition to the operations already define, it can perform the following operations on a date:

Set the month

Set the day

Set the year

Return the month

Return the day

Return the year

Tests whether a year is a leap year

Return the number of days in the month. For example, if the day is 3 – 12 – 2015, the number of days to be returned is 31, because there are 31 days in March.

Return the number of days passed in the year. For example, if the date is 3 – 18 – 2015, the number of days past in the year is 77. Note that the number of days returned also includes the current day.

Return the number of days remaining in year. For example, if the date is 3 – 18 – 2015, the number of days remaining in the year is 288.

Calculate the new date by adding a fixed number of days to the date. For example, if the date is 3 – 18 – 2015 and the days to be added on 25, the new date is 4 – 12 – 2015.

Return a reference to the object containing a copy of the date.

Make a copy of another date. Given a reference to an object containing a date, copy the data members of the object into the corresponding data members of this object.

Write the definitions of the methods to implement the operations defined for the class Date.

Part A: These questions are to be submitted to the instructor in the form of a Word (or Open Office) document containing the Java code and appropriate screen capture(s) of the output. Put both questions in the same word file. The file name must be in the form ASSIGN6A_YourName where‘YourName’isyourlastnamefollowedbyyourfirstnamewith no space. Upload the file to CMS.
Question 8.11, page 333:
10 marks for the class and test program. Another 10 marks for the UML diagram.
Problem 9.29, page 368:
Test the program using: i) 978013213080; ii) 978013213079; and iii) 978013293652
Part B: Write code and test the solutions for the following problems from the textbook. Submit the .java files for each question to CMS. The answers are due on May 28th and the programs are to be demonstrated to the Teaching Assistant (Daniel) by May 29th. He will ask questions to make sure you understand the material.
Question 8.7, page 331
Make sure you provide the test class to demonstrate the operations as described.
Problem 9.5, page 363 
Problem 10.5, page 401

 

 

 

 







Calculate Your Essay Price
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more

Order your essay today and save 10% with the coupon code: best10