COMP 110

Lab 1

20 points

Assigned:   Tuesday, Sep 1

DUE:          Wednesday, September 9 at 11:55 PM

Description

This lab is to ensure you can declare variables, perform basic mathematic functions, and print a variable with in a string in your own Java program. You are responsible for doing the following:

·         Create a Java Project in Eclipse named Lab1.

·         Create a class in your project named Lab1.

o   This should also create the file Lab1.java.

·         Create a main method in your Lab1.java file.

·         Declare two integers – call them num1 and num2 (and give them values such that num2 > num1)

·         Add the two numbers

·         Multiply the two numbers

·         Divide num2 by num1

·         Calculate num2 % num1

·         Display the following on screen (replace num1num2sumproduct, quotient, and remainder with the corresponding numbers):

o   The two integers are: num1 and num2.

o   Their addition is: sum

o   Their product is: product

o   The quotient is: quotient

o   The remainder is: remainder 

Run your program to test that it works. Don't forget to change the header at the top of the program to write your name and any other information about the program.

Grading

How to submit the lab