Comp 1123 Assignment 3 solution

$24.99

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (2 votes)

question 1

Write a program called MaxInt.java which first defines two int constants. They contain the largest/smallest possible int values. Print their values. Then, add 1 to the largest value and subtract 1 from the smallest value. Print the results. Don’t just output 4 numbers. Include a short description for each one.

 

 

Question 2

Write a program called Fraction.java which requests the user to enter a numerator and denominator for a fraction. Both are int’s. Use casting to display the fraction as a double.

 

 

Question 3

PP2.8 on p. 109. Call the program Seconds.java.

Write a program that reads values representing a time duration in hours, minutes, and seconds and then prints the equivalent total number of seconds.  (For example, 1 hour, 28 minutes, and 42 seconds is equivalent to 5322 seconds.)

Question 4

PP 2.9 on p. 109. Call the program Seconds2.java.

Create a version of the previous project that reverses the computation. That is, read a value representing a number of seconds, then print the equivalent amount of time as a combination of hours, minutes, and seconds. (For example,9999 seconds is 2 hours, 46 minutes, and 39 seconds.)