22 solutions available
Question 1Write a program to generate the following output.@ @ # @ # @ @ # @ # @ # @ # @ public class KboatPattern { public static void...
Question 2(i)Write a program in Java to display the following patterns.1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 public class KboatPattern {...
Question 2(ii)Write a program in Java to display the following patterns.1 * * * * * 2 * * * * * 3 * * * * * 4 * * * * * 5 public class KboatPattern {...
Question 2(iii)Write a program in Java to display the following patterns.# * * # # # * * * * # # # # # public class KboatPattern { public static...
Question 2(iv)Write a program in Java to display the following patterns.1 * * * * 2 2 * * * 3 3 3 * * 4 4 4 4 * 5 5 5 5 5 public class KboatPattern {...
Question 2(v)Write a program in Java to display the following patterns.$ $ $ $ 5 $ $ $ 4 $ $ 3 $ 2 1 public class KboatPattern { public static...
Question 2(vi)Write a program in Java to display the following patterns.A B C D E A B C D A B C A B A public class KboatPattern { public static...
Question 2(vii)Write a program in Java to display the following patterns.5 4 3 2 1 4 3 2 1 3 2 1 2 1 1 public class KboatPattern { public static...
Question 2(viii)Write a program in Java to display the following patterns.I I C I C S I C S E public class KboatPattern { public static void...
Question 2(ix)Write a program in Java to display the following patterns.1 2 3 4 5 1 2 3 4 1 2 3 1 2 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 public class...
Question 2(x)Write a program in Java to display the following patterns.1 2 3 4 5 2 3 4 5 3 4 5 4 5 5 4 5 3 4 5 2 3 4 5 1 2 3 4 5 public class...
Question 3(i)Distinguish between the following:break statement and labelled break statement
Question 3(ii)Distinguish between the following:continue statement and labelled continue statement
Question 4Write a program to print the series given below.8 88 888 8888 88888 888888public class Kboat8Series { public static void main(String...
Question 5(i)What will be the value of sum after each of the following nested loops is executed?int sum = 0; for (int i = 0; i <= 10; i++) for...
Question 5(ii)What will be the value of sum after each of the following nested loops is executed?int sum = 0; for (int i = 1; i <= 3; i++) for...
Question 6Write a program to generate a triangle or an inverted triangle till n terms based upon the user's choice of triangle to be...
Question 7Write a program to compute and display factorials of numbers between p and q where p > 0, q > 0, and p > q.import...
Question 8Write a program to determine if an entered number is a Happy Number. A happy number is defined by the following process:Starting with any...
Question 9Write a menu driven program that prompts the user to select one of the four triangle patterns (a, b, c, or d). The program then accepts...
Question 10Write a menu driven program that prompts the user to select one of the four triangle patterns (a, b, c or d). The program then accepts...
Question 11Write a program that computes sin x and cos x by using the following power series:sin x = x - x3/3! + x5/5! - x7/7! + ......cos x = 1 -...