Jump to content

JamesBong

Members
  • Content Count

    20
  • Joined

  • Last visited

Community Reputation

2 Neutral

About JamesBong

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. JamesBong

    Ajutor SQL

    Nu imi vine sa cred ca asta era problema. Iti foarte multumesc.
  2. JamesBong

    Ajutor SQL

  3. JamesBong

    Ajutor SQL

    Salut Am o problema si nu reusesc sa ii dau de cap. Am urmatoarele tabele dintr-o baza de date : Iar ce am de facut este : Write an SQL statement to change any employee’s title. Assume the employee has just phoned in with his/her last name. Varianta pe care am incercat-o cu un subquerry imi zice ca are syntax error. Update 'titles' set title = 'Senior Engineer' Where titles.emp_no = (select employees.emp_no from employees Where employees.last_name = 'Kalloufi'); Ma poate ajuta cineva ? Multumesc.
  4. JamesBong

    Intrebare pentru programatori

    Salut. Eu sunt la facultate in UK (Computer science) in anul 1 si din ce se spune pe aici e greu sa vi cu facultatea din Romania si sa iti gasesti un job bun cam in orice domeniu, nu numai in IT. Ai sanse mult mai mari daca vi si faci aici o facultate. Se intra destul de usor si facultatea este platita de stat...dupa care trebuie sa dai banii inapoi, desigur. Dar dupa ce termini poti gasi un job bine platit deoarece cererea este destul de mare in domeniul IT.
  5. JamesBong

    Program java

  6. JamesBong

    Ajutor java

    Am inteles. O sa incerc sa implementez asta. Multumesc 🙂
  7. JamesBong

    Ajutor java

    Salut. Am o problema si nu reusesc sa ii dau de cap... incerc sa invat java facand diverse programe si acum incerc sa fac un ecommerce app in consola cu database. Incerc sa fac un login system in care userii sa fie stocati in o baza de date si as vrea cumva sa opresc query cand gaseste userul. Va multumesc public static void login(){ System.out.println("Enter username: "); String username = input.next(); System.out.println("Enter password: "); String password = input.next(); int error = 0; try{ String SQL = "SELECT username, password FROM ADMINISTRATOR.users"; ResultSet rs = stmt.executeQuery( SQL ); while(rs.next()){ if(rs.getString("username").contains(username) && rs.getString("password").equals(password)){ System.out.println("Login successfull"); error=0; mainMenu(); } else { error =1; } } if(error == 1){ System.out.println("Incorrect details. Returing to menu."); welcomeMenu(); } }catch (SQLException err) { System.out.println(err.getMessage() ); } }
  8. JamesBong

    Ajutor program java

    Problema rezolvata. Iti multumesc.
  9. JamesBong

    Ajutor program java

    Salut. Va multumesc pentru sfaturi....foarte constructive ..... Am facut un alt program prin care sa invat despre arrayList si cand dau enroll student cumva sare peste firstName si inregistreaza doar surname. Am tot incercat sa ii dau de cap si nu reusesc. import java.util.Scanner; import java.util.ArrayList; public class arrayList { static Scanner input = new Scanner(System.in); static ArrayList<String> firstName = new ArrayList<String>(); static ArrayList<String> surname = new ArrayList<String>(); public static void main(String[] args) { menu(); } public static void menu() { byte choice; System.out.println("Main menu"); System.out.println("*********"); System.out.println("1. Enroll student"); System.out.println("2. List students"); System.out.println("Make a choice: "); choice = input.nextByte(); switch(choice) { case 1: enroll(); System.out.println("You have successfully added a student."); System.out.println(); menu(); break; case 2: list(); menu(); break; default: System.out.println("Please make a valid choice."); System.out.println(); menu(); break; } } public static void list() { int n = 1; for(int x = 0; x < firstName.size();x++) { System.out.println(n + ". " + firstName.get(x) + " " + surname.get(x)); n++; } } public static void enroll() { String fn, sn; System.out.println("Please enter the first name:"); fn = input.nextLine(); System.out.println("Please enter the surname:"); sn = input.nextLine(); firstName.add(fn); surname.add(sn); } }
  10. JamesBong

    Ajutor program java

    Am facut cateva modificari la cod si acum primesc urmatoarea eroare dupa ce bag datele la enroll student si nu imi dau seama cum o pot rezolva. public class Student { private String[] firstname; private String[] surname; private String[] course; private String[] adress; private String[] tel; private String[] email; private String[] dob; private String[] country; private int[] fees; private int[] id; private int n = 0; private int idn = 10000; int studentCount = 0; public Student(String fn, String sn, String crse, String adr, String tel_, String mail, String db, String ctry) { firstname[n] = fn; surname[n] = sn; course[n] = crse; adress[n] = adr; tel[n] = tel_; email[n] = mail; dob[n] = db; country[n] = ctry; id[n] = idn + 1; fees[n] = 9000; studentCount++; idn++; n++; } public void listStudent() { for(int x = 0; x < studentCount; x++) { System.out.printf("%s %s %s %s %s %s %s %s %d %d%n ", firstname[n], surname[n], course[n], adress[n], tel[n], email[n], dob[n], country[n], id[n], fees[n] ); } } } import java.util.Scanner; public class StudentTest { static Scanner input = new Scanner(System.in); public static void main(String[] args) { menu(); } public static void menu() { byte choice; System.out.println("*************************"); System.out.println("* Bright Future College *"); System.out.println("*************************"); System.out.println("1. Enroll student"); System.out.println("2. Pay fees"); System.out.println("3. List students on a course"); System.out.println("4. Change course"); System.out.println("5. View student profile"); System.out.println("6. Remove student from course"); System.out.println("7. ****Management reporting****"); System.out.println("8. Exit"); choice = input.nextByte(); input.nextLine(); switch(choice) { case 1: enroll(); menu(); break; case 3: //Student.listStudent(); default: System.out.println("Please enter a valid option!"); menu(); } } public static void enroll() { System.out.println("Please enter the first name: "); String fn = input.nextLine(); System.out.println("Please enter the surname: "); String sn = input.nextLine(); System.out.println("Please enter the course: "); String crse = input.nextLine(); System.out.println("Please enter the full adress: "); String adr = input.nextLine(); System.out.println("Please enter the telephone number: "); String tel_ = input.nextLine(); System.out.println("Please enter the email: "); String mail = input.nextLine(); System.out.println("Please enter the date of birth: "); String db = input.nextLine(); System.out.println("Please enter the type of student(home or foreign "); String ctry = input.nextLine(); Student student = new Student(fn, sn, crse, adr, tel_, mail, db, ctry); } } Un sfat va rog.
  11. JamesBong

    Ajutor program java

    Sunt la facultate in UK si la facultatea la care sunt eu se incepe pe 15 iunie, chiar daca majoritatea facultatilor de aici incep in septembrie.....nu stiu de ce
  12. JamesBong

    Ajutor program java

    Va multumesc tuturor pentru raspunsuri....O sa citesc din nou despre metode si clase si un crash course despre java.
  13. JamesBong

    Ajutor program java

    Sunt la inceput in saptamana 4 si trebuie sa fac asta in 3 saptamani si prea nu stiu cum....profesorul ne citeste materialul de curs si nu ne da exemple sa intelegem principiile.
  14. JamesBong

    Ajutor program java

    Salut Am de facut pentru facultate un program in Java si anume sistem pentru inregistrarea studentilor unei facultati. Nu vreau sa scrie cineva programul pentru mine, am nevoie de ghidare, daca sunteti amabili. Si iata ce am facut eu pana acum : public class Student { private static String[] firstname; private static String[] surname; private static String[] course; private static String[] adress; private static String[] tel; private static String[] email; private static String[] dob; private static String[] country; private static int[] fees, id; private static int n = 0; private static int idn = 10000; private static int studentCount = 0; public static void addStudent(String fn, String sn, String crse, String adr, String tel_, String mail, String db, String ctry) { firstname[n] = fn; surname[n] = sn; course[n] = crse; adress[n] = adr; tel[n] = tel_; email[n] = mail; dob[n] = db; country[n] = ctry; id[n] = idn + 1; fees[n] = 9000; studentCount++; idn++; n++; } public static void listStudent() { for(n = 0; n < studentCount; n++) { System.out.printf("%s %s %s %s %s %s %s %s %d %d%n ", firstname[n], surname[n], course[n], adress[n], tel[n], email[n], dob[n], country[n], id[n], fees[n] ); } } } import java.util.Scanner; public class StudentTest { static Scanner input = new Scanner(System.in); public static void main(String[] args) { menu(); } public static void menu() { byte choice; System.out.println("*************************"); System.out.println("* Bright Future College *"); System.out.println("*************************"); System.out.println("1. Enroll student"); System.out.println("2. Pay fees"); System.out.println("3. List students on a course"); System.out.println("4. Change course"); System.out.println("5. View student profile"); System.out.println("6. Remove student from course"); System.out.println("7. ****Management reporting****"); System.out.println("8. Exit"); choice = input.nextByte(); input.nextLine(); switch(choice) { case 1: enroll(); menu(); break; case 3: Student.listStudent(); default: System.out.println("Please enter a valid option!"); menu(); } } public static void enroll() { System.out.println("Please enter the first name: "); String fn = input.nextLine(); System.out.println("Please enter the surname: "); String sn = input.nextLine(); System.out.println("Please enter the course: "); String crse = input.nextLine(); System.out.println("Please enter the full adress: "); String adr = input.nextLine(); System.out.println("Please enter the telephone number: "); String tel_ = input.nextLine(); System.out.println("Please enter the email: "); String mail = input.nextLine(); System.out.println("Please enter the date of birth: "); String db = input.nextLine(); System.out.println("Please enter the type of student(home or foreign "); String ctry = input.nextLine(); Student.addStudent( fn, sn, crse, adr, tel_, mail, db, ctry); } } Asta am facut pentru inceput. Nu stiu exact cum sa inregistrez studenti noi, sau cum sa chem metoda din alta clasa sa inregistrez studenti. Orice sfat ar fi foarte apreciat.
  15. JamesBong

    Ajutor Program Visual Basic

    mersi pt ajutor, am rezolvat cu partea de search. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim search As String = TextBox2.Text Dim i As Long Dim LU, LL As Long LU = UBound(tel) LL = LBound(tel) For i = LL To LU If tel(i) = search Then MessageBox.Show("Student found") TextBox1.Text = fn(i) TextBox3.Text = sn(i) ComboBox1.Text = course(i) End If Next End Sub Nu prea gasesc informatii despre partea cum sterg un string din un array...
×