Quiz No.2

Quiz No.2

12th Grade

8 Qs

quiz-placeholder

Similar activities

Project-Stem Unit 1 python coding

Project-Stem Unit 1 python coding

9th - 12th Grade

12 Qs

АПИМ 3 курс, 1 сем

АПИМ 3 курс, 1 сем

12th Grade

12 Qs

Computational Thinking - Recap

Computational Thinking - Recap

11th - 12th Grade

10 Qs

Unit 11 Topic B2 Network Components

Unit 11 Topic B2 Network Components

12th Grade

10 Qs

Loops

Loops

9th - 12th Grade

10 Qs

Java: repetition control structure for & while

Java: repetition control structure for & while

10th - 12th Grade

10 Qs

Java - arrays and String methods

Java - arrays and String methods

9th - 12th Grade

12 Qs

Arrays Review

Arrays Review

9th - 12th Grade

11 Qs

Quiz No.2

Quiz No.2

Assessment

Quiz

Computers

12th Grade

Medium

Created by

Richard Reforma

Used 2+ times

FREE Resource

8 questions

Show all answers

1.

FILL IN THE BLANK QUESTION

30 sec • 1 pt

What will be the value of variable a?

int x=25;

int y= 16;

int a=x-y;

System.outprintln(a);

2.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

What is the output of this codes once you run the program?

int currentScore = 50;

int level = 2;

int newScore;

newScore = currentScore * level;

System.out.println("New Score is: " + newScore);

New Score is newScore

New Score is 50

New Score is 100

New Score is 50*2

3.

FILL IN THE BLANK QUESTION

45 sec • 2 pts

What will be the value of variable c?

int a=10;

int b= 5+3;

int c=(a+b)/2;

System.outprintln(c);

4.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

What is the correct syntax in importing Scanner Class?

import java.Util.Scanner;

import Java.UtilScanner;

import Java.Util,Scanner:

import java.util.Scanner;

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. Based on the given codes below, you need to find the error in the codes?

  2.           Scanner in = new Scanner(System.in);  

  3.           System.out.print("Enter your name: ");  

  4.           String name ; in.nextLine();  

  5.           System.out.println("Name is: " + name);             

  6.           

;

:

=

,

6.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

What is the correct output of the program?

int a = 10;

int b = 20;

int c = 25;

System.out.println("b % a = " + (b % a) );

System.out.println("c % a = " + (c % a) );

b % a = 10

c % a = 20

b % a = 0

c % a = 0

b % a = 0

c % a = 5

b % a = 5

c % a = 0

7.

FILL IN THE BLANK QUESTION

1 min • 5 pts

The written code below will accept 3 numbers from the user, what will be the output of the program if I entered 5, 9, and 16?

Scanner input = new Scanner(System.in);

System.out.print("Enter the Number 1 : ");

double n1 = input.nextDouble();

System.out.print("Enter the Number 2 : ");

double n2 = input.nextDouble();

System.out.print("Enter the Number 3 : ");

double n3 = input.nextDouble();

System.out.print("The Average value : " + ((n1 + n2 + n3) / 3 ));

8.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

What is the correct syntax to create an object of Scanner class?

Scanner input =new Scanner (System.in);

scanner input =new Scanner (system.in);

scanner input =new scanner (System;in);

Scanner input =new Scanner (System.in):