java - How to store a value for later use? -


i new user , have "noob" question. being taught java in school , have question 1 of our activities. 1 requirement take in student info (such course) , convert them single letter (i assume use .charat??) , later on count how many students enrolled course. have student info down here:

import java.util.*; import java.lang.*; public class coursetallier  { public static void main (string[] args)  {     string student = inputstudinfo(); } public static string inputstudinfo ()  {     scanner kbd = new scanner(system.in);     int limit = 0, idnum = 0;     string college = "";     system.out.println("please input valid id number:");     idnum = integer.parseint(kbd.nextline());     if (idnum == 0)     {         system.out.println("thank using program.");         system.exit(0);     }     while (idnum < limit) {         system.out.println("invalid id number. please enter positive integer:");         idnum = integer.parseint(kbd.nextline());     }     system.out.println("please enter valid course (blis, bscs, bsis, or bsit");     college = kbd.nextline();     while(!college.equalsignorecase("blis") && !college.equalsignorecase("bscs") && !college.equalsignorecase("bsis") && !college.equalsignorecase("bsit"))     {         system.out.println("invalid course. please enter either blis, bscs, bsis, or bsit");         college = kbd.nextline();     }     return college; } public static character convertcourse (string college)  { } 

and can see stuck @ "convert course" method (modular required). wondering how convert "blis" single character "l" , create method counts number of how many students enrolled in course.

i not asking complete program me cause cheating. asking shove in right direction. appreciated.

edit: asked here exact requirements: program

to storing future values, know instance variables are? unless misunderstood question, seems make sense make 4 (static) instance variables hold count of users enrolled in each course.


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -