1. Homepage
  2. Programming
  3. COM1003 Java Programming - Programming Assignment 2: Dinosaur

COM1003 Java Programming - Programming Assignment 2: Dinosaur

Engage in a Conversation
The University of SheffieldCOM1003Java ProgrammingJava

COM1003 Java Programming Autumn Semester 2023-4 Programming Assignment 2 CourseNana.COM

Learning outcomes CourseNana.COM

This assignment will assess your ability to:
ˆ Write a program from a specification;
ˆ Write clear, good quality program code;
ˆ Use loops in Java;
ˆ Use the sheffield package for graphical output; ˆ Use arrays in Java.
ˆ Use the Math class in Java CourseNana.COM

Your Program CourseNana.COM

You must write a program to read in information from a file and use it to display a picture. As in the earlier assignment, there are various increasingly difficult versions of this task each with an associated maximum number of marks that can be obtained but this time each task does not directly include the previous one although each version builds on skills you could develop in doing a simpler version. CourseNana.COM

Unless you are already a competent programmer I suggest you attempt the easiest one, get it to work and back up your program (and possibly upload it to Blackboard) before you attempt the next one by modifying the previous version. And if you are a competent programmer at least read the specifications for the easier versions because they contain information you are going to need. CourseNana.COM

For all versions the program you upload must be called Assignment2.java. Blackboard will present me with the last version you uploaded before the dead- line to mark so the last version you upload should be the hardest you can make compile and run. Do not worry that they are all called Assignment2.java; I will to be able to recognise which version you are attempting from the output. Handing in only one version which must be called Assignment2.java is part of the specification and if you ignore this and hand in more than one version I will not mark any of them. CourseNana.COM

As before your program must compile and run to get any marks and, in this assignment, it must do exactly one of the tasks to get any of the marks. So CourseNana.COM

1 CourseNana.COM

COM1003 Java Programming – Assignment 2 CourseNana.COM

a well written program that does something is always better than a program which would do more if it had worked. It is worth 20% of your mark for the first semester of the module and must be submitted by 24 November 2023. You will find information about the exact deadline, the marking scheme and how you must submit your work at the end of this document. CourseNana.COM

The specification is typical of real specifications in that, although it is not meant to be ambiguous, it is not going to tell you every detail of the program you must write. Be careful not to make any assumptions without checking them. As with the previous assignment there will be an FAQ page. Even if you think you understand everything and have assumed nothing it is a good idea to check this page before you submit. CourseNana.COM

The Simplest Program - a Little Dinosaur CourseNana.COM

You have been provided with a data file called dino.txt. You should store it in the same directory as your program, whatever directory that is, and don’t change its name. Your program must read in the 17,220 lower case letters in the data file using EasyReader. The 17,220 characters are encrypted but can be used to form a rudimentary picture of a dinosaur. The encryption is very simple; any letter whose numeric value is odd is part of the background and letters whose numeric value are even represent the dinosaur. They are arranged so that the top line of the picture makes up the first 246 characters, the next 246 is the second line of the picture and so on with the last 246 as the bottom line of the picture. CourseNana.COM

There are no line breaks or other layout characters and nothing else except lower case letters. This means if you try to open the file in any text editor it will look as though it doesn’t match the specification because text editors cannot cope with lines of 17,220 characters. The data file your program will be tested against conforms to exactly the same rules although it my represent a different picture. CourseNana.COM

As you read in the characters, ideally one by one, you should store the information from the file in a suitable array then use the information in the array to display the dinosaur in a graphics window with 70 rows of 246 pixels using the EasyGraphics class. The choice of colour is up to you as long as it is easy to distinguish between background. CourseNana.COM

the dinosaur and its CourseNana.COM

It is possible to read the file and display the dinosaur without using an intermediate array but if you do that it will have a significant effect on your marks (the marking scheme is at the end of this document) and, if you are planning to go on to the more difficult tasks, you will need it. CourseNana.COM

Please note a suitable array is one that makes it easy to draw a dinosaur not one that is a clone of the data file. CourseNana.COM

If you do this with a perfectly written program that demonstrates all the techniques identified in the marking scheme you can expect to get 30%. CourseNana.COM

A Bigger Picture CourseNana.COM

This is the almost same as the previous version except scaled up so that the picture is four times the size (in area) as the original one. The graphics window should be bigger too but not just twice as high and twice as wide, there must also be a 15 pixel margin of the background colour at the top, bottom and both sides so that the picture does not look so tightly framed. So the new version must be a dinosaur that is twice as long and twice as tall as the earlier one in a graphics window that is 522 pixels wide and 170 high. CourseNana.COM

If you do this with a perfectly written program that demonstrates all the techniques identified in the marking scheme you can expect to get 45% provided you don’t submit the earlier version as part of the same program. If you submit both as one program you will get zero. CourseNana.COM

Two Dinosaurs CourseNana.COM

Extend the width of your graphics window by another 246 pixels and draw another dinosaur imediately to the right of the one in the pre- vious picture but a small one (so the original size) and facing the opposite direction. CourseNana.COM

If you do this with a perfectly written pro-
gram that demonstrates all the techniques identified in the marking scheme you can expect to get 60%.

If you submit this version you should not submit the 30% or 45% versions. Dinosaurs with a Background CourseNana.COM

The file dino.txt contains more information than just a picture of a dinosaur, it also contains a picture of a tree. The first 19 columns within the data file contains the tree. Letters in the file which are divisible by 3 are the trunk and letters which are divisible by 5 are the leaves. CourseNana.COM

Create a second array to store the information about the tree. You should populate this array at the same time as you read in the information for the dinosaur array. Do not CourseNana.COM

read the file in twice. This is part of the specification. If you read the file in more than once it will cost you a lot of marks. This is a general principle, reading data in from a file is always inefficient and you should never read the same file in twice. CourseNana.COM

Now turn the information you have into a scene with the two dinosaurs as above but with the bottom 30 pixels of the screen a green or brown colour to represent the ground and the rest of the background a light colour to represent the sky. Add the tree at the left hand side of the screen where it was in the data file but scaled up like the bigger dinosaur. CourseNana.COM

The dinosaur should be in front of the tree not behind it so draw the tree first and then the dinosaurs afterwards. CourseNana.COM

If you do this with a perfectly written program that demonstrates all the techniques identified in the marking scheme you can expect to get 90%. If you submit this version you should not submit any of the other versions CourseNana.COM

A Dinosaur Forest CourseNana.COM

This is like the previous ver- sion except that, instead of just one tree in a fixed posi- tion, there should be 20 trees in random horizontal posi- tions in the background. By CourseNana.COM

random I mean random calculated at run time so that every run of the program is likely to have 20 trees in different positions to the previous run. CourseNana.COM

You don’t have to make your dinosaurs pink. CourseNana.COM

If you do this with a perfectly written program that demonstrates all the techniques identified in the marking scheme you can expect to get 100%. If you submit this version you should not submit any other version in the same program. CourseNana.COM

Submission and deadline CourseNana.COM

You must submit a file called Assignment2.java via the submission point on Blackboard by 4pm on Friday 24th November. Do not submit anything else and do not submit it in any other format. Blackboard is very bad at displaying Java programs so you may think that Blackboard has messed up the layout of your program but I will download the program text and the layout will be preserved. CourseNana.COM

This is an individual assignment. You must work on it alone and hand in your own work. The use of any generative AI tools in the preparation of the solution to this work is not permitted. If you work collaboratively and then pretend you did the work alone we will find out (we have a very good plagiarism checker and all submitted work will go through it) and we take the use of unfair means in the assignment process very seriously. Don’t even think about handing in work you didn’t do yourself. CourseNana.COM

I am aware that the clause that says that if you hand in a program it must compile and run to get any marks including marks for programming style is draconian but a program is not an essay, it is intended to do a task and if it does nothing it is useless. Having said that I will allow style marks only to stand for honest attempts that fail to compile or run due to a single trivial error and I will test compile all the submissions by noon on the next working day after the deadline (27th) and allow students whose programs don’t compile and, to a limited extent, run to resubmit albeit with a lateness penalty so check your email that afternoon. CourseNana.COM

4 CourseNana.COM


3 3 5 8 5 8 5 8 3 5 0 0 3 4 6 9 CourseNana.COM

3 3 3 CourseNana.COM

8 16 16 12 16 17 12 16 17 CourseNana.COM

7 12 12 0 0 5 6 9 10 12 18 20 CourseNana.COM

60 90 100 CourseNana.COM

COM1003 Java Programming – Assignment 2 CourseNana.COM

The Marking Scheme CourseNana.COM

This marking scheme is designed to test how well you know the work released upto week 6 of the course (week 7 of term). So to get the marks mentioned for particular skills from these lectures you must demonstrate you understand them. Using different skills to achieve the same effect will not get you the marks but demonstrating you know methods I have not mentioned from the Math, String or Character classes with not be a problem in this assignment. The marking scheme is as follows CourseNana.COM

Version CourseNana.COM

EasyReader Arrays
Loops EasyGraphics Calculation Mathsclass Specification Style

Little Bigger Two With Dinosaur Dinosaur Dinosaur Dinosaurs Background Forest CourseNana.COM

Total 30 45 CourseNana.COM

The style mark will be calculated as a percentage CourseNana.COM

Good use of identifiers 20 Good use of types 25 Good use of comments 20 Good use of constants 15 Readability 20 Total 100 CourseNana.COM

as follows and scaled to CourseNana.COM

the maximum for whatever version you submit.
Readability encompasses layout, indention and a clear, consistent structure.

Remember there are some style guidelines on the Blackboard Practical Classes page. CourseNana.COM

There is a mark for comments and adding your name at the top of the program is best practice but please don’t do it because the assignments are supposed to be marked anonymously. CourseNana.COM

Get in Touch with Our Experts

Wechat WeChat
Whatsapp Whatsapp
The University of Sheffield代写,COM1003代写,Java Programming代写,Java代写,The University of Sheffield代编,COM1003代编,Java Programming代编,Java代编,The University of Sheffield代考,COM1003代考,Java Programming代考,Java代考,The University of Sheffieldhelp,COM1003help,Java Programminghelp,Javahelp,The University of Sheffield作业代写,COM1003作业代写,Java Programming作业代写,Java作业代写,The University of Sheffield编程代写,COM1003编程代写,Java Programming编程代写,Java编程代写,The University of Sheffieldprogramming help,COM1003programming help,Java Programmingprogramming help,Javaprogramming help,The University of Sheffieldassignment help,COM1003assignment help,Java Programmingassignment help,Javaassignment help,The University of Sheffieldsolution,COM1003solution,Java Programmingsolution,Javasolution,