Commit c9b40024 authored by Reed McDonagh's avatar Reed McDonagh

added worksheet as markdown format with links to my code

parent 7a258a45
# Worksheet for Week 1
## [exercise1](src/exercise1/javaApp.java)
**Task:** Type in the welcome program exactly as it is and get it working. Change themessage so that it reads ”I like Java” instead. Add your name as a signatureto the lower right corner.
## [exercise2](src/exercise2/javaApp.java)
**Task:** The following program was written without comments or instructions tothe user, except for a couple of input prompts:
```java
public class MyProgram {
Scanner input = new Scanner(System.in)
public void main() {
System.out.Print("Please, enter length");
double b = input.next;
double a = 1 * 1;
println("a = " + a);
}
}
```
Read through the program and figure out what it is doing. What result is itcalculating? Rewrite this program so it is easier to understand, both for theuser and for the programmer that will upgrade the program in the future(Hints add comments)
## [exercise3](src/exercise3/javaApp.java)
**Task:** Extend the simple calculator program so that it adds three numbers
## [exercise4](src/exercise4/javaApp.java)
**Task:** Write a program that reads in two numbers: an account balance and anannual interest rate expressed as a percentage. Your program should thendisplay the new balance aǒter a year. Assume that there are no deposits orwithdrawals, just the interest payment
## [exercise5](src/exercise5/javaApp.java)
**Task:** Extend the program you wrote in the previous account example so that italso displays the balance aǒter two years have elapsed.
## [exercise6](src/exercise6/javaApp.java)
**Task:** Write a program that asks the user for the radius of a circle and then com-putes the area of that circle (A) using the formula ``A= 3.142∗r∗r7``.
## [exercise7](src/exercise7/javaApp.java)
**Task:** Write a program that reads in temperature in degrees Fahrenheit and re-turns the corresponding temperature in degrees Celsius. The conversionformula is ``C= 5/9∗(F–32)``
## [exercise8](src/exercise8/javaApp.java)
**Task:** Write a program that converts a metric weight in kilograms to the corre-sponding English weight in pounds. The conversion factor is 1 kilogram = 2.2 pounds.
## [exercise9](src/exercise9/javaApp.java)
**Task:** Write a program that takes the age of five kids as input and computes theaverage age of the five kids as outputs.
## [exercise10](src/exercise10/javaApp.java)
**Task:** Identify the syntax errors in the following program:
```java
public class {
public Static void main(String[] args) {
system.out.println( I want this program to compile)
}
```
## [exercise11](src/exercise11/javaApp.java)
**Task:** Write a program that displays your name, major and email, each on separate lines.
## [exercise12](src/exercise12/javaApp.java)
**Task:** Upgrade the previous program to include a blank line between each line.
## [exercise13](src/exercise13/javaApp.java)
**Task:** Write a program that displays your initials in big letters made of asterisks.
(Hint: use series ofprintlncommands, each printing one row of asterisks)
## [exercise14](src/exercise14)
**Task:** Develop a separate application for each one of the following conversion.
```
(a)1 mile = 1.609 kilometres
(b)1 mile = 39.370 inches
(c)1 tonne = 1000 kilograms
(d)1 pound = 0.454 kilograms
(e)1 gallon = 8 pints
(f)1 litre = 1.760 pints
(g)1 gallon = 4.546 litres
```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment