国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

代寫COMP1721、代做java程序設計

時間:2024-02-21  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



COMP1721 Object-Oriented Programming
Coursework 1: Creating & Using Classes
1 Introduction
This assignment assesses your ability to implement classes and use them in a small program.
Consider the GPS data generated by a device such as a mobile phone. Your current location is represented
as a point, consisting of a timestamp, a longitude (in degrees), a latitude (in degrees) and an elevation above
sea level (in metres). Movement while GPS is enabled generates a track: a sequence of points representing
successive samples from the GPS sensor.
Your main task is to implement classes named Point and Trackthat can be used to represent points and
tracks, along with a small program that demonstrates the use of these classes. Figure 1 is a UML class
diagram showing the required features of, and relationship between, the two classes.
Figure 1: Classes used in Coursework 1
2 Preparation
2.1 Files Needed
Download cwk1files.zip from Minerva and unzip it. The best way of doing this on a SoC Linux machine
is in a terminal window, via the command
unzip cwk1files.zip
This will give you a directory named cwk1, containing all of the files you need.
Remove the Zip archive, then study the files in cwk1. In particular, examine the file README.md , as this
provides guidance on how to run the tests on which your mark will be largely based.
Note: all code should be written in the .java files provided in the src/main/javasubdirectory.
2.2 Method Stubs
A suite of unit tests is provided with the files for this coursework. These tests are used to verify that the
methods of the two classes have been implemented correctly. You will be awarded one mark for each test
that passes. The starting point for the coursework is to make sure that the tests compile and run.This means
that it is necessary to begin by creating method stubs: dummy versions of each method that do just enough
that the tests will compile successfully.
Refer to Figure 1 for details of the stubs that are required, and note the following:
• All stubs should have the parameter lists and return types shown in the UML diagram
• Constructors should be implemented as empty methods (nothing inside the braces)
• Any method that returns a numeric value should just return a value of zero
• Any method that returns an object should just return the valuenull
1
Note also that thePoint class references a class from the Java standard library namedZonedDateTime . This
is part of Java’s standard Date/Time API, defined in the package java.time—see the API documentation
for further details. To use it, you will need to add animportstatement to the start of Point.java:
import java.time.ZonedDateTime;
When you have created stubs for all the methods shown in Figure 1, you can attempt to compile and run the
tests using Gradle. See README.md for full details of how Gradle can be used.We simply note here that you
can run the tests from a Linux or macOS command line with
./gradlew test
Omit the ./ from the start of this command if you are working from the Windows command prompt, or use
.\gradlew.batto invoke Gradle if you are using Windows Powershell.
3 Basic Solution
This is worth 18 marks.
Please read all of the subsections below before starting work. We also recommend that you gain some
experience of implementing classes by doing the relevant formative exercises before you start.
3.1 PointClass
To complete the implementation of thePoint class, make the following changes toPoint.java:
• Add a field to represent the timestamp, of typeZonedDateTime(see below).
• Add fields to represent longitude, latitude and elevation, all of typedouble.
• Add code to the constructor that initialises the fields to the values supplied as method parameters,
with validation done for longitude and latitude (see below).
• Modify the ‘getter’ methods (getTime(), getLongitude(), etc) so that they return the relevant field
values, instead of the defaults like 0 ornull that were returned by the stubs.
• Change toString() so that it returns a string representation of a Point looking like this:
(-1.54***, 53.80462), 72.5 m
(The values here are longitude, then latitude, then elevation. The string should be formatted exactly
as shown here. Note the specific number of decimal places being used for each number!)
Make sure that it is not possible to create a Point object with an invalid latitude or longitude. Use the
constants provided in the class to help you with this, and throw an instance of the provided exception class,
GPSException, if inappropriate coordinates are supplied.
As you replace each method stub with its correct implementation, rerun the tests.You should see a growing
number of tests changing in status from FAILED to PASSED.
3.2 TrackClass
For the basic solution, make the following changes toTrack.java:
• Add a field suitable for storing a sequence ofPoint objects.
• Modify the constructor that take a string as its parameter, so that it initialises the field used to store
the Point objects and then calls the readFile() method.
• Add to readFile() some code that will read data from the file with the given filename, createPoint
objects from this data and then store those Point objects as a sequence (see below).
• Modify the size() method so that it returns the number of points currently stored in the track.
• Modift the get() method so that it returns thePoint object stored at a given position in the sequence.
Position is specified as an int parameter and should be validated (see below).
• Modify the add()method so that it adds a new point, supplied as a method parameter, to the end of
the track.
2
The readFile() method will need to read CSV files, examples of which can be found in thedatadirectory.
It should use a Scannerto do this. A good approach here would be to read the file line-by-line, split up the
line on commas, then parse each item separately.The lectures discuss how a file can be read in this manner.
You can use the static methodparse() of the ZonedDateTimeclass to parse the timestamp.
readFile() should NOT catch any exceptions that might occur during reading of the file. It will need an
exception specification, declaring that anIOExceptioncould happen if the named file cannot be accessed.
Your implementation should also explicitly throw a GPSExceptionif any record within the file doesn’t
contain the exact number of values needed to create a Point object. Note that you do not need to include
GPSExceptionas part of the method’s exception specification, because this exception class is not one of
Java’s ‘checked exception’ types.
The get() method should use the int value passed to it as an index into the sequence ofPoint objects, but
before doing that the method should check this int value and throw an instance of GPSExceptionif it is
not within the allowed range. Once again, note that there is no need to include an exception specification
for this.
As you replace each method stub with its correct implementation, rerun the tests.You should see a growing
number of tests changing in status from FAILED to PASSED.
4 Full Solution
This is worth a further 12 marks. It involves completing the implementation of the Trackclass and then
writing a small program that uses the two classes.
4.1 TrackClass
If you’ve completed the basic solution, there should be four remaining method stubs inTrack.java, which
should be modified as indicated below.
• Modify lowestPoint() and highestPoint() so that they return thePoint objects having the lowest
and highest elevations, respectively.
• Modify totalDistance() so that it returns the total distance travelled in metres when moving from
point to point along the entire length of the track (see below).
• Modify averageSpeed()so that it returns the average speed along the track, in metres per second
(see below)
All four of these methods should throw aGPSExceptionif the track doesn’t contain enough points to do the
necessary computation.
To implementtotalDistance(), you will need to compute ‘great-circle distance’ between adjacent points
on the track. A method to do this already exists in the Point class. Given two Point objects, pand q, the
great-circle distance in metres between them (ignoring elevation) will be given by
double distance = Point.greatCircleDistance(p, q);
To implement averageSpeed()you will need to compute the amount of time that has passed between
measurements for the first and last points on the track.You can use theChronoUnittype for this: specifically,
the between()method, which can be called on the object ChronoUnit.SECONDS to yield the time interval
in seconds between twoZonedDateTimeobjects.
Note: the ChronoUnitclass is part of Java’s standard Date/Time API. To use it, you will need to add an
importstatement to Track.java:
import java.time.temporal.ChronoUnit;
As you replace each method stub with its correct implementation, rerun the tests. Your goal here is to end
up with all 26 tests passing. If you achieve this, you can be assured of getting at least 26 marks for the
coursework.
4.2 TrackInfoProgram
Edit the file TrackInfo.java. In this file, create a small program that creates a Trackobject from data in
a file whose name is provided as a command line argument. You program should display: the number of
points in the track; its lowest and highest points; the total distance travelled; and the average speed.
3
Requiring the filename as a command line argument means that it has to be supplied as part of the command
that runs the program; the program should not be prompting for input of the filename once it has started
running!
For example, if running the program directly within a terminal window, you would need to enter
java TrackInfo walk.csv
Note that you can run the program with a suitable command line argument via Gradle:
./gradlew run
This will run the program on the file data/walk.csv.
You can also check whether your program behaves correctly when no filename has been supplied on the
command line, by doing
./gradlew runNoFile
When your program is run on walk.csv, it should generate output very similar to this:
194 points in track
Lowest point is (-1.53637, 53.79680), 35.0 m
Highest point is (-1.5****, 53.80438), **.6 m
Total distance = 1.**4 km
Average speed = 1.441 m/s
Your output doesn’t need to be identical in layout, but it should provide all the data shown here, and numbers
should be formatted with the number of decimal places shown in this example.
If no filename is supplied on the command line, your program should print a helpful error message and then
use System.exit()to terminate, with a value of zero for exit status.
The program should intercept any exceptions that occur when reading from the file or performing computation. The program should print the error message associated with the exception and then use System.exit()
to terminate, with a non-zero value for exit status.
5 Advanced Tasks
For a few extra marks, implement ONE of two options suggested below.
These tasks are more challenging and will require additional reading/research. They are also worth
relatively few marks. Attempt them only if you manage to complete the previous work fairly quickly
and easily.
5.1 Option 1: KML Files
This is worth an additional 2 marks.
1. Add to theTrackclass a new method namedwriteKML. This should have a singleString parameter,
representing a filename. It should write track data to the given file, using Google’s Keyhole Markup
Language format.
2. Edit ConvertToKML.javaand add to it a program that converts a CSV file of track data into a KML
file. The program should expect filenames for these two files as command line arguments, with the
CSV file as the first argument and the KML file as the second argument. It should deal with missing
arguments and exceptions in the same way asTrackInfo.
3. Generate a KML file for the track represented bywalk.csv. You can do this with Gradle, using
./gradlew runKML
This will generate its output in a file walk.kml, in the build subdirectory.
Visualise the file by uploading it to Google Maps (see Figure 2) or by importing it into Google Earth.
Grab a screenshot of the result and place it in the cwk1directory so that it will be included in your
submission.
4
5.2 Option 2: Elevation Plot
This is worth an additional 4 marks.
1. Investigate JavaFX by reading David Eck’s online Java Notes and other online sources.In particular,
you will need to research how charts can be drawn in JavaFX.
2. Edit build.gradle and uncomment the various commented-out parts relating to JavaFX.
3. Edit the file PlotApplication.java and implement in this file a JavaFX application that plots
elevation as a function of distance along a track. As with TrackInfo, the file of track data should be
specified as a command line argument.
You can run your application onwalk.csvvia Gradle, with this command:
./gradlew runPlot
Figure 3 shows an example of what the plot could look like.
6 Submission
Use Gradle to generate a Zip archive containing all the files that need to be submitted:
./gradlew submission
This produces a file named cwk1.zip. Submit this file to Minerva, via link provided for this purpose. You
can find this link in the ‘Assessment and Feedback’ section, under ‘Submit My Work’.
Note: be careful to submit the correct Zip archive here! Make sure you do not accidentally submit the Zip
archive of provided files . . .
The deadline for submissions is 14.00 Wednesday 6th March 2024. The standard university penalty of 5%
of available marks per day will apply to late work, unless an extension has been arranged due to genuine
extenuating circumstances.
Note that all submissions will be subject to automated plagiarism checking.
7 Marking
40 marks are available for this assignment.
A basic solution can earn up to 24 marks (60% of those available); a full solution can earn up to 36 marks
(**% of those available).
Mark allocation breaks down as follows:
18 Tests for basic solution
8 Tests for full solution
4 TrackInfoprogram
4 Advanced task
6 Sensible use of Java and coding style
請加QQ:99515681  郵箱:99515681@qq.com   WX:codehelp 

掃一掃在手機打開當前頁
  • 上一篇:代寫MLDS 421: Data Mining
  • 下一篇:代做EEE3457編程、代寫Java/Python程序語言
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務 管路流場仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務 管路
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真技術服務
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲勞振動
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲
    流體cfd仿真分析服務 7類仿真分析代做服務40個行業
    流體cfd仿真分析服務 7類仿真分析代做服務4
    超全面的拼多多電商運營技巧,多多開團助手,多多出評軟件徽y1698861
    超全面的拼多多電商運營技巧,多多開團助手
    CAE有限元仿真分析團隊,2026仿真代做咨詢服務平臺
    CAE有限元仿真分析團隊,2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗證碼 寵物飼養 十大衛浴品牌排行 suno 豆包網頁版入口 wps 目錄網 排行網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    日韩精品一区二区三区色欲av| av资源站久久亚洲| 精品无码一区二区三区爱欲| 日本国产一区二区三区| 亚洲wwwav| 亚洲图片欧洲图片日韩av| 久久99国产精品久久久久久久久| 国产精品久久精品视| 日韩中文字幕在线播放| 国产av无码专区亚洲精品| 九色91在线视频| 日韩中文字幕第一页| 久久久久久久午夜| 久久精品视频亚洲| 美日韩精品免费视频| 欧美激情第1页| 亚洲最大福利网| 日日夜夜精品网站| 品久久久久久久久久96高清| 欧美日韩一区二区三区在线视频| 欧美性大战久久久久xxx| 欧美日韩激情四射| 国产在线视频在线| 97免费中文视频在线观看| 亚洲 自拍 另类小说综合图区| 午夜免费福利小电影| 日本精品一区二区三区视频| 欧美有码在线观看| 国产日韩av高清| 91精品国产高清久久久久久91| 久久精品网站视频| 国产精品久久久久久久久久久新郎| 精品国产成人av在线免| 亚洲精品一区国产精品| 日韩精品不卡| 国产免费亚洲高清| 国产精品91视频| 久久久精品影院| 在线视频不卡一区二区| 国产精品999999| 国产精品福利在线| 日本亚洲欧美成人| 国产精品一区二区在线观看| 爽爽爽爽爽爽爽成人免费观看| 久久国产色av| 欧美在线视频a| 91精品国产高清久久久久久91裸体| 日韩视频精品在线| 中文字幕制服丝袜在线| 欧美中日韩一区二区三区| 国产精品亚洲第一区| 久久国产精品高清| 欧美激情18p| 欧美高清性xxxxhdvideosex| 91精品免费久久久久久久久| 国产精品久久久对白| 日本精品免费| av不卡在线免费观看| 国产精品麻豆免费版| 色视频一区二区三区| 国产免费色视频| 久久精品最新地址| 日日碰狠狠丁香久燥| 国产伦精品一区二区三区视频免费| 日韩有码在线电影| 宅男一区二区三区| 欧美久久在线| 久久精品国产综合精品| 亚洲精品中文字幕在线| 国产三级精品网站| 国产精品免费观看在线| 日韩欧美国产综合在线| 欧美激情精品久久久久久变态| 精品日本一区二区| 日韩中文理论片| 青青影院一区二区三区四区| 国产成人精品a视频一区www| 亚洲精品高清国产一线久久| 成人国产一区二区| 欧美激情18p| 国产精品一级久久久| 国产精品嫩草影院一区二区| 欧美亚洲一级二级| 久久久噜噜噜久久中文字免| 欧美一级视频一区二区| 久久久中文字幕| 无码人妻精品一区二区蜜桃百度| 国产噜噜噜噜噜久久久久久久久| 国产精品久久一区二区三区| 欧美日韩亚洲一二三| 国产精品视频在线免费观看| 欧美日韩大片一区二区三区| 精品国产一区二区三区在线观看 | 久久久一本精品99久久精品66| 色综合视频一区中文字幕| 国产综合欧美在线看| 国产精品国产三级欧美二区| 国模一区二区三区私拍视频| 国产精品第二页| 国产资源在线视频| 国产精品久久婷婷六月丁香| 经典三级在线视频| 国产精品久久精品| 国产一区二区三区免费不卡| 久久国产精品网站| 国产精品一区在线观看| 色综合五月天导航| 97国产一区二区精品久久呦| 天天综合五月天| 国产妇女馒头高清泬20p多| 日本精品免费一区二区三区| 国产成人久久久精品一区| 好吊色欧美一区二区三区视频| 欧美精品免费播放| 国产精品99久久久久久白浆小说| 日本欧美色综合网站免费| 日韩亚洲综合在线| 精品一区二区视频| 亚洲一区二区中文| www欧美日韩| 国产精品亚洲自拍| 性色av一区二区咪爱| 日韩亚洲欧美中文在线| 国产自产在线视频一区| 亚洲一区二区免费在线| 日韩有码在线播放| 国产热re99久久6国产精品| 天天综合狠狠精品| 国产精品视频播放| 99久久免费国| 精品99在线视频| 亚洲精品偷拍视频| 国产精品视频入口| www.男人天堂网| 日av在线播放中文不卡| 精品国产aⅴ麻豆| 91精品久久久久久久久久久久久| 日韩亚洲欧美精品| 久久99久久99精品免观看粉嫩| 国产精品99久久久久久久久| 麻豆中文字幕在线观看| 日韩av电影国产| 久99久在线视频| 色狠狠久久aa北条麻妃| 国产精品一区视频网站| 欧美日韩精品中文字幕一区二区| 一区二区三区四区免费观看| 久久久久久久久久久福利| 99视频精品全部免费看| 免费一级特黄毛片| 日韩欧美一区二| 自拍另类欧美| 国产精品免费一区豆花| 久久精品第九区免费观看| 丰满少妇久久久| 免费久久久久久| 欧美在线视频网| 日本中文字幕一级片| 在线一区高清| 国产精品国产三级国产专播精品人 | 久久久成人精品视频| 超碰免费在线公开| 精品一区二区久久久久久久网站| 日韩av免费在线看| 又粗又黑又大的吊av| 亚洲a级在线播放观看| 在线视频福利一区| 欧美精品一区二区免费| 国产精品免费成人| 久久精品2019中文字幕| 久久精品99国产| 久久免费视频这里只有精品| 成年丰满熟妇午夜免费视频| 国产欧美一区二区白浆黑人 | 亚洲精品一区二区毛豆| 精品久久一区二区三区蜜桃| 日韩在线播放视频| 国产不卡一区二区在线观看| 成人免费福利视频| 国产一区一区三区| 狠狠综合久久av| 韩日精品中文字幕| 国内一区二区三区在线视频| 男人天堂av片| 男人的天堂99| 国内揄拍国内精品少妇国语| 黄频视频在线观看| 欧美日韩视频在线一区二区观看视频| 日本一区二区三区四区在线观看| 三级三级久久三级久久18| 日本在线观看不卡| 日本a级片在线观看| 日韩欧美一区二区三区四区五区| 日韩一区不卡| 日韩av综合在线观看| 日本视频一区在线观看| 日本久久久久久| 欧美日韩国产综合在线| 免费精品视频一区二区三区| 日本一区二区免费高清视频|