Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

L I the Paste Calibri (Bo... 12 A A Aa A B IV 26 X, X APA LE E S , ABCDE AaBhccDdEC Code Normal

image text in transcribed

L I the Paste Calibri (Bo... 12 A A Aa A B IV 26 X, X APA LE E S , ABCDE AaBhccDdEC Code Normal 1. AaBbccd Question AaBbccdee AaBbCcDc AabhccDdEt AaBb No Spacing Heading 1 Heading 2 A 1. Create a class called DoSomething, that has two integer fields, int1 and int2. Initialise these fields in a constructor. (3 marks) 2. Rewrite the following "if" construct as a switch/case statement: (2 marks) char code; if (code =='A') { System.out.println("Excellent"); } else if (code =='B' || code == 'C') { System.out.println("Good"); } else if (code == 'D') { System.out.println("Poor"); 3. What is a keyword? Give two examples, using Java as the programming language. 4. What will be the output of the following program segment? (2 marks) int a = 10; int b = 30; int c = 40; a = b-- +cia/2; System.out.println("a"+a); System.out.println("b"+b)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions