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

Write a Java program to read first 3 lines from the file

Using two dimensional array, create a program that will display multiplication table but the size would be depends on the entered number of rows and columns.



Sample INPUT:



Enter numbers of ROWS: 3


Enter numbers of COLUMNS: 4



OUTPUT:



My Own Multiplication Table


***********************************************


1 2 3 4


2 4 6 8


3 6 9 12


***********************************************





1. Create an application named Numbers whose main() method holds two integer variables. Assign

values to the variables. Pass both variables to methods named sum () and difference(). Create the

methods sum() and difference(); they compute the sum of and difference between the values of two

arguments, respectively. Each method should perform the appropriate computation and display the

results. Save the application as Numbers.cs


Write an application for a furniture company; the program determines the price of a table. Ask the user to choose 1 for pine, 2 for oak, or 3 for mahogany. The output is the name of the wood chosen as well as the price of the table. Pine tables cost R 100, oak tables cost R 225, and mahogany tables cost R 310. If the user enters an invalid wood code, set the price to 0 and allow the user to select an option up to 3 times . Save the file as Furniture.java.

Marks allocation 

1. Presentation of a menu - 10

Select an option 

1. for pine 

2. for oak

3. for mahogany

2. use of a loop - 10

3. Use of an if statement/ switch - 10

4. correct output -10

1. You were asked to create a program for a variety stores. The program should:



a. Input the customer name



b. Input the products name and its price. Specifically three products.



c. Get the total price of the 3 products.



d. Input the cash from customer.



e. Output the summary of the sales.

1. You were asked to create a program for variety stores. The program should:


1. Input the customer name.


2. Input the products name and it's price. Specifically three products.


3. Get the total price of the 3 products.


4. Input the cash from customer.


5. Out the summary of the sales.

import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner in = new Scanner(System.in); int house = 5; int room = 3; int len = 2; int we = 4; double cost = 6; int areaRoom = len * we; int totalArea = areaRoom * room * house; double totalCost = totalArea * cost; System.out.println("Room area: " + areaRoom); System.out.println("Area of all rooms: " + totalArea); System.out.println("Total price of the construction: " + totalCost); } }



I want pseudocode and flowchart of this code.

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int[] arr = new int[7]; boolean isSorted = true; int buf; for (int i = 0; i < arr.length; i++) { System.out.print("Month " + (i + 1) + ": "); arr[i] = in.nextInt(); } for (int i = 0; i < arr.length; i++){ for (int j = 0; j < arr.length - 1; j++) { if (arr[i] < arr[j]) { buf = arr[i]; arr[i] = arr[j]; arr[j] = buf; } } } for (int i : arr) { System.out.print(i + " "); } } }


This is the code i want pseudocode and flowchart of this code.

import java.util.Scanner;




public class Main {



public static void main(String[] args) {



Scanner in = new Scanner(System.in);




int[] arr = new int[9];



int[] rez = new int[9];




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



System.out.print("Car " + (i + 1) + ": ");



arr[i] = in.nextInt();



}



int x = 0;



for (int i : arr) {



if(i%2 == 0){



rez[x] = i;



x++;



}



}



for (int i : arr) {



if(i%2 != 0){



rez[x] = i;



x++;



}



}




for (int i : rez) {



System.out.print(i + " ");



}



}



}




This is the code i want pseudocode and flowchart of this code.

What is y after the following switch statement is executed? Rewrite the code using an if-else statement.

x = 3; y = 3;

switch (x + 3) {

case 6: y = 1;

default: y += 1;

}



LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS