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

Create a class “Calculator” with two variables, a constructor with no parameter and



two functions for add and multiply. Create a class TestApp with a main function and



create object of Calculator class to call functions.

Use linked list,





Accept information first name



middle name last name area code telephone number gender and age. Display information of each member.



give info for member #1



Enter first name: Ta




Enter middle name: Ma



Enter last name: Ta



Enter area code: 047



Enter telephone number: 1-22



Enter gender: male



Enter age: 21














Give information of member #2














Enter first name: Ja














Enter middle name: La














Enter last name: Ga














Enter area code: 047














Enter telephone number: 2-33















Enter gender: female














Enter age: 18















//display














Welcome to the club Ta Ma Ta!














Your area code and telephone number is (047) 1-22.














You are a male member, and your age is 21.















Welcome to the club Ja La Ga!














Your area code and telephone number are (047) 2-33.














You are a female member, and your age is 18.















On the form create a list box, to allow a user to select between three different cities. Also create a combo box for the user to select the year. Finally add a submit button. Once the user has selected a city, year and clicked the submit button display the petrol price per litre for that year.

Use the following table for the city and yearly petrol prices per litre:

2017 2018 2019

Johannesburg 10.72 10.35 10.20

Durban 12.75 12.32 12.22

Cape Town 13.70 13.31 13.23


You are also required to create a menu system which will allow the user to exit the application under the file menu. Under the tools menu allow the form submission and option to display the average yearly petrol price report. The layout of the form is left to your discretion. Marks will be allocated to the presentation and effectiveness of the layout, but the following layout is displayed for your convenience


On the form create two combo boxes, one for the country selection and another to select a town. Also, add two radio buttons for the user to select to display either a phone or postal code.


You are also required to create a menu system which will allow the user to exit the application under the file menu. Under the tools menu allow the form submission and option to display the average yearly petrol price report. The layout of the form is left to your discretion. Marks will be allocated to the presentation and effectiveness of the layout, but the following layout is displayed for your convenience.




SOUTH AFRICA UNITED KINGDOM

Cape Town London

Phone Code: 021 Phone Code: 020

Postal Code: 8000 Postal Code: WC2N5DU

Johannesburg Oxford

Phone Code: 011 Phone Code: 01865

Postal Code: 2000 Postal Code: OX13PN


Durban Southampton

Phone Code: 031 Phone Code: 023

Postal Code: 4000 Postal Code: SO147DW 


Study the following portion of a Jjava program and answer the questions that follows.



while(i < 4){



j = 0;



While(j < 5){



System.out.println(“Please enter the value to be stored”);



Marks[i][j] = scan.nextInt();



j++;



}



i++;



}



i)



What do we call this block of code in programming?



[5]



ii)



What is the function of this block of code?



[5]



iii)



Using a table, write out the output of these statements.



[

Write a java program that receives two values from the user, adds them together and


display the answer.

Write a java program that would display the 8 shape using the ‘*’ characte


The _________ is to visit the left subtree of the current node first, then the right subtree of the current node, and finally the current node itself.

A __________ (with no duplicate elements) has the property that for every node in the tree the value of any node in its left subtree is less than the value of the node and the value of any node in its right subtree is greater than the value of the node.


A. binary search tree


B. list


C. linked list


D. binary tre

Write the output and if there is an error correct the error first then write the output:


1.for(int a=1; a<=3; a++)

  for(int b=2; b<5; b++)

   out.print(a+b + " ");

   

   

   

2.for(int i=2; i<=6; i++){

  for(int j=1; j<=i; j++)

   out.print('*');

  out.println();

}

 

 

   

3.int total = 0;

for(int c=2; c<7; c++)

  for(int d=1; d<=c; d++)

   total = total + d;

out.println(total);

 

 

 

4.String s = "apluscs";

for(int e=0; e<s.length(); e++)

  for(int f=0;f<=e;f++){

   System.out.print(s.charAt(f));

 }

  System.out.println();

}

 

​​

 

5.for(int count1=1; count1 <= 5; count1++)

{

for (int count2=1; count2 <= 5; count2++)

System.out.print (count1*count2 + " ");

System.out.println();

}

 

6.public static void main(String args[]) {

   int a,b;

   a = 3;

   b = 4;

    System.out.println(three(a,b));

  }

  public static int three(int x, int y) {

   int a;

   a = x + y;

   return a;

  }


LATEST TUTORIALS
APPROVED BY CLIENTS