new semester, new repo structure

This commit is contained in:
2023-01-10 11:59:05 -06:00
parent 0a76658f85
commit ba6de6e18e
725 changed files with 1199 additions and 103 deletions

View File

@@ -0,0 +1,29 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package lab15_calebfontenot;
/**
*
* @author caleb
*/
public class Array3 {
public static void main(String[] args)
{
int[] values = new int[5];
//Init array with correct value of i plus the value of the previous array element
for (int i = 1; i < values.length; i++) {
values[i] = i + values[i - 1];
}
// put in the first array element the second plus the last array elements
values[0] = values[1] + values[values.length -1];
// print the array
for (int i = 0; i < values.length; i++) {
System.out.println(values[i]);
}
}
}