以下是CE152的一份Java Programming assignment的题目的简单解析
Java Programming Exercise
CE152
Assignment 2021
WARNING AND ADVICE ABOUT POSSIBLE ACADEMIC OFFENCES
Your solutions should be your own unaided work. You can make use of any of the programs from
the CE152 lecture notes, support classes and the lab solutions. You may use any features from
the Java JDK API including those not covered in CE152.
You must NOT use any third-party classes (e.g. classes that are not provided as part of the Java
JDK download). If you use any other sources, you must clearly indicate this as comments in the
program, and the extent of the reference must be clearly indicated. For more information, please
see the University pages on plagiarism and the Academic Offences Procedures.
DO NOT COPY PROGRAM CODE FOR THIS ASSIGNMENT FROM ANOTHER STUDENT OR
FROM THE INTERNET OR FROM ANY OTHER SOURCES. DO NOT LET OTHER STUDENTS
COPY YOUR WORK.
Deadline: see Faser.
Submission
The assignment must be submitted via Faser. Your submission must comprise a single zip fifile
created by exporting your project as an archive. No other fifiles should be included in the zip
fifile.
You may receive a mark of zero if you fail to submit your solutions by the deadline.
Please double check that you are submitting the correct fifiles.
Extenuating Circumstances
The standard extenuating circumstances procedures will apply for those who – for circumstances
beyond their control – are prevented from submitting work before the deadline or from attending
the lab demonstration. Please see the Undergraduate Students’ Handbook for the University
policies regarding these matters.
Introduction
The assignment contains Exercise 1 [15%], Exercise 2 [20%], Exercise 3 [40%] and Exercise 4
[20%] each focusing on a set of particular topics covered in the module. An additional [5%] will
be awarded for commenting your code, adhering to the good coding practises mentioned in the
lecture and submitting your project as an archive exported from your IDE.
Overall, this assignment will constitute 50% of your total grade.
Please add variables and methods only with the specifified access modififiers. You may add additional
variables and methods you fifind convenient.
CE152 Java Programming assignment第一题
Exercise 1 [15%]
This exercise involves creating a class with variables, a constructor and methods. Additionally,
you will use arrays and control statements.
Exercise 1A [2%]
Create a class called Rocket. This class should have a private variable of type int array called
payload.
Additionally create a class called MainRocket that contains a main method.
Exercise 1B [2%]
Add a constructor that receives an int array as parameter and assigns it to payload.
Exercise 1C [5%]
Add the following methods to Rocket:
A public method called getLaunchWeight, without parameters that returns an int that
contains the sum of all items in payload.
A public method called getAverageWeight, without parameters that returns a double that
contains the mean weight of all items in payload.
A public method called getMaxWeight, without parameters that returns an int containing
the maximum weight of an item in payload.
A public method called getMinWeight, without parameters that returns an int containing
the minimum weight of an item payload.
Exercise 1D [3%]
Add a public method called printCountdown, that receives an int as parameter and returns
void. That method should print a countdown from the int provided as parameter.
For example if 10 is provided the method should print:
10
9
8
7
6
5
4
3
2
1
Lift off!
If a parameter smaller than 1 is provided the method should print:
Invalid time.
Exercise 1E [3%]
In the main method of MainRocket generate a random payload with ten elements and weights
between 0 and 100 and store them in an int array.
Print the content of the array and instantiate a Rocket object with this array as parameter.
Print the maximum, mean, minimum and sum of the payload using the corresponding methods in
Rocket.
For example:
2Payload: [76, 60, 76, 36, 49, 62, 26, 13, 97, 17]
Max: 97
Mean: 51.2
Min: 13
Sum: 512
E-mail: [email protected] 微信:shuxuejun
CE152代写Java Programming assignment代写|请认准uprivateta™
更多统计代写案例请参考另外一份统计代写案例
uprivateta™是一个服务全球中国留学生的专业代写公司
专注提供稳定可靠的北美、澳洲、英国代写服务
专注于数学,统计,金融,经济,计算机科学,物理的作业代写服务