Java | JSP | JSF Answers

Questions: 3 611

Answers by our Experts: 3 611

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

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)


· Declare an array as Car with size 10.

· Take 10 Car’s information from user and store them in specified array.

· Call findCarList method from Main class to get all cars information related to a given model name and display then within this method.

· Model name should be taken from Main class and pass to findCarList method as argument as well as Car array (with size 10).

Design findCarList method in Car classas follows:

· it will take a model(car model) as parameter and array of cars (with size 10)

· displays List of cars for the given model from the list .

· If there are no cars, then shows “No cars found”.


How to determine the set is symmetric using java code?


LATEST TUTORIALS
APPROVED BY CLIENTS