加勒比久久综合,国产精品伦一区二区,66精品视频在线观看,一区二区电影

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

代寫COMP1721、代做java程序設(shè)計

時間:2024-02-21  來源:合肥網(wǎng)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 

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

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務(wù)-企業(yè)/產(chǎn)品研發(fā)/客戶要求/設(shè)計優(yōu)化
    有限元分析 CAE仿真分析服務(wù)-企業(yè)/產(chǎn)品研發(fā)
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計優(yōu)化
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計優(yōu)化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發(fā)動機性能
    挖掘機濾芯提升發(fā)動機性能
    海信羅馬假日洗衣機亮相AWE  復(fù)古美學(xué)與現(xiàn)代科技完美結(jié)合
    海信羅馬假日洗衣機亮相AWE 復(fù)古美學(xué)與現(xiàn)代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
  • 短信驗證碼 目錄網(wǎng) 排行網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號-3 公安備 42010502001045

    亚洲深爱激情| 欧美激情一区| 亚洲精品成人影院| 日韩va亚洲va欧美va久久| 日韩av免费| 羞羞答答国产精品www一本| 国产三级精品三级在线观看国产| 日韩国产精品91| 日本午夜大片a在线观看| 激情久久一区| 美女久久精品| 欧美黄色一级| 老司机午夜精品99久久| 日韩成人综合| 日韩一区精品字幕| 亚洲电影影音先锋| 荡女精品导航| 日韩电影在线观看网站| 欧美国产高清| 国产欧美亚洲一区| 麻豆精品蜜桃| 日韩伦理在线一区| 亚洲综合99| 精品日韩毛片| 三级小说欧洲区亚洲区| 警花av一区二区三区| 成人国产精品一区二区网站| 久久亚洲资源中文字| 中文字幕成在线观看| 亚洲免费黄色| 天天天综合网| 91精品国产91久久久久久黑人| 日韩精品成人| 亚洲aaa级| 国产麻豆精品| 国产精品va| 麻豆成人在线观看| 日韩高清一区二区| 99精品免费| 国产日韩欧美一区| 四虎精品一区二区免费| 日本电影久久久| 精品成人免费一区二区在线播放| 亚洲风情在线资源| 亚洲午夜天堂| 少妇一区视频| 欧美一区=区三区| 欧美一级免费| 日韩福利在线观看| 一区二区三区国产盗摄| 成人亚洲免费| 欧美一级视频| 日韩国产欧美在线观看| 国产日韩欧美一区二区三区在线观看| 日本黄色免费在线| 在线亚洲成人| 亚洲欧美bt| 免费视频一区二区| 成人黄色av| 成人欧美一区二区三区的电影| 色综合色综合| 欧美国产大片| 色综合天天色| 国产日韩一区| 综合久草视频| 亚洲精品**不卡在线播he| 日韩有码一区| 欧美亚洲tv| 国产综合网站| 奶水喷射视频一区| 一区二区三区四区日本视频| 亚洲天堂一区二区| 日韩和欧美一区二区| 999精品视频在线观看| 日韩成人一级大片| 美女av一区| 精品1区2区3区4区| 狼人综合视频| 三级精品在线观看| 欧美日韩播放| 精品久久一区| 一本一本久久| 亚洲播播91| 在线看片一区| 经典三级久久| 欧美成人日韩| 欧美激情偷拍自拍| 国产亚洲欧美日韩精品一区二区三区 | 91欧美日韩在线| 国产真实久久| аⅴ资源天堂资源库在线| 精品九九久久| 亚洲女娇小黑人粗硬| 99精品视频在线观看播放| 亚洲精华国产欧美| www.国产精品| 久久99性xxx老妇胖精品| 精品欧美午夜寂寞影院| 99香蕉国产精品偷在线观看 | 五月天久久久| 亚洲黄色网址| 欧美精品导航| 福利电影一区| 三级欧美韩日大片在线看| 天堂av在线网| 成人午夜888| 在线视频观看日韩| 四虎成人精品永久免费av九九| 久久精品国产成人一区二区三区 | 日韩1区2区| 六月丁香综合在线视频| 99久久婷婷国产综合精品青牛牛| 黄色av成人| 国产精品亚洲成在人线| 日韩精品亚洲aⅴ在线影院| 91九色精品国产一区二区| 美女福利一区二区三区| 国产精品欧美一区二区三区不卡| 香蕉久久精品| 色偷偷色偷偷色偷偷在线视频| 欧美影院精品| 欧美阿v一级看视频| 亚洲精品第一| 欧美三级视频| 国产精品伦理久久久久久| 午夜亚洲福利| 婷婷亚洲综合| 国产精品久久久久久久久久妞妞| 久久爱www.| 色一区二区三区四区| 国产精品一区二区精品| 欧美日韩日本国产亚洲在线| 精品久久福利| 私拍精品福利视频在线一区| 深夜成人在线| 日韩免费精品| 蜜臀精品一区二区三区在线观看 | 国产精品红桃| 91超碰国产精品| 老司机午夜精品99久久| 欧美+日本+国产+在线a∨观看| 欧美天堂在线| 神马日本精品| 精品久久毛片| 国产一区日韩一区| 日日欢夜夜爽一区| 午夜精品免费| 亚洲国产精品第一区二区三区| 亚洲国产专区| 免费在线成人| 九九综合九九| 一区二区三区四区日韩| 亚洲一区欧美激情| 欧美日韩爱爱| 天堂中文在线播放| 欧美巨大xxxx| 一本综合久久| 99国产精品视频免费观看一公开 | 欧美午夜三级| 极品少妇一区二区三区| 亚洲精品一级| 久久福利毛片| 日本强好片久久久久久aaa| 日韩欧美视频| 亚洲成av人片一区二区密柚 | 日韩精品一级| 欧美天堂视频| 99热在线成人| 综合一区在线| 国产精品久久久乱弄| 红杏一区二区三区| 免费在线亚洲欧美| 宅男噜噜噜66一区二区| 精品国产亚洲一区二区在线观看 | 日韩精品一级中文字幕精品视频免费观看| 欧美猛男男男激情videos| 久九九久频精品短视频| 久久精品99久久无色码中文字幕| 麻豆91在线看| 丝袜美腿成人在线| 大香伊人久久精品一区二区| 日韩精品色哟哟| 米奇777在线欧美播放| 国产成人精品福利| 亚洲麻豆av| 色黄视频在线观看| 亚洲精品午夜av福利久久蜜桃| 国产午夜久久av| 亚洲精品在线影院| 日韩午夜免费| 欧美三级午夜理伦三级小说| 亚洲影视一区二区三区| www.色在线| 在线免费观看日本欧美爱情大片| 精品视频在线观看免费观看 | 日韩综合小视频| 中文在线8资源库| 亚洲经典在线看| 九九热播视频在线精品6| 国产一区二区欧美|