ISP Project
Java Eclipse Making a Calendar/Survey
What I Did
Java Eclipse
The Code For The Survey
The Survey Completed
A Similar Calendar To Mine
What I Learned
This is a example code that I put in my calendar before it got deleted:
M = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
D = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
function getBgn() {
pdy = new Date(); // today
pmo = pdy.getMonth(); // present month
pyr = pdy.getYear(); // present year
This code is used to display the dates and what Month and Year it is.
The Code of My Survey!
package ispsurvey;
import java.util.Scanner;
public class ISP_Project {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner keyboard = new Scanner (System.in);
int score = 0;
int points = 0;
System.out.println("When do you do your homework?");
System.out.println("1) When you get home");
System.out.println("2) When you recieve it");
System.out.println("3) Right before it's due");
System.out.println("4) Before school starts");
int question1 = keyboard.nextInt();
switch (question1){
case 1:
points = points + 20;
break;
case 2:
points = points + 25;
break;
case 3:
points = points + 0;
break;
case 4:
points = points + 13;
break;
}
System.out.println("The points you got from your answer has been recorded...");
System.out.println("Are you ready to move to the next question?");
System.out.println("1=Yes or 2=No?");
int after1 = keyboard.nextInt();
switch (after1){
case 1:
System.out.println("When you are taking a test what do you do?");
System.out.println("1) Start looking at the person next to you and copy their answers");
System.out.println("2) Sleep");
System.out.println("3) Focus completely on the test");
int question2 = keyboard.nextInt();
switch (question2){
case 1:
points = points + 0;
break;
case 2:
points = points + 0;
break;
case 3:
points = points + 25;
break;
}
System.out.println("The points you got from your answer has been recorded...");
System.out.println("Are you ready to move to the next question?");
System.out.println("1=Yes or 2=No?");
int after2 = keyboard.nextInt();
switch (after2){
case 1:
System.out.println("If you have a test soon what do you do to prepare?");
System.out.println("1) Study");
System.out.println("2) Take notes");
System.out.println("3) Nothing");
System.out.println("4) Work with friends");
int question3 = keyboard.nextInt();
switch (question3){
case 1:
points = points + 25;
break;
case 2:
points = points + 25;
break;
case 3:
points = points + 0;
break;
case 4:
points = points + 15;
break;
}
System.out.println("The points you got from your answer has been recorded...");
System.out.println("Are you ready to move to the final question?");
System.out.println("1=Yes or 2=No?");
int after3 = keyboard.nextInt();
switch (after3){
case 1:
System.out.println("When you have free time in class what do you do?");
System.out.println("1) Study");
System.out.println("2) Play on your device");
System.out.println("3) Read");
System.out.println("4) Talk");
}
int question4 = keyboard.nextInt();
switch (question4){
case 1:
points = points + 25;
break;
case 2:
points = points + 0;
break;
case 3:
points = points + 25;
break;
case 4:
points = points + 0;
break;
}
System.out.println("Your total points are... "+points);
}
}}}
Sources
Works Cited
"Cut & Paste 3-month calendar." Cut & Paste 3-month calendar. N.p., n.d. Web. 27 May 2014. <http://www.javascriptkit.com/script/script2/quartercalendar.shtml>.
"Learn Java Tutorial 1.1- Setting up Eclipse, Hello World." YouTube. YouTube, n.d. Web. 27 May 2014. <https://www.youtube.com/watch?v=fEApt1B8ycs>.
MLA formatting by BibMe.org.