You are on page 1of 2

CSCI 201 Assignment 2

Due Date
Submit in D2L before 10am on February 14th. You may take an extra 24 hours for a 10-point penalty. No assignments will be accepted after 10am on February 15th.

Work Alone
It is important that all work you submit for this assignment (and all assignments in this class) be your own. You may talk to other students about the assignment, but you may not exchange code. All code written for this assignment must originate from your brain and your fingertips. You may not copy code from any other source (including the Internet). Please see me if you have questions!

Coding Standards
Be sure to follow the class coding standards (available in D2L) for this assignment!

Part 1
Complete Part 4 of the last lab (Mathematics.java). Be sure to complete the last step: coding the subtraction, multiplication, and division operations and displaying the answers to the user.

Part 2
Write a Java program named Area (file name: Area.java; class name: Area). The purpose of the program is to calculate the area of a rectangle and the area of a triangle (of the same height and width). Ask the user to input the height and width as integers. Perform the following area calculations: Area of Rectangle = height x width Area of Triangle = (height x width) / 2 Finally, display the two areas to the user.

Part 3
Write a Java program named Temperature (file name: Temperature.java; class name: Temperature). The purpose of the program is to convert temperature between Celsius and Fahrenheit and vice versa. Ask the user to enter a temperature in degrees Celsius (decimal values are allowed). Convert this value to degrees Fahrenheit using the following calculation: Degrees Fahrenheit = Degrees Celsius * (9.0/5.0) + 32

Print the resulting degrees Fahrenheit to the console. Next, ask the user to input a temperature in degrees Fahrenheit. Convert this value to degrees Celsius using the following calculation: Degrees Celsius = (Degrees Fahrenheit 32) * (5.0/9.0) Print the resulting degrees Celsius to the console.

Submitting
Put all your Java files for this assignment in one folder. Right-click that folder and choose Send To -> Compressed (Zipped) Folder. Submit the resulting zip file in DropBox in D2L.

You might also like