halfyearly2023
halfyearly2023
10; i++) System.out printin(i); System.out.printin(i * 4); Section - B (Attempt any four questions.) ‘The answer in this section should consist of the programs in either Blue J environment or any program environment with Java as the base. Each ‘Program should be written using Variable Description/Mnemonic codes ‘so that the logic of the program is clearly depicted. v3 Define a class Security with the following description :[15] Class: Security Data Members/Instance variables String n to store the name int oh :_ to store the number of hours double r + to store the rate of the wages double w 2 to store the wages Member methods : void accept() : to accept the name, rate and number of hours. voidcalwage() tocalculate the wages of an employee as per the following. Number ofhours Rate Upto 40 Hrs. Q)hour For next 20 Hrs. 11.5ihour For next 20 Hrs. 2mour Void display): _ to display the Name and wages ‘Write main() method to create an object of the class and call the above member methods. 4, Design n class to overload a function SumSeriesO as follows : a) void SumSeries(int n, double x) - with one integer argument and one double argument to find and display the sum of the series given below : Riek ox x Teas ats 15] ton terms| X-Comp. [6] ,8<—Write a menu driven program to print the following b) void SumSeries(int n) — To display the following Seties- 2 9 2B 65..cccecceeee up to n terms . Write a program to accept a 4 digits integer and check whether that integer is a Strontio number or not.Strontio numbers are those four digits numbers when multiplied by 2 give the same digit at the hundreds and tens place, e.g. 1386*2=2772, here at tens and hundreds place digits are the same. Hence, 1386 is a Strontio number. [15] 4 Write a program to accept two words and check whether that two words are Anagram or not. Two words are said to be Anagram if they are of same length and are formed by same characters. [15] e.g. RACE and CARE, WOLF and FLOW Special words are those words which starts and ends with the same letter. Examples : EXISTENCE, COMIC, WINDOW Palindrome words are those words which read the same from left to right and vice versa. Examples : MALAYALAM, MADAM, LEVEL, ROTATOR, CIVIC All palindromes are special words, but all special words are not palindromes. Write a program to accept a word check and print whether the word is a palindrome or only special word. [15] patterns : [15] a) To print the Floyd's triangle [Given below] 1 2 3 4 5 6 7 8 9 10 11 12 13° 14 15 b) * +e RK RE RRA aoa —