IMAT4038 By Scottie MAN
IMAT4038 Laboratory One
In this laboratory, we are going to develop a java program to ask user to input three integers, then the program will sort and print out those three integers in ascending order.
Deliverable
Copyright By PowCoder代写 加微信 powcoder
You are required to upload your source code of this laboratory to SOUL. The submitted source code must implement all the functions described in the “Tasks” section.
File Name Convention
In order to easily distinguish the java code(s) you submitted to SOUL, you must prefix your file names and class names with a capital letter “S” followed by your student ID as shown in following examples. In case you need to submit more than one java code file, please “zip” them up and use your student ID as the zip-file name.
e.g. Student ID: 20158967
Example 1 – submitting one java code file Java file name: S20158967.java
Java class name: S20158967
Example 2 – Submitting more than one java code file
Zip file name: S20158967.zip
Java file name: S20158967_main.java, S20158967_aa.java, S20158967_bb.java, … Java class name: S20158967_main, S20158967_aa, S20158967_bb, …
IMAT4038 By Scottie MAN
Task 1 – Asking user to input three integers (Marks: 40)
Your java program should prompt user to input the first integer. After the user enter the integer and hit “Enter”, your program should then prompt user to input the second integer. This will keep going until the user finish entering the third integer.
Hint: You should declare three integers to store user inputs. Use “System.out.println()” to print messages to the command-line interface. Use codes covered in lecture 2 to handle keyboard inputs.
You can refer to the screenshots below as guidance:
Task 2 – Sort those three integers in ascending order and print them out (Marks: 60)
After receiving those three integers, the program should sort them in ascending order and print the results to the command-line interface.
Hint: Use “if”, “else if”, “else” conditional statement, comparison operators (e.g. ==, !=, >, >=, <, <=) , and, Boolean operators (e.g. &&, ||, !), to sort those three integers.
IMAT4038 By Scottie MAN You can refer to the screenshot below as guidance:
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com