Odgovore na pitanja, program i testiranje sam uradio! Problem mi je sada opis programa! Kako da opisem program kako radi i kako sam ga ja napravio!? Nisam to radio nikad pre a ovaj nastavnik sto mi predaje ovde kompjutere i nije neki a i ne zeli da uskoci i da neki savet!
import java.util.Scanner;
import java.lang.String;
class Project{
public static void main(String args[])
{
//declaring the variables
int iMales=0, iFemales=0, iAge=0, i0_25years=0, i26_45years=0, i46onwards=0, iYes1=0, iNo1=0, iNR1=0,
iYes2=0, iNo2=0, iNR2=0, iYes3=0, iNo3=0, iNR3=0, iNumppl, iTotal1=0, iTotal2=0;
String sGender, sInsert1, sInsert2, sInsert3, sInsert4;
Scanner myScanner = new Scanner(System.in);
//Start of project

do{
System.out.println("Please enter the number of interogated");
iNumppl = myScanner.nextInt();
for(int icounter=0;icounter<iNumppl;icounter++)
{
System.out.println("Please choose your gender (M) for males & (F) for females ");
sGender = myScanner.next();
if (sGender.equalsIgnoreCase("M"))
iMales+=1;
else
iFemales+=1;
iTotal1 = (iMales + iFemales);
System.out.println("Please input your age");
iAge = myScanner.nextInt();
if (iAge<26)
i0_25years+=1;
else if ((iAge>=25)&(iAge<46))
i26_45years+=1;
else if (iAge>=46)
i46onwards+=1;
iTotal2 = (i0_25years + i26_45years + i46onwards);
System.out.println("Question 1: Input (Y) for Yes, (N) for No or (NR) for No Response ");
sInsert1 = myScanner.next();
if (sInsert1.equalsIgnoreCase("Y"))
iYes1+=1;
else if (sInsert1.equalsIgnoreCase("N"))
iNo1+=1;
else if (sInsert1.equalsIgnoreCase("NR"))
iNR1+=1;
System.out.println("Question 2: Input (Y) for Yes, (N) for No or (NR) for No Response ");
sInsert2 = myScanner.next();
if (sInsert2.equalsIgnoreCase("Y"))
iYes2+=1;
else if (sInsert2.equalsIgnoreCase("N"))
iNo2+=1;
else if (sInsert2.equalsIgnoreCase("NR"))
iNR2+=1;
System.out.println("Question 3: Input (Y) for Yes, (N) for No or (NR) for No Response ");
sInsert3 = myScanner.next();
if (sInsert3.equalsIgnoreCase("Y"))
iYes3+=1;
else if (sInsert3.equalsIgnoreCase("N"))
iNo3+=1;
else if (sInsert3.equalsIgnoreCase("NR"))
iNR3+=1;
}
System.out.println("Do you have more questions? use 'y' for yes and and 'n' for no");
sInsert4 = myScanner.next();
}
while (sInsert4.equalsIgnoreCase ("y"));
System.out.println(" Male: " +iMales +" Female: " +iFemales +" Total: " +(iTotal1 = (iMales + iFemales)));
System.out.println(" Age: " +" <=25 " +i0_25years +" 26-45: " +i26_45years +" >=46 " +i46onwards +" Total: " +(iTotal2 = (i0_25years + i26_45years + i46onwards)));
System.out.println(" Question 1 " +" Yes: " +iYes1 +" No: " +iNo1 +" No Response: " +iNR1);
System.out.println(" Question 2 " +" Yes: " +iYes2 +" No: " +iNo2 +" No Response: " +iNR2);
System.out.println(" Question 3 " +" Yes: " +iYes3 +" No: " +iNo3 +" No Response: " +iNR3);
}
}