Search Results

Search found 2891 results on 116 pages for 'a student at a university'.

Page 20/116 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • Doubt in abstract classes

    - by mohit
    public abstract class Person { private String name; public Person(String name) { this.name = name; System.out.println("Person"); } public String getName() { return name; } abstract public String getDescription(); } public class Student extends Person { private String major; public Student(String name, String major) { super(name); this.major = major; } public String getMajor() { return major; } @Override public String getDescription() { return "student" + super.getName() + " having" + major; } } public class PersonTest { public static void main(String[] args) { Person person = new Student("XYZ", "ABC"); System.out.println(person.getDescription()); } } Ques: We cannot create objects of abstract classes, then why Person Constructor has been invoked, even its an abstract class?

    Read the article

  • Storing users in a database

    - by EMcKenna
    Im wondering whats the best way of storing different types of users in my database. I am writing an application that has 4 main user types (admin, school, teacher, student). At the moment I have a table for each of these but i'm not sure thats the best way of storing user information. For instance... Allowing students to PM other student is simple (store sender and receiver student_id) but enabling teachers to PM students requires another table (sender teacher_id, sender student_id). Should all users be stored in one users table with a user_type field? If so, the teacher / student specific information will still have to be stored in another table. users user_id, password_hash, user_type students user_id, student_specific_stuff... teachers user_id, teacher_specific_stuff... How do I stop a user who has a user_type = student from being accidentally being entered into the teachers table (as both have a user_id) Just want to make sure I get the database correct before i go any further. Thanks...

    Read the article

  • Visitor Pattern can be replaced with Callback functions?

    - by getit
    Is there any significant benefit to using either technique? In case there are variations, the Visitor Pattern I mean is this: http://en.wikipedia.org/wiki/Visitor_pattern And below is an example of using a delegate to achieve the same effect (at least I think it is the same) Say there is a collection of nested elements: Schools contain Departments which contain Students Instead of using the Visitor pattern to perform something on each collection item, why not use a simple callback (Action delegate in C#) Say something like this class Department { List Students; } class School { List Departments; VisitStudents(Action<Student> actionDelegate) { foreach(var dep in this.Departments) { foreach(var stu in dep.Students) { actionDelegate(stu); } } } } School A = new School(); ...//populate collections A.Visit((student)=> { ...Do Something with student... }); *EDIT Example with delegate accepting multiple params Say I wanted to pass both the student and department, I could modify the Action definition like so: Action class School { List Departments; VisitStudents(Action<Student, Department> actionDelegate, Action<Department> d2) { foreach(var dep in this.Departments) { d2(dep); //This performs a different process. //Using Visitor pattern would avoid having to keep adding new delegates. //This looks like the main benefit so far foreach(var stu in dep.Students) { actionDelegate(stu, dep); } } } }

    Read the article

  • how to Update the XMl value and write back using LINQ

    - by NewDev
    Hi all, i am having query for update the node value using Linq, For example i am have to update <Student> <studentdetail> <studentname>test</studentname> <libraryid>hem001</libraryid> </studentdetail> </Student> in above xml i want to change the value of Student name "test" ti something else like "Undertest" regards NewDev

    Read the article

  • How to add characters to reach the maximum size of a char[].

    - by Bon_chan
    Hi folks, I have the following part of code : for(int i=0;i<n;i++) { printf("Student %d\n",i+1); printf("Enter name : "); scanf("%s",&(student+i)->name); fflush(stdin); lengthName = strlen((student+i)->name); while(lengthName !='\0') { }} when the length is shorter than 10, it will add hyphens until reaching the maximum size. Ex : John = 6 hyphens will be added I know how to do it in csharp but can't figure it out in c. Could some of you give me some lights please? PS : Oh yes the variable name is char name[10+1] and it a part of the structure called student.

    Read the article

  • plot a line graph in vb.net

    - by Husna5207
    this is my function for plotting a graph in vb.net how I'm going to replace the ("Jon", 10),("Jordan", 30) with a value that i search from database ? Private Sub chart_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chart_btn.Click Chart1.Series("Student").Points.AddXY("Jon", 10) Chart1.Series("Student").Points.AddXY("Jon", 10) Chart1.Series("Student").ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Bar End Sub

    Read the article

  • calculating the index of an array C#

    - by Kerry G
    I want to display a list of the answers a student entered incorrectly. How do I identify the index of these questions? I am hoping to change the contents of a textbox to a list of the questions answered incorrectly, which would require calculating the index of each incorrect question. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApplication5 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } //return a pass/fail //return number of correct answers //return number of incorrect answers //return index figures of incorrect values public void examResults () { string[] correctAnswers = {B,D,A,A,C,A,B,A,C,D,B,C,D,A,D,C,C,B,D,A}; string[] studentResults = File.ReadAllLines("studentResults.txt"); var c = correctAnswers.Where((x, i) => x.Equals(studentResults[i])).Count(); if ( c <= 14) passFailBox.Text = "Student has failed the exam"; else passFailBox.Text = "Student has passed the exam"; numberCorrectBox.Text = "Student has answered" + c + "answers correctly"; int f; f= 21-c; numberIncorrectBox.Text = "Student has answered" + f + "answers incorrectly"; } } }

    Read the article

  • What technology should i choose for this kind of an application?

    - by Pandiya Chendur
    One of my client has asked me an application Telephone answering machine which is exactly like customer care voice application (ie) he is maintaining a college, parents of students will call to a college phone no and they will be asked to enter student roll/reg no and they can hear that student attendence percentage,mark etc.... Is it possible? If so, How can i pass a student detail to that voice recorded.... I dont what kind of technology can be used to make this application possible...

    Read the article

  • Using a Loop to add objects to a list(python)

    - by Will
    Hey guys so im trying to use a while loop to add objects to a list. Heres bascially what i want to do: (ill paste actually go after) class x: blah blah choice = raw_input(pick what you want to do) while(choice!=0): if(choice==1): Enter in info for the class: append object to list (A) if(choice==2): print out length of list(A) if(choice==0): break ((((other options)))) as im doing this i can get the object to get added to the list, but i am stuck as to how to add multiple objects to the list in the loop. Here is my actual code i have so far... print "Welcome to the Student Management Program" class Student: def init (self, name, age, gender, favclass): self.name = name self.age = age self.gender = gender self.fac = favclass choice = int(raw_input("Make a Choice: " )) while (choice !=0): if (guess==1): print("STUDENT") namer = raw_input("Enter Name: ") ager = raw_input("Enter Age: ") sexer = raw_input("Enter Sex: ") faver = raw_input("Enter Fav: ") elif(guess==2): print "TESTING LINE" elif(guess==3): print(len(a)) guess=int(raw_input("Make a Choice: ")) s = Student(namer, ager, sexer, faver) a =[]; a.append(s) raw_input("Press enter to exit") any help would be greatly appreciated!

    Read the article

  • C# Simple IF OR question

    - by Jamie
    Hi all, Sorry to ask this as I thought I knew the answer, I want to exit the program if userName is greater than 4 characters or userName is not an account called student. However this even if the userName is only 3 characters and is not student I'm still hitting Application.Exit. What am I doing wrong? if (userName.Length > 4 | userName != "student") { Application.Exit(); } Shame on me :-(

    Read the article

  • Looking for MSSQL Table Design Sanity Check for Profile Tables with Dynamic Columns.

    - by Code Sherpa
    I just want a general sanity check regarding database design. We are building a web system that has both Teachers and Students. Both have accounts in the system. Both have profiles in the system. My question is about the table design of those Profile tables. The Teacher profile is pretty static regarding the metadata associated with it. Each teacher has a set number of fields that exposes information about that individual (schools, degrees, etc). The students, however, are a different case. We are using a windows service to pull varying data about the students from an endless stream of excel spreadsheets. The data gets moved into our database and then the fields appear in association with the student's profile. Accordingly, each and every student may have very different fields in their profile. I originally started with the concept of three tables: Accounts ---------- AccountID TeacherProfiles ---------- TeacherProfileID AccountID SecondarySchool University YearsTeaching Etc... StudentProfiles ---------- StudentProfileID AccountID Header Value The StudentProfiles table would hold the name of the column headers from the excel spreadsheets and the associated values. I have since evolved the design a little to treat Profiles more generically per the attached ERD image. The Teacher and Student "Headers" are stored in a table called "ProfileAttributeTypes" and responses (either from the excel document or via input fields on the web form) are put in a ProfileAttributes table. This way both Student and Teacher profiles can be associated with a dynamic flow of profile fields. The "Permissions" table tells us whether we are dealing with a Student or a Teacher. Since this system is likely to grow quickly, I want to make sure the foundation is solid. Can you please provide feedback about this design and let me know if it seems sound or if you could see problems it might create and, if so, what might be a better approach? Thanks in advance.

    Read the article

  • symfony and entity manager

    - by Jenis Sam
    I want to do the following I have a database table of students, and I want to output each student name in a check box list. so checkbox. Student 1 checkbox. Student 2 Where the value of the checkbox is the student's ID. How can I do that using Symfony? I want teachers to be able to select one or more checkboxes. I tried following this tutorial: http://symfony.com/doc/current/cookbook/form/form_collections.html and using collections, but I am lost...

    Read the article

  • multiple inheritance

    - by hitech
    when we say "a member declated as protected is accessible to any class imediately derived from it" what does this mean. in the follwing example get_number function can be accessible by the result class , as per the statement it sould only be accessile to test class. class student { protected: int roll_number; public: void get_number(int){ cout<< "hello"; } void put_number(void) {cout<< "hello"; } }; class test : public student { protected : float sub1; float sub2; public: void get_marks(float, float) {cout<< "hello"; roll_number = 10; } void put_marks(void) {cout<< "hello"; cout << "roll_number = " << roll_number ; } }; class result :public test { float total; public: void display(){cout<< "hello"; roll_number = 10; } }; int main() { result student; student.get_marks(2.2, 2.2); student.put_marks(); return 0; } i changed the code as per the first statement the protected variable roll_number not be accessible upto the result class ?

    Read the article

  • NHibernate SchemaUpdate adding existing foreign keys again?

    - by afsharm
    I'm using SchemaUpdate to synchronize my hbms with existing database. Database has recently created based on hbms and is completely up-to-date. But SchemaUpdate generates all foreign key constraints again. For example suppose you have Student and Teacher. Student has association to Teacher with name ArtTeacher. ArtTeacher is a foreign key from Student to Teacher. Suppose database is up-to-date and currently holde Student, Teacher and their foreign key relation. So HBM and Database are equivalent. Know SchemaUpdate must not do anything but when I see its generated scripts, it re-produce that foreign key again. Why this happens? Is there any way to avoid it?

    Read the article

  • How to acheieve this kind of behaviour in asp.net mvc

    - by kumar
    Hello Friends,, I have this two Action result methods. public ActionResult GetStudentInfo(StudentBE s) { return PartialView("editStudent", s); } public ActionResult GenericList() { StudentBE codes = new StudentBE(); codes.lookcodes= GetStudentCodes(new string[] { "A", "B", "C, "D", "E" }); return PartialView(codes); } // Lookcodes display dropdownlist boxes in the GeneridList view.. In genericList view I hvae beginForm.. <% using (Html.BeginForm("Updatestudent", "expense", FormMethod.Post, new { @id = "id" })) { %> <% } %> so My updatestudent method is [HttpPost] public JsonResult Updatestudent(StudentBE e) { var status = common.Update(e.student); } } return Json(status.ToString()); } Here is my problem.. the GetStudentInfo Actionresult is having each student information.. in UpdateStudent method Update Method calls the DB calls for stored procedure to update each user information now to update each user I need to call GetstudentInfo each time to get student information to update..? how to call GetStudentInfo method here to get studentinformation? student informatin may be multiple that is more than one student informaton... can anybody help me out.. thanks

    Read the article

  • Ruby on Rail - Format for fetching and displaying Dymanic drop down

    - by Ruby
    Hi, I have 3 tables : Student , Subject and Score Every student can add 3 Subjects (Physics, Mathematics and Chemistry) marks. The combination of (student_id + subject_id) is added to Score table. i.e., capturing that sudent '1' has added 'Mathematics' marks with the actual score (say 0-100 range) student id : subjectid Score 1 Mathematics 95 The Add page of Score has a "subject" drop down. which is displayed from "subject" table. When the student wants to add the 2nd subject marks, in the add page, he should not be displayed the previoys added subject in the drop down. Can any1 tell me how to do this?

    Read the article

  • hibernate many to many only save the new object and between table

    - by Joe
    I have the following tables: Student Student_Course Course Now when I create a student I only want to create a user and add a row to student_course. The "problem" I have is that when I set the set of courses in Student to cascade="save-update" that an update is also invoked on course. I was wondering if there was a way to prevent this.

    Read the article

  • Looking for an example of selecting a row(s) with multiple columns from a grid view and add them to

    Here is the situation dealing with a vb.net website, I have students who will be enrolled into a course. The student grid view has many columns like client_no, student_name, date_of_birth, address, etc. There are over 100000 students so I will need to filter the student grid view to find the correct student to enroll in the course. Once they are found, the user selects them and somehow moves them to the enrolled grid view. If a student drops out then they would be removed from the enrolled grid view. This process needs to be easy to understand and use. Are there any examples available or other suggestions on how to do this?

    Read the article

  • Django forms: prepopulate form with request.user and url parameter

    - by Malyo
    I'm building simple Course Management App. I want Users to sign up for Course. Here's sign up model: class CourseMembers(models.Model): student = models.ForeignKey(Student) course = models.ForeignKey(Course) def __unicode__(self): return unicode(self.student) Student model is extended User model - I'd like to fill the form with request.user. In Course model most important is course_id, which i'm passing into view throught URL parameter (for example http://127.0.0.1:8000/courses/course/1/). What i want to achieve, is to generate 'invisible' (so user can't change the inserted data) form with just input, but containing request.user and course_id parameter.

    Read the article

  • Hibernate many-to-many relationship

    - by Capitan
    I have two mapped types, related many-to-many. @Entity @Table(name = "students") public class Student{ ... @ManyToMany(fetch = FetchType.EAGER) @JoinTable( name = "students2courses", joinColumns = { @JoinColumn( name = "student_id", referencedColumnName = "_id") }, inverseJoinColumns = { @JoinColumn( name = "course_id", referencedColumnName = "_id") }) public Set<Course> getCourses() { return courses; } public void setCourses(Set<Course> courses) { this.courses = courses; } ... } __ @Entity @Table(name = "courses") public class Course{ ... @ManyToMany(fetch = FetchType.EAGER, mappedBy = "courses") public Set<Student> getStudents() { return students; } public void setStudents(Set<Student> students) { this.students = students; } ... } But if I update/delete Course entity, records are not created/deleted in table students2courses. (with Student entity updating/deleting goes as expected) I wrote abstract class HibObject public abstract class HibObject { public String getRemoveMTMQuery() { return null; } } which is inherited by Student and Course. In DAO I added this code (for delete() method): String query = obj.getRemoveMTMQuery(); if (query != null) { session.createSQLQuery(query).executeUpdate(); } and I ovrerided method getRemoveMTMQuery() for Course @Override @Transient public String getRemoveMTMQuery() { return "delete from students2courses where course_id = " + id + ";"; } Now it works but I think it's a bad code. Is there a best way to solve this problem?

    Read the article

  • javascript object creating

    - by Md. Shohel Rana
    I have a javascript object like this var student = function () { this.id = 1; this.Name = "Shohel"; this.Roll = "04115407"; this.Session = "03-04"; this.Subject = "CSE"; }; and i have a javascript array list like this var students = []; now i want to push student into students, this is shown below students.push(new student()) //no prolem students.push(new student[id = 3]) //Problem here second line occurs exceptions, how can i push javascript object like as c# add list, which is representing second line? thanks

    Read the article

  • Can reducing index length in Javascript associative array save memory

    - by d777
    I am trying to build a large Associative Array in JavaScript (22,000 elements). Do I need to worry about the length of the indices with regards to memory usage? In other words, which of the following options saves memory? or are they the same in memory consumption? Option 1: var student = new Array(); for (i=0; i<22000; i++) student[i] = { "studentName": token[0], "studentMarks": token[1], "studentDOB": token[2] }; Option 2: var student = new Array(); for (i=0; i<22000; i++) student[i] = { "n": token[0], "m": token[1], "d": token[2] }; I tried to test this on Google Chrome DevTools, but the numbers are inconsistent to make a decision. My best guess is that because the Array indices repeat, the browser can optimize memory usage by not repeating them for each student[i], but that is just a guess. Thanks.

    Read the article

  • Deleting the first occurrence of a target in aList [closed]

    - by Bandz Jooz
    /** Replaces each occurrence of oldItem in aList with newItem */ public static void replace(List<Student> aList, Student oldItemStudent newItem) { int index = aList.indexOf(oldItem); while(index != -1){ aList.set(index, newItem); index = aList.indexOf(oldItem); } /** Deletes the first occurrence of target in aList */ public static void delete(List<Student> aList, Student target){ Object o = //stuck here, dont know how to set up boolean stuff } } I figured out how to do the first method by looking up Java documentation, however I can't figure out how to finish my code for the second method even though I looked up the documentation which states: boolean remove(Object o) Removes the first occurrence of the specified element from this list, if it is present.

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >