Java | JSP | JSF Answers

Questions: 4 418

Answers by our Experts: 3 943

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

how to transfer data from java txt file to JTable


Q1) Create a class with Customer with the following properties CustomerID and CustomerName and in that class only write functions:




a. List<Customer> retriveCustomers() to fill the customer class with objects and retrieve filled details of the customer .




b. FindCustomer (List<Customer> clist1,int custid1) find the customer from the above list of customers by fetching id from the user.




c. Updatecustomer(List<Customer> clist1, int custid1) to update a particular customer when id is given




d. Deletecustomer (List<Customer> clist1,int custid1) to delete the particular customer when id is given .

Enum


Create a class for enum named ‘TypeOfAccount’. And declare the following enum:


TypeOne 

TypeTwo 

TypeThree 


TypeOne represents “Saving Account”, TypeTwo for “Salary Account” and TypeThree is “Checking Account”


Also create a class with Main Method, where you will do the following operations:


Allows the user to input a TypeAccount enum

Displays the value that the enums represents

If the input enum is incorrect, display an error message


How to do login of username and password from file handling.


How to transfer data from Jlist of one frame to JTable of another frame using GUI.


How To Test Whether a Set is Reflexive, Symmetric, Anti-Symmetric and/or Transitive using 2darray?




Write a program to take a String as input then display the words in one column, number of characters in each word in second column and the first letter of each word in third column with appropriate heading.

For example:

Enter a String

Hello world

Words Length First Letter

Hello 5 H

world 5 w


for(i=0;i<s.lastIndexOf(' ');i++) {

      c = s.charAt(i);

      if(c ==' ')

        s1=s1+s.charAt(i+1)+" ";

    } //Use this code for first letter


for(i=0;i<s.length();i++) {

      c = s.charAt(i);

      if (c != ' ')

        n = n+c;

      else {

        System.out.println(n+...);

       } //Use this code for display words and its number of characters


Ques- Write a code in Netbeans Java that will ask for item code, Item name and price of 3 items and display all information of all items

Can you convert the code into java?


#include<vector>
#include<iostream>

auto f=
[](auto m,int&r){
  r=1;                         //set return flag to true
  for(auto a:m)                //for each element
    for(auto b:m)              //check with second element
      if (a.second==b.first){  //do they chain?
        int i=0;               //flag for local transitivity
        for(auto c:m)          //search for a third element
          i+=a.first==c.first&&b.second==c.second;
        r*=i>0;                //multiply with flag>0, resulting in 0 forever if one was not found
      }
}
;

int main(){
 std::vector<std::pair<int,int>> m={
  {1, 2}, {2, 4}, {6, 5}, {1, 4}
 };

 int r;
 f(m,r);
 std::cout << r << std::endl;
 
 m.emplace_back(3,6);
 f(m,r);
 std::cout << r << std::endl;
 
 m.emplace_back(3,5);
 f(m,r);
 std::cout << r << std::endl;

}

Question 1

Write down the method isPrime(int number), which accepts an positive integer and return a boolean

value if the number is Prime or not.

Question 2

Write a method called printUnique that accepts one integer array as argument, and print all unique elements

form the array. E.g. {5,6,7,8,9,8,7,6,5} (9 is unique).

Question 3

Given two arrays of same size and type, arr1={1,2,3,4,5} and arr2={6,7,8,9,10} calculate the

difference of all values in the array and your operation would be like (Arr2 - Arr1)


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS