Professional Documents
Culture Documents
Wissen Test
Wissen Test
2 A boatman goes 12 km against the current of the stream in 6 hours and goes 5/5
2 km along the current in 50 minutes. How long will it take for him to go 8
km in still water?
[Note...
Options
A. 3 hrs 30 mins
C. 2 hrs
D. 2 hrs 30 mins
Options
4 Bob has allocated a budget x for painting his shop. However, the price of paint 5/5
increases by 45%.
If Bob decides to spend an additional 30% of x for buying paint then by what ...
Options
A. 15.66 %
C. 0.1233
D. 14.34 %
5 You are asked to use two pipes A and B to ll a tank that has another pipe C at 5/5
the bottom of it. Given that pipes A and B can ll the tank in 15 and 20 minutes,
respectively...
Options
B. 400 gallons
C. 450 gallons
D. 350 gallons
6 A shoemaker incurs an expense of Rs. 200 for producing a shoe. She also incurs 4/4
an additional expenditure of Rs. 50,000, independent of the number of shoes
produced. If she can ...
Options
A. 1200
B. 1500
D. 900
7 A library has a collection of books out of which 55% books are more than 50 4/4
years old and 60% books are less than or equal to 70 years old. Also, 40% of the
books in the librar...
Options
A. 48 %
B. 56 %
C. 60 % CORRECTLY ATTEMPTED
D. 54 %
8 Mr John walks to a party at his friend's house for christmas in 2017. His 5/5
friend introduces him to a girl named Alice who is a mathematician.
3 years later, Mr John runs into A...
Options
A. 17 years
B. 18 years
C. 17 years
9 A school has two alarms A and B. Alarm A rings once every two hours and 5/5
alarm B rings once every four hours.
Options
B. 120%
C. 150%
D. 110%
10 At what time will the minute hand and hour hand of a wall clock make one- 5/5
third angle of the right angle between 8 pm and 9 pm?
Options
B. 8:20 PM
C. 8:40 PM
D. 8:37 PM
...
Options
File Name:
B.java public
class ...
Options
A. The calls will be made in the following order: A's constructor, B's constructor,
B's xyz method CORRECTLY ATTEMPTED
B. The calls will be made in the following order: A's constructor, B's constructor,
A's xyz method, B's xyz method
C. The calls will be made in the following order: B's constructor, A's constructor,
B's xyz method
D. The program will give a run time error
Submission
CREATE TABLE customer(
id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT,
First_name varchar(50) not null,
last_name varchar(50) not null,
email varchar(50) not null,
mobile varchar(10) not null
password varchar(50) not null)
foreign key (id,email,mobile);
CREATE TABLE shop.order(
id BIGINT NOT NULL,
ITEMS varchar(5) ,
price_of_items BIGINT ,
type_of_item varchar(20),
no_of_order int null default null,
primary key (id),
FORIGN KEY(id,items,price_of items));
CREATE TABLE shop.address(
id BIGINT NOT NULL
location varchar(20),
state varchar(20) not null,
country varchar(20),
permanent_address varchar(50) not null,
present_address varchar(50) not null,);
1. SELECT customer.first_name, customer.email FROM customer where order.items=0;
2.SELECT customer.first_name,customer.email from customer where no_of_order>=3;
# Questions (2)
Code
No. of attempts Result quality Score (80/80)
Play code
Submission details
Java 8
Accepted 40/40 0.1196 sec 82984 KB
Input Result Time (in sec) Memory (in KB) Score Input File Output Expected output
Compilation log
Compilation Successful.
1 import java.io.*;
2 import java.util.*;
3
4 1 import sun.security.util.Length;
be used
5
6
7 public class TestClass {
8 public static void main(String[] args) throws IOException {
9 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
10 1 PrintWriter wr = new PrintWriter(System.out);
11 1 int N = Integer.parseInt(br.readLine().trim());
Local variable and method parameter names should comply with a naming convention
Local variable and method parameter names should comply with a naming convention
19 1 System.out.println(out_);
20
21 wr.close();
22 br.close();
23 }
24 3 static int solve(int N,int[] A){
25 Arrays.sort(A);
26 1 int Length=A.length;
Local variable and method parameter names should comply with a naming convention
27 return (A[Length-1]>Math.abs(A[0])?A[Length-1]:A[0]);
28 }
29 }
Code quality report is generated by using Major violations (4) Minor violations (6)
SonarQube V7.8
3 8/10 40/40
2 Median Queries
Play code
Java Play code link
Java 8 Play code link
Submission details
Input Result Time (in sec) Memory (in KB) Score Input File Output Expected output
Compilation log
Compilation Successful.
1 import java.io.*;
2 import java.util.*;
3
4 class TestClass {
5 public static void main(String args[] ) throws Exception {
6 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
7 PrintWriter wr = new PrintWriter(System.out);
8 int N = Integer.parseInt(br.readLine().trim());
9 int[] A = new int [N];
10 String[] inp = br.readLine().split(" ");
11 for(int i=0;i<N;i++)
12 {
13 A[i] = Integer.parseInt(inp[i]);
14 }
15 int Q = Integer.parseInt(br.readLine().trim());
16 for(int i=0;i<Q;i++) {
17 String[] inp1 = br.readLine().split(" ");
18 int L = Integer.parseInt(inp1[0]);
19 int R = Integer.parseInt(inp1[1]);
20 int out_ = solve(N, A, L ,R);
21 System.out.println(out_);
22 }
23 wr.close();
24 br.close();
25 }
26 static int solve(int N, int[] A, int L, int R) {
27 int [] subArray=Arrays.copyOfRange(A,L-1,R);
28 int length=subArray.length;
29 Arrays.sort(subArray);
30 if(length==1){
31 return subArray[0];
32 }else if ((length%2)==0){
33 return subArray[(length/2)-1];
34
35 }else{
36 return subArray[(length/2)];
37 }
38
39 }
40 }