Skip to content

Commit 73c792d

Browse files
author
=
committed
Project file structure and comments
0 parents  commit 73c792d

File tree

6 files changed

+102
-0
lines changed

6 files changed

+102
-0
lines changed

.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

JavaIntro3Debrief.iml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4">
3+
<component name="NewModuleRootManager" inherit-compiler-output="true">
4+
<exclude-output />
5+
<content url="file://$MODULE_DIR$">
6+
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
7+
</content>
8+
<orderEntry type="inheritedJdk" />
9+
<orderEntry type="sourceFolder" forTests="false" />
10+
</component>
11+
</module>
Binary file not shown.

src/com/example/main/Main.java

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
package com.example.main;
2+
3+
import java.util.Arrays;
4+
5+
class Main {
6+
public static void main(String[] args) {
7+
8+
System.out.println("Welcome to our Java Unit 3 Closing CFU");
9+
10+
/*
11+
Some activities for Array
12+
*/
13+
14+
//create an array (not an ArrayList) called favoriteColors that holds five strings with your favoriteColors and print the entire array to the screen.
15+
16+
//Change the third element of facoriteColors to a different color and print that element to the sceen
17+
18+
//Declare and initialize and array of type int called numbers to hold 1000 elements (this should be used later in the loop exercise)
19+
20+
//ArrayList
21+
//Declare and initialize an ArrayList so that it holds values of type <Double>.
22+
23+
//Using the .add() method, add 5 decimal values to the ArrayList and print it to the screen
24+
25+
//Using the .remove() method, remove the 3rd value in the ArrayList.
26+
27+
//Print ArrayList to the screen.
28+
29+
//Now change the last element in the ArrayList and print the new element to the screen
30+
31+
32+
/*
33+
Some activities for Loops
34+
*/
35+
// write a for loop that prints out numbers 1-1000 and saves these numbers to the empty array you created earlier
36+
37+
// write a while loop that prints the elements of the array you used in the previous exercise. Take care to avoid infinite looping!
38+
39+
//write a do-while loop that does the same.
40+
41+
// write an enhanced for loop that iterates over this array and prints the result of that number modulus(%) 3
42+
43+
44+
/*
45+
Some activities for String methods
46+
*/
47+
// Create two String variables, one holding "Hello" and one holding "world"
48+
49+
50+
// using String methods, concatenate these strings together with a space between them so that it reads "Hello world" and save the resulting String to a new variable
51+
52+
53+
// then, create a for loop that iterates over your new String and prints each letter out using sout
54+
55+
56+
57+
/*
58+
Combination Exercises
59+
*/
60+
61+
62+
// Create a variable that stores a String with the value "Testing out String methods"
63+
64+
65+
// Use the String's .split() method with the input of '\s' save an array containing each word of your String variable
66+
67+
68+
// Using a loop of your choosing, loop through the array of strings and print each word to the screen in all caps, along with its length
69+
70+
71+
// CHALLENGE: search the Oracle Documentation to find out how to sort an array, then print the sorted array to the string
72+
73+
}
74+
}

0 commit comments

Comments
 (0)