CSC 220 – Lab 4

$30.00

Category: You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (2 votes)

Java programs:
1. Write a Java application Convert.java that converts miles to kilometers. (One
mile equals 1.60935 kilometers). Use the command line argument to read the
mile’s value from the user as a floating point value.
2. Write a Java program Calculate.java that prompts for and uses scanner to
read a value representing a number of seconds, and then print the equivalent
amount of time as a combination of hours, minutes, and seconds. (For example,
9999 seconds is equivalent to 2 hours, 46 minutes, and 39 seconds).
Compiling and running Java programs (reminder):
1. Open a terminal window. Use the cd command to change to the directory in
which you saved your program.
2. Use the javac command to compile your program:
javac Convert.java
3. If you don’t get any errors, use the java command to run your program:
java Convert
4. Repeat the steps for the second program.
5. JAR all your files, including *.java and *.class files into a file called
Lab4.jar. When you’re done, upload the JAR file to Canvas.
6. Submit the jar file using canvas. If you’re not done before the end of the class,
you have until the deadline to finish and upload your work to Canvas. No
extensions.
Note:
1. Add a comment to the beginning of each of your programs containing your name,
the name of the course, and the title of the assignment:
/***********************
* Programmer: your name
* Instructor: Dr. Tao
* Course: CSC220-02
* Lab4 Part1 etc.
***********************/
2. Make sure you indent and comment your code based on the examples in the
textbook.