Create a class called Time that includes three instance variables: hour (int), minute (int) and second (int). Provide following constructors to initializes the three instance variables.
• No-argument constructor: Initializes each instance variable to zero.
• Constructor: hour supplied, minute and second defaulted to 0.
• Constructor: hour and minute supplied, second defaulted to 0.
• Constructor: hour, minute and second supplied.
• Constructor: Another Time2 object supplied.
write a Program to check whether a number is divisible by 5 and 11 or not. Using the switch statement
What number sequence will be displayed at the output of the following program?
1 public class Confusing {
2 public static void method2() {
3 method1();
4 System.out.print("2");
5 }
6
7 public static void method3() {
8 method2();
9 System.out.print("3");
10 method1();
11 }
12
13 public static void method1() {
14 System.out.print("1");
15 }
16
17 public static void main(String[] args) {
18 method1();
19 method3();
20 method2();
21 method3();
22 }
23 }
Accept the marked price from the user and calculate the Net amount as(Marked Price – Discount) to pay according to following criteria:
Marked Price - Discount
>10000 20%
>7000 and <=10000 15%
<=7000 10%
A company decided to give bonus to employee according to following criteria: Time period of Service Bonus if More than 10 years 10% if >=6 and <=10 8% if Less than 6 years 5%. Ask user for their salary and years of service and print the net bonus amount.
You have been appointed as IT Head of a soon to be opened bank in India by the name of “People’s bank” which will have branches all over India. People’s bank is a private sector bank. Highlight atleast 5 security threats that a bank may face in today’s times and suggest 5 innovative IT security mechanisms to ensure that such threats do not harm your bank & that your systems remain as secure as ever.
Write a program in C++ to input 10 numbers and print only abundant numbers.
An abundant number is the number for which the sum of its proper divisors(excluding the
number itself) is greater than the original number.
Sample input: 12
Sample output:
Its proper divisors are 1, 2, 3, 4 and 6
Sum = 1 + 2 + 3 + 4 + 6 =16
Hence 12 is an abundant number.
Write a program in C++ to print the following pattern:
5
5 4
5 4 3
5 4 3 2
5 4 3 2 1
Write a menu driven program using Switch Case in C++ to input a number and perform the
following tasks:
(i) Count and print the number of its digits.
(ii) Print the sum and product of its digits.
Write a program in C++ to print the sum of first 20 even numbers and odd numbers
separatel