This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Saurish Srivastava: May 19 2020: Purpose of the program: calculates information about orders of shirts and pants. All orders have a quantity and a color.*/ | |
package com.finalexam; | |
import java.util.ArrayList; | |
public class Orders { | |
public static void main(String[] args) { | |
/* Define variables and ArrayList */ | |
int numberOfShirts = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.finalexam; | |
public class Clothing { | |
public int quantity; | |
public String color; | |
public Clothing() { | |
quantity = 0; | |
color = ""; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.saurishsrivastava; | |
public class Account { | |
private long number = 0; | |
private double balance = 0.0; | |
private java.util.Date dateCreated; | |
public Account() { | |
this.number = 0; | |
this.balance = 0.0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.saurishsrivastava; | |
/* name: Saurish Srivastava; locker puzzle, will determine whether or not the locker is opened after a series of students opening it: 10 PM on 24 March 2020 */ | |
public class LockerPuzzle { | |
/** | |
* Main method | |
*/ | |
public static void main(String[] args) { | |
/* create the Locker array */ | |
boolean[] lockers = new boolean[101]; // create a locker array of 101 booleans (we will get rid of the 0th boolean) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.saurishsrivastava; | |
/* name: Saurish Srivastava; strings and loops - part 2: displays total number of items, average price, and standard deviation of the prices given by user */ | |
/* import used packages */ | |
import java.util.ArrayList; | |
import java.util.Scanner; | |
public class Statistics { | |
/** | |
* Main method |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.saurishsrivastava; | |
/** part 3: this program is used to take two time intervals and compare them with a series of calculations. */ | |
/** import used packages */ | |
import java.util.Scanner; | |
public class Intervals { | |
/** Main method */ | |
public static void main(String[] args) { | |
/** declare variables and initialize Scanner */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.saurishsrivastava; | |
public class Organization { | |
public static void main(String[] args) { | |
/** Books **/ | |
Book book1 = new Book("Talon"); | |
book1.setAuthor("Julie Kagawa"); |