Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

06 09 code challenge #28

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions .gitignore

This file was deleted.

6 changes: 6 additions & 0 deletions 06_09 Code Challenge/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions 06_09 Code Challenge/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions 06_09 Code Challenge/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

109 changes: 109 additions & 0 deletions 06_09 Code Challenge/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions 06_09 Code Challenge/06_09 Code Challenge.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
Binary file not shown.
Binary file not shown.
18 changes: 18 additions & 0 deletions 06_09 Code Challenge/src/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
public class Main {

public static void main(String[] args){
Student A = new Student("Andy","Smith",3.6,2022,"Computer Science");
Student B = new Student("Eric","Homes",3.8,2024,"Math");

System.out.println("Student A first name:" + A.firstName);
System.out.println("Student A last name:" + A.lastName);
System.out.println("Student A's major:" + A.declaredMajor);

System.out.println("Student B first name:" + B.firstName);
System.out.println("Student B graduate year:" + B.yrToGrad);
B.incrementYrToGrad();
System.out.println("Student B graduate year after change: " + B.yrToGrad);
//System.out.println();
//System.out.println();
}
}
23 changes: 23 additions & 0 deletions 06_09 Code Challenge/src/Student.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
public class Student {
String firstName;
String lastName;
double GPA;
int yrToGrad;
String declaredMajor;

public Student(String firstName,
String lastName,
double GPA,
int yrToGrad,
String declaredMajor){
this.firstName = firstName;
this.lastName = lastName;
this.GPA = GPA;
this.yrToGrad = yrToGrad;
this.declaredMajor = declaredMajor;
}

public void incrementYrToGrad(){
this.yrToGrad= this.yrToGrad +1;
}
}